To extract the text before a specific character in Excel, use the LEFT function combined with FIND. For example, if cell A1 contains "apple,banana" and you want everything before the comma, the formula is =LEFT(A1, FIND(",", A1) - 1). This returns "apple". The same pattern works for any delimiter—spaces, hyphens, pipes, or even multi-character strings—and it updates automatically if the source text changes. You do not need any add-ins or macros; these are built-in functions available in every modern version of Excel, including Excel for Microsoft 365, Excel 2021, 2019, and 2016, as well as Excel for Mac and Excel for the web.

What You'll Need

  • Excel 2016 or later (or Microsoft 365) on Windows, Mac, or the web. The formulas here work in all these versions.
  • Text data in a cell that contains a predictable delimiter character (comma, space, semicolon, etc.).
  • Basic familiarity with typing formulas into the formula bar.

Step-by-Step

  1. Identify your delimiter. Look at the text in your cell and decide which character marks the split point. For example, in "John Smith" the delimiter is a space; in "product-123" it is a hyphen. Note whether the character appears more than once—FIND always locates the first occurrence, which is usually what you want for "before the first X".
  2. Select the cell where you want the result. Click an empty cell to the right of your data, or any blank cell on the same sheet. This is where the extracted substring will appear.
  3. Type the LEFT and FIND formula. In the selected cell, enter:
    =LEFT(A1, FIND(",", A1) - 1)
    Replace A1 with the reference to your text cell, and replace the comma inside the quotes with your actual delimiter. For a space, use " "; for a hyphen, use "-". The -1 is essential: FIND returns the position of the delimiter, and you want everything before it, so you subtract one character.
  4. Press Enter. The cell now shows the substring before the first occurrence of your delimiter. If the delimiter is not found, the formula returns a #VALUE! error—see Troubleshooting below.
  5. Copy the formula down. Drag the fill handle (the small square at the bottom-right of the cell) down to apply the same formula to other rows. Relative references adjust automatically, so each row uses its own text cell.
  6. Optional: handle missing delimiters gracefully. Wrap the formula in IFERROR to avoid ugly errors when a cell does not contain the delimiter:
    =IFERROR(LEFT(A1, FIND(",", A1) - 1), A1)
    This returns the original text if the delimiter is absent. You can also return an empty string "" instead of A1 if you prefer a blank result.
  7. Optional: extract before a multi-character delimiter. FIND and LEFT work with strings longer than one character. For example, to get text before " - " (space hyphen space), use =LEFT(A1, FIND(" - ", A1) - 1). The same logic applies.
  8. Convert to values if needed. If you want to remove the formulas and keep only the results, select the result cells, copy them (Ctrl+C), then right-click and choose Paste Special > Values. This is useful before deleting the original column.

Common Mistakes

  • Forgetting the -1. Without subtracting 1, the formula includes the delimiter itself. For example, LEFT(A1, FIND(",", A1)) returns "apple," instead of "apple".
  • Using a hard-coded cell reference incorrectly. If you copy the formula without adjusting the reference (e.g., using $A$1), every row will show the same result. Use relative references like A1, A2, etc.
  • Mismatched delimiter case. FIND is case-sensitive. If your delimiter is a letter (e.g., "x"), FIND will not match "X". Use SEARCH instead of FIND if you need case-insensitive matching: =LEFT(A1, SEARCH("x", A1) - 1).
  • Not accounting for leading/trailing spaces. If your text has extra spaces around the delimiter, the extracted substring may include them. Use TRIM on the result: =TRIM(LEFT(A1, FIND(",", A1) - 1)).
  • Assuming the delimiter exists in every cell. If some cells lack the delimiter, FIND returns an error. Always wrap in IFERROR or check with ISNUMBER(FIND(...)).

Tips

  • Use a cell reference for the delimiter instead of hard-coding it, so you can change it easily: =LEFT(A1, FIND(B1, A1) - 1) where B1 contains the delimiter character.
  • To extract text before the last occurrence of a character, use SUBSTITUTE to replace the last instance with a unique marker, then FIND that marker. Example for last comma: =LEFT(A1, FIND("|", SUBSTITUTE(A1, ",", "|", LEN(A1)-LEN(SUBSTITUTE(A1, ",", "")))) - 1).
  • For a quick non-formula approach, use Data > Text to Columns with the delimiter option. This splits the text into separate columns, but it is destructive (overwrites adjacent cells) and does not update automatically.
  • If you are on Excel for the web or Microsoft 365, you can use TEXTBEFORE (available in Excel 2024 and Microsoft 365) for a simpler formula: =TEXTBEFORE(A1, ","). This function is not available in older versions.
  • Remember that FIND counts every character, including spaces. If your delimiter is a space, the position returned is the first space, which is correct for extracting the first word.

Troubleshooting

  • #VALUE! error: The delimiter was not found in the text. Check that the delimiter matches exactly (case-sensitive for FIND). Use IFERROR to handle it, or verify the text contains the character.
  • Result includes the delimiter: You forgot the -1. Add it after the FIND function.
  • Result is empty or truncated: The delimiter might be at the very start of the text (position 1), so LEFT with 0 characters returns an empty string. That is correct behavior.
  • Formula not updating when text changes: Ensure calculation is set to Automatic (Formulas > Calculation Options > Automatic). Also check that you are not in manual calculation mode.
  • #NAME? error: You may have misspelled a function name (e.g., LEFT vs. LEF) or used a function not available in your Excel version (like TEXTBEFORE in older versions).
  • Delimiter is a special character like ? or *: FIND treats these as literal characters, not wildcards, so no special handling is needed. SEARCH, however, treats them as wildcards; if using SEARCH, escape them with a tilde (~).

Frequently Asked Questions

Can I extract text before a character without using FIND?

Yes, in Excel 2024 and Microsoft 365 you can use TEXTBEFORE: =TEXTBEFORE(A1, ","). In older versions, LEFT and FIND is the standard method.

How do I get everything before the second occurrence of a character?

Use FIND nested with FIND to locate the second instance: =LEFT(A1, FIND(",", A1, FIND(",", A1)+1) - 1). This finds the first comma, then searches for the next one starting after it.

What if the character appears multiple times and I want the last part?

Use the SUBSTITUTE trick shown in the Tips section to replace the last occurrence with a unique marker, then extract before that marker.

Does this work with numbers stored as text?

Yes, LEFT and FIND treat numbers as text. If your cell contains a number (not text), you may need to convert it to text first using TEXT or by prefixing with an apostrophe.

Can I use a wildcard in FIND?

No, FIND does not support wildcards. Use SEARCH if you need wildcard behavior, but note that SEARCH treats ? and * as wildcards.

Why does my formula return #VALUE! for some rows but not others?

Those rows likely do not contain the delimiter. Wrap the formula in IFERROR to return a blank or the original text instead of an error.