ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Comparisons
  3. LEFT vs TEXTBEFORE: Which Splits Text Better?

LEFT vs TEXTBEFORE: Which Splits Text Better?

By ExcelReady Team·Updated October 30, 2026·7 min read

The short answer

Use LEFT when the part you want is always the same length, such as a 2-letter region code. Use TEXTBEFORE when the part ends at a delimiter, such as a dash, space or @, and its length varies. TEXTBEFORE needs Microsoft 365, Excel 2024 or Excel for the web; in older Excel, use LEFT with FIND.

Key takeaways

  • LEFT(text, num_chars) counts characters from the start; it doesn't care what they are.
  • TEXTBEFORE(text, delimiter) returns everything before a delimiter, whatever its length.
  • LEFT with FIND does the same job as TEXTBEFORE and works in every version of Excel.
  • TEXTBEFORE can split at the second or last delimiter, and has a built-in fallback when the delimiter is missing.
  • Both return text, so wrap number results in VALUE before you add them up.
On this page+
  1. LEFT vs TEXTBEFORE at a glance
  2. How each function works
  3. The same codes, side by side
  4. Which version of Excel do you have?
  5. When to use LEFT
  6. When to use TEXTBEFORE
  7. Common mistakes with LEFT and TEXTBEFORE
  8. Our recommendation
  9. Practise it

The answer to LEFT vs TEXTBEFORE depends on how the text is built. LEFT takes a fixed number of characters from the start, which is perfect when every code has the same length. TEXTBEFORE takes everything before a delimiter such as a dash, space or @, which is what you need when lengths vary. This comparison is for anyone splitting codes, names or emails who wants the formula that won't break on the next row.

LEFT vs TEXTBEFORE at a glance#

LEFT counts characters. TEXTBEFORE looks for a marker.

FeatureLEFTTEXTBEFORE
Syntax=LEFT(text, [num_chars])=TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
How it decides where to stopA number of charactersA delimiter (one or more characters)
Variable-length partsNeeds FIND or SEARCH insideHandles them directly
Split at the 2nd or last delimiterLong formulainstance_num 2 or -1
Delimiter missing#VALUE! (with FIND)#N/A, or the if_not_found value
Case-insensitive delimiterUse SEARCH instead of FINDmatch_mode 1
Result typeTextText
Excel versionsAll versionsMicrosoft 365, Excel 2024, Excel for the web

How each function works#

LEFT returns the first n characters: =LEFT("NY-1182",2) gives NY. If you leave out num_chars, it returns 1 character. It never looks at what the characters are, which is both its strength and its weakness. The LEFT function guide and LEFT, RIGHT and MID cover it with RIGHT and MID.

TEXTBEFORE finds the delimiter and returns what comes before it: =TEXTBEFORE("LON-4521","-") gives LON. Its optional arguments choose which delimiter to use, whether case matters, and what to return when the delimiter is missing. Its partner, TEXTAFTER, returns the part after the delimiter; TEXTBEFORE and TEXTAFTER covers both.

The same codes, side by side#

Here are product codes whose region prefix is 2 or 3 letters long:

ALEFT(A2,2)LEFT + FINDTEXTBEFORE
2NY-1182NYNYNY
3LON-4521LOLONLON
4SF-77SFSFSF
5BRS-3004-BBRBRSBRS
6MANMA#VALUE!#N/A

The three formulas, in row 2:

Excel formula
=LEFT(A2,2)
=LEFT(A2,FIND("-",A2)-1)
=TEXTBEFORE(A2,"-")

Plain LEFT is wrong for LON and BRS, because it always takes two characters. It doesn't show an error, so the mistake is easy to miss.

LEFT with FIND gets them right. FIND returns the dash's position (4 in LON-4521), and minus 1 stops just before it. This works in every version of Excel.

TEXTBEFORE gets them right with a shorter, readable formula. For BRS-3004-B it stops at the first dash.

When the delimiter is missing#

Row 6, MAN, has no dash. LEFT with FIND returns #VALUE! because FIND fails. TEXTBEFORE returns #N/A. Each has a fix:

Excel formula
=IFERROR(LEFT(A6,FIND("-",A6)-1),A6)
=TEXTBEFORE(A6,"-",,,,A6)
=TEXTBEFORE(A6,"-",,,1)

All three return MAN. The second uses if_not_found (the sixth argument) to return the whole cell. The third sets match_end to 1, which treats the end of the text as a delimiter.

Splitting at the last delimiter#

For BRS-3004-B, suppose you want everything before the last dash. TEXTBEFORE takes -1 as the instance number:

Excel formula
=TEXTBEFORE(A5,"-",-1)

The result is BRS-3004. With LEFT, you'd need SUBSTITUTE and LEN to find the last dash, which is hard to read and easy to get wrong.

Getting the part after the dash#

The same contrast applies on the other side of the delimiter, where RIGHT meets TEXTAFTER. To get the number from LON-4521:

Excel formula
=RIGHT(A3,LEN(A3)-FIND("-",A3))
=TEXTAFTER(A3,"-")

Both return 4521. The RIGHT version works out how many characters follow the dash: the total length (LEN, 8) minus the dash's position (FIND, 4), which is 4. TEXTAFTER just names the delimiter. For BRS-3004-B, TEXTAFTER with -1 returns B, the part after the last dash.

Remember that both results are text. =VALUE(TEXTAFTER(A3,"-")) turns "4521" into the number 4521, so SUM and comparisons work.

Which version of Excel do you have?#

Before choosing, check your version: in Windows Excel, go to File > Account and look under Product Information; on a Mac, choose Excel > About Excel. If it says Microsoft 365 or Excel 2024, TEXTBEFORE is available. If it says Excel 2021, 2019 or 2016, it isn't, and a TEXTBEFORE formula shows #NAME?.

If you don't know which version a test or a colleague uses, LEFT with FIND is the safe choice. It gives the same result for every row that contains the delimiter.

When to use LEFT#

Use LEFT when the length is fixed or the file must work everywhere. It is the better choice when:

  • Every value has the same structure, such as TX-ELC-40512, where the region is always 2 characters.
  • You need a set number of characters, such as the first letter of a name for initials: =LEFT(A2,1).
  • The workbook must open in Excel 2021 or older. Use LEFT with FIND for variable lengths.
  • A job test asks for it. LEFT, RIGHT, MID and FIND are still the classic text questions.

When to use TEXTBEFORE#

Use TEXTBEFORE when a delimiter marks the end of the part you want and everyone has Microsoft 365 or Excel 2024. It is the better choice when:

  • Lengths vary, such as first names before a space or usernames before an @.
  • You need the 2nd or last delimiter, such as a folder path or a name with a middle name.
  • Some rows may not have the delimiter and you want a clean fallback.
  • Readability matters. TEXTBEFORE(A2,"@") says exactly what it does.

Splitting full names is the most common real case; see how to split first and last names.

Common mistakes with LEFT and TEXTBEFORE#

  1. Using a fixed LEFT on variable data. It silently returns wrong results, like LO instead of LON. Check a few rows with different lengths.
  2. Forgetting the -1 with FIND. =LEFT(A2,FIND("-",A2)) includes the dash: NY-.
  3. Expecting a number back. Both return text, so =LEFT("2026-Q4",4) gives the text "2026". Wrap it in VALUE to calculate with it.
  4. Hidden spaces. A leading space in " NY-1182" shifts LEFT's count. Clean with TRIM first.
  5. Case in letter delimiters. TEXTBEFORE is case-sensitive by default, so "X" won't match "x". Use match_mode 1, or SEARCH instead of FIND with LEFT.
  6. Sharing TEXTBEFORE with Excel 2021 users. They see #NAME?. Use LEFT with FIND if you're not sure.

If you'd rather not write a formula at all, Flash Fill vs formulas and Text to Columns vs TEXTSPLIT compare the click-based options.

Our recommendation#

Use TEXTBEFORE for new work on Microsoft 365 or Excel 2024 whenever a delimiter marks the split. It is shorter, it handles variable lengths, and its extra arguments solve the "second dash" and "no dash" problems that make LEFT formulas messy.

Keep LEFT for fixed-length parts and for files that must work in older versions, where LEFT(A2,FIND("-",A2)-1) is the reliable pattern. Learn both: job tests often run on unknown versions, and LEFT with FIND works on all of them.

In short: LEFT for fixed lengths and old Excel, TEXTBEFORE for anything that ends at a delimiter.

Practise it#

Split the region code in the exercise on this page. Then practise fixed-length splits in the LEFT, RIGHT, MID and LEN lesson, and delimiters, instance numbers and the LEFT + FIND fallback in the TEXTBEFORE and TEXTAFTER lesson.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Each code starts with a region of 2 or 3 letters, then a dash. A3 is LON-4521, so LEFT(A3,2) would give the wrong answer. In B3, use TEXTBEFORE to return everything before the dash.

fx
ABCD
1
Code
Region
2
NY-1182
3
LON-4521
4
SF-77
5
BRS-3004
6
7
8

Tip: TEXTBEFORE needs the text (A3) and the delimiter in quotes ("-"). The result is LON.

Practise this in a lesson

LessonLEFT, RIGHT, MID and LENSplit product codes and IDs into their parts by taking characters from the start, end or middle of the text.LessonTEXTBEFORE and TEXTAFTERSplit emails, "Last, First" names and file paths at a delimiter with TEXTBEFORE and TEXTAFTER, including picking which occurrence to split at.Function guideLEFTPull the first characters from a cell with Excel's LEFT: prefixes, initials and first names. Examples, pitfalls and live practice.

Frequently asked questions

What is the difference between LEFT and TEXTBEFORE?

+

LEFT returns a fixed number of characters from the start of the text. TEXTBEFORE returns everything before a delimiter you name, so it adapts when the first part is longer or shorter.

Which versions of Excel have TEXTBEFORE?

+

Microsoft 365, Excel 2024 and Excel for the web. Excel 2021, 2019 and older show #NAME?, so use LEFT with FIND there.

How do I get the text before a dash without TEXTBEFORE?

+

Use LEFT and FIND: =LEFT(A2,FIND("-",A2)-1). FIND gives the dash's position, and minus 1 stops just before it.

What happens if the delimiter isn't there?

+

TEXTBEFORE returns #N/A, and LEFT with FIND returns #VALUE!. TEXTBEFORE's sixth argument, if_not_found, shows a fallback instead, such as the whole cell: =TEXTBEFORE(A2,"-",,,,A2).

Can TEXTBEFORE split at the last space?

+

Yes. Use -1 as the instance number: =TEXTBEFORE(A2," ",-1) returns everything before the last space. With LEFT, that takes a much longer formula.

Sources

  • LEFT, LEFTB functions - Microsoft Support
  • TEXTBEFORE function - Microsoft Support
  • FIND, FINDB functions - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. LEFT vs TEXTBEFORE at a glance
  2. How each function works
  3. The same codes, side by side
  4. Which version of Excel do you have?
  5. When to use LEFT
  6. When to use TEXTBEFORE
  7. Common mistakes with LEFT and TEXTBEFORE
  8. Our recommendation
  9. Practise it

Keep reading

Comparisons· 7 min read

Text to Columns vs TEXTSPLIT in Excel

Use Text to Columns for a one-off clean-up: it splits a column into several in a few clicks, converts numbers and dates, and works in every desktop version of Excel. Use TEXTSPLIT when the data will change or be pasted in again: it is a formula that re-splits automatically, but it needs Microsoft 365, Excel 2024 or Excel for the web.

Comparisons· 7 min read

Flash Fill vs Formulas: When to Use Each

Use Flash Fill for a quick one-off clean-up: type one example of the result, press Ctrl+E, and Excel fills the rest of the column with plain values. Use a formula when the data will change, new rows will be added, or someone needs to see how the result was made, because formulas recalculate and Flash Fill doesn't.

Text· 6 min read

LEFT, RIGHT and MID in Excel: Pull Out Part of a Cell

LEFT, RIGHT and MID pull part of the text out of a cell. LEFT(text, num_chars) takes characters from the start, RIGHT(text, num_chars) takes them from the end, and MID(text, start_num, num_chars) takes them from any position. For TX-ELC-40512, LEFT(A2,2) gives TX, MID(A2,4,3) gives ELC and RIGHT(A2,5) gives 40512.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free