Extracting a cell's content — pulling out just the first name from a full name, just the number from "12 units", or just the date from a timestamp — comes down to one of three tools: a text function built specifically for the job (TEXTBEFORE, TEXTAFTER, TEXTSPLIT), the older LEFT/RIGHT/MID family, or Power Query when you need to do it to a whole column repeatedly. If you only want the value copied somewhere else, a plain cell reference or Paste Special is faster than any formula; the functions matter when you need to strip a piece out of text that is mixed together in one cell.

The steps below use Excel on Windows or Mac desktop, where the full formula set is available. Excel for the web supports most of these, but the exact menu labels can differ slightly by version, device and region, so read the intent rather than the exact wording if something does not match.

What You'll Need

  • Excel 2019 or later, Microsoft 365, or Excel for the web if you want the TEXTBEFORE/TEXTAFTER/TEXTSPLIT functions — they are not in Excel 2016 and earlier.
  • Your data in a clean column, ideally with no blank rows interrupting it.
  • A quick look at a few sample cells so you can confirm which part of the text is fixed and which varies — this determines whether a simple formula will work or you need a more flexible one.
  • A backup copy or an empty helper column if you plan to overwrite the original data.

Step-by-Step

  1. Work on a copy first. Add a helper column next to the data, or duplicate the sheet. Formulas are easy to undo; Paste Special values are not.

  2. Identify the delimiter. Look at several cells and find the character that separates the pieces — a space, a comma, a hyphen, an "@", a colon. If the position of the piece you want changes from row to row (sometimes "Smith, John", sometimes "John Smith"), you cannot use a fixed-count function like LEFT or RIGHT and must split on the delimiter instead.

  3. Extract with TEXTBEFORE or TEXTAFTER for delimited text. In an empty cell beside the first row (say the full name is in A2) type =TEXTBEFORE(A2,"@") to get everything before the @ in an email address, or =TEXTAFTER(A2,", ") to get the part that follows a comma. Add a third argument if you need the second occurrence: =TEXTAFTER(A2," ",2) returns the text after the second space.

  4. Extract with TEXTSPLIT when the pieces should go into separate columns. Type =TEXTSPLIT(A2," ") and press Enter. The result spills across adjacent columns automatically, giving you each word in its own cell — the cleanest way to split full names, addresses or product codes. Leave enough empty columns to the right or you get a #SPILL! error.

  5. Extract by position with MID, LEFT or RIGHT when the layout is fixed. If every value looks like "INV-2024-0042", the prefix is always four characters and the year always starts at position 5: =MID(A2,5,4) returns the year, =LEFT(A2,4) returns the prefix. Use FIND instead of a hard number if the position varies, for example =MID(A2,FIND("-",A2)+1,4).

  6. Strip out characters that pad the value. Extra spaces are the most common reason an extraction "works" but lookups then fail. Wrap the result: =TRIM(TEXTBEFORE(A2,"@")). Use CLEAN as well if the data was pasted from a web page and contains non-printing characters.

  7. Convert text numbers into real numbers. A number pulled out with a text function is still text. Multiply by 1, wrap it in VALUE(...), or use --LEFT(A2,3) so it can be summed and charted.

  8. Fill the formula down the column. Drag the fill handle at the bottom-right corner of the cell, or double-click it to fill to the end of the adjacent data. Spilling functions like TEXTSPLIT do this for you.

  9. Check a sample of rows against the original. Sort or filter the helper column for blanks and errors — blanks usually mean a row had no delimiter, and #VALUE! usually means a position argument overshoots the text length.

  10. Lock the results in before deleting the source. Select the helper column, copy it, then use Paste Special > Values (or right-click > Paste Options > Values) to replace formulas with plain data, and only then delete the original column. If you skip this, deleting the source column leaves every formula pointing at nothing.

  11. For repeated or messy imports, use Power Query instead. Select the table, then Data > From Table/Range, and in the Power Query Editor use Split Column (by delimiter or by number of characters) or Column From Examples. Load the result back with Close & Load. The advantage is that the steps are recorded, so next month's file is cleaned the same way by refreshing.

Common Mistakes

  • Counting characters from the wrong end. LEFT and MID start at the first character; RIGHT counts backwards from the last. Mixing them up extracts the wrong slice silently, with no error.
  • Forgetting that FIND is case-sensitive and SEARCH is not. If the delimiter could be uppercase or lowercase, SEARCH is the safer choice.
  • Leaving trailing spaces. "John " is not equal to "John", so VLOOKUP and XLOOKUP quietly return #N/A. Always wrap extracted text in TRIM.
  • Using fixed positions on variable data. Any cell whose format differs by even one character breaks the whole column. Test the delimiter approach first.
  • Deleting the source column while formulas still depend on it. Convert to values first.
  • Ignoring #SPILL!. A spilled result needs empty cells to expand into. Clear the neighbouring column or move the formula.
  • Treating extracted numbers as text. They will not sum, and pivot tables may count them instead of adding them.

Tips

  • Use Flash Fill for a one-off job: type the extracted value beside the first two or three rows, then press Ctrl+E on Windows (Cmd+E on Mac) to have Excel complete the pattern. It gives plain values, not formulas, so verify each result.
  • TEXTBEFORE and TEXTAFTER accept an instance number, so you can pull the middle of three delimited pieces without nesting functions.
  • Wrap extraction formulas in IFERROR to keep a clean-looking sheet: =IFERROR(TEXTBEFORE(A2,"@"),"").
  • If you find yourself writing a very long nested formula, that is a signal to use Power Query or to split the data into columns once with Text to Columns (Data tab) instead.
  • Keep the original column hidden rather than deleted until you are satisfied with the extracted values.

Troubleshooting

The formula returns #VALUE! A numeric argument is pointing past the end of the text — for example MID with a start number larger than the string length. Check the length with LEN(A2) and adjust, or wrap in IFERROR.

Extraction returns the whole cell unchanged. The delimiter argument does not match what is actually in the cell. A comma followed by a space is not the same as a comma alone. Look closely at the cell, including whether the separator is a semicolon in your regional settings.

Some rows are blank. Those rows lack the delimiter, or have an extra leading space. Filter for blanks in the helper column and inspect the source cells, then use TRIM or a fallback formula.

#NAME? error. The function is not recognised by your version. TEXTBEFORE, TEXTAFTER, TEXTSPLIT and similar newer functions need a current version of Excel; on older copies use the LEFT/MID/FIND combination instead.

The numbers will not add up. They are stored as text. Convert with VALUE or Paste Special > Multiply by 1.

Text to Columns split your data incorrectly. It is destructive — it overwrites the column. Undo with Ctrl+Z straight away, or use Power Query which keeps the source intact.

Frequently Asked Questions

How do I extract only the number from a cell that mixes text and figures?

If the digits are at a fixed place, MID with LEN works: =MID(A2,MIN(FIND({"0","1","2","3","4","5","6","7","8","9"},A2&"0123456789")),LEN(A2)). For a column you will repeat monthly, Power Query is far simpler.

Can I extract text from a cell without a formula?

Yes — copy the cell and paste it elsewhere, use Flash Fill (Ctrl+E), or use Data > Text to Columns. All three give plain values rather than live formulas.

What is the difference between FIND and SEARCH?

Both return the position of a character, but FIND is case-sensitive and does not accept wildcards, while SEARCH is case-insensitive and does.

Why does TEXTSPLIT show a #SPILL! error?

The neighbouring cells are not empty. Delete or move their contents so the result has room to expand.

How do I extract text between two characters?

Nest the functions: =TEXTBEFORE(TEXTAFTER(A2,"("),")") returns whatever sits between the opening and closing brackets.

Does this work in Google Sheets?

Sheets has SPLIT, LEFT, MID, RIGHT, FIND and REGEXEXTRACT, but the TEXTBEFORE/TEXTAFTER functions were added to Excel and Sheets separately — check your version before relying on them.