How to Extract Specified Text and Data from Cells in Excel

When the position of the target content within a cell is not fixed, you can locate it by keyword, split it by delimiter, or use Flash Fill. This article explains the applicable scenarios, operation steps, and how to verify the results for these three general methods.

Key Points of This Article

  • When the position of the target content is not fixed, first look for the stable keywords or symbols before and after it, then use a locating function to extract the value; this is more reliable than counting positions by hand.
  • When the content has a consistent separator (comma, space, dash), use "Text to Columns" because it is faster and requires no formula.
  • When the format pattern is obvious but there is no separator, manually demonstrate one result in an adjacent column, then use "Flash Fill" to complete the rest in batch.
  • After extraction, spot-check the first row, the last row, and a few rows with special formatting, and check whether any error values or extra spaces have appeared.

When organizing data in Excel, you often run into situations like this: a single cell contains an entire sentence, such as "Order No.: X123, Quantity: 580 pieces, Orderer: Wang Min", and you only want to pull out the quantity or the orderer on its own. Many people instinctively think of character positions, but the cells in the same column vary in length, and the number of characters before the target content differs, so cutting at fixed positions will produce errors.

This article is written for people who need to organize customer lists, order records, contract clauses, or survey questionnaires. If you are looking for ways to extract the content you want from a cell in Excel, the core idea is this: don't count positions. Instead, find stable markers around the target content, such as keywords, colons, commas, or spaces, and extract the value based on them. After reading, you will be able to judge which method suits your situation, complete the extraction by following the steps, and know how to verify the results.

When the target content's position isn't fixed, which method should you use? One-sentence conclusion: first check whether there are delimiters and fixed keywords, then choose the method.

First, a one-line rule: if the content is separated by a consistent symbol, use Text to Columns; if there is no symbol but there is a pattern, use Flash Fill; if the pattern is complex or needs to be reused repeatedly, use text functions. The table below can help you quickly match each case.

Your situationRecommended PracticesCause
Within a cell, use commas, spaces, hyphens, and similar separators consistently.Split (by delimiter)One-time operation, no formula needed; the result is split directly into multiple columns
Fixed keywords appear before and after the target, such as "Quantity:" and "pieces"FIND or SEARCH combined with MID to extract a valueLocate by keyword; content of different lengths can still be retrieved, and formulas recalculate automatically after the data is updated.
No symbols, but each entry's wording is largely consistent.Flash FillJust demonstrate one result alongside, and the software will recognize the pattern and fill in the rest in bulk.
Only a few items need to be processed, and the content is for one-time use.Manually copy or use find and replaceWhen there are few items, do it directly, which reduces the chance of formula errors.
The data will keep growing and needs to be reused over the long term.Text functions formula, plus IFERROR for error toleranceWhen new data is pasted in, it can be extracted automatically, without having to redo the work each time.

Before You Begin: Confirm These Points

Look at the samples first, and don't just check the first row. Open a dozen or so rows at random and see whether the target content always appears after the same markers. If some cells read "数量 580 件" and others read "数量: 580 件", the two formats affect how you choose keywords, so you need to standardize them or handle them separately first.

Confirm whether both the target content and the source text are text. In data exported from web pages or systems, numbers are sometimes stored as text and sometimes as numeric values. Text and numbers behave differently in formula results and sorting, so check the format again after extracting the values.

Note the characters that can interfere with lookups. The full-width colon ": " and the half-width colon ":" look the same, but they are not equal in formulas; stray spaces can also cause keywords to go unfound. Test a cell or two in advance, and you can save a lot of rework.

Keep the original data. Whichever method you use, first make a copy of the original sheet, or write the results into new columns. Once text-to-columns overwrites the source data, it becomes troublesome to recover.

Confirm your Excel version. Some newer versions provide dedicated functions for extracting text based on its position, while older versions do not. If a colleague's version is different, the formula may display an error; in that case, it is safer to use a combination of FIND and MID instead.

Steps for Extracting Content by Keyword Using FIND and MID

Using the content of cell A2, "订单号:X123,数量:580 件,下单人:王敏", as an example, the following demonstrates how to extract the quantity number "580". This method applies to cases where there are stable keywords before and after the target.

  1. Find the anchor points. On paper or in a blank cell beside the data, write down the keywords: the marker before the quantity is "数量:", and the end marker is "件". Both words must appear in every record for them to work as anchors.
  2. Determine the starting position. In an empty cell, enter =FIND("数量:",A2) to get the character position where the keyword starts. The keyword "数量:" has 3 characters, so the actual number starts at this position plus 3.
  3. Determine the end position. Enter =FIND("件",A2), which gives the position number of "件". The length of the number is the position of "件" minus the starting position of the number.
  4. Combine the extraction formula. Enter =MID(A2,FIND("数量:",A2)+3,FIND("件",A2)-FIND("数量:",A2)-3) in the target cell, press Enter, and you get 580. The three arguments of MID are the source text, the start position, and the length to extract.
  5. Add error handling. If a record does not contain the character "件", the formula returns an error value. You can wrap the original formula in IFERROR, for example =IFERROR(原公式,"待核对"), so that abnormal rows display prompt text instead of mixing into the results.
  6. Fill down. Select the formula cell, then drag the fill handle at its lower-right corner, or double-click it, to apply the formula to the entire column.
  7. Remove extra spaces. If the result has leading or trailing spaces, you can wrap it in TRIM to strip them out.
  8. Check before replacing. Once you confirm the results are correct, copy and paste the values as values into the target column, so that deleting the source data later won't break formulas.

If the target is English or mixed letters and digits, FIND is case-sensitive while SEARCH is not, so when the case is inconsistent you can switch to SEARCH.

Verify item by item after completion

After extraction is complete, don't hand it off directly. The checklist below catches most common problems.

Inspection itemHow do you look at it?What should I do if I have a problem?
Error valueDoes the result column contain errors such as #VALUE! or #N/A?Use filtering to find these rows, then go back to the original text to check whether key terms are missing or whether special notations need handling.
First line and last lineCompare against the original text, going through the first few lines and the last few lines one by one.If the first line is misaligned, the starting keyword calculation is most likely wrong. Check whether you have added too few or too many characters.
Extra spacesWhether there is whitespace on the left or right of the result can be checked with the help of a length function.Wrap the outer layer with TRIM, or tick the option to remove spaces when using Text to Columns.
Number formatCan the extracted numbers be used in a sum?If not, multiply by 1 or use Text to Columns to convert to numeric format
Special notationSpot-check a few rows with different formats, such as ones with parentheses or decimal points.List these kinds of records separately, then fix them manually or add conditions to handle them.

If the target content comes from a machine-recognized scanned document, you should also check whether the original text was recognized accurately before extraction, because typos or omitted symbols will directly cause locating to fail. For machine-translated or machine-recognized content, please verify important numbers and names item by item.

📊 Core Comparison

Three commonly used methods each have their own focus, and they can be compared from the following angles.

MethodAdvantagesLimitationsSuitable scenarios
Split into columnsIntuitive operation, no formulas needed, fast speed.Relying on a unified delimiter means that once the delimiters become inconsistent, the work has to be redone.Exported specification data, such as a list joined with commas
Flash FillNeeds no formulas; can recognize simple textual patternsWhen the patterns are complex or the sample size is small, identification may be inaccurate, and the results do not update automatically with the source data.Organize everything at once; the writing style is fairly consistent.
Text functionsReusable; results update automatically when the source data changes; flexible conditional logicNeed to understand function parameters; mistakes are hard to troubleshoot.Data needs to be updated over the long term, or the rules are complex.

Flash Fill usage: in the first cell of the adjacent column, manually type the result you want. For example, type "580" into B2, then press Ctrl+E in B3, and Excel will refer to your example and try to fill the entire column. If some rows show incorrect results, correct the first two or three examples and try again; this is usually less work than correcting all the results at once.

🎯 Which approach suits you?

  • Occasional one-time cleanup, data no longer changes: try Flash Fill first; if the result is wrong, use Text to Columns. Once finished, paste the results as values and save.
  • Need the same content pulled from newly exported spreadsheets every week or month: prioritize text functions, and save the formulas in a template so new data can be pasted in and used right away.
  • Only a dozen or so rows, requiring manual judgment: direct copy and paste is faster; formulas would only add hassle.
  • Working with Excel spreadsheets on a phone: support for functions and Flash Fill in mobile versions varies by app and version, so complex formulas are best completed on a computer; on a phone, it's mainly for viewing and making small edits.

❓ Frequently Asked Questions (FAQ)

1. How do I extract specified content from a cell in Excel on my phone?

The mobile interface is small, so you can write the formulas on a computer first, then copy them to use on your phone, or simply copy the content manually into the target cells. If the mobile version supports the required functions or Flash Fill, the steps are basically the same as on the desktop; when it does not, it is safer to do the work on a computer.

2. Why can't the extracted numbers be summed?

This is usually because the results were stored as text. You can use the Text to Columns feature to reset them to General or Number format, or multiply the formula by 1 outside to convert them. After converting, spot-check a few rows to make sure the numbers don't contain any stray symbols.

3. A cell contains several identical keywords—how do I extract only the second one?

FIND returns the position of the first occurrence by default. To get the second occurrence, you can use the position of the first occurrence as the new starting point and run the search again on the remaining text. This kind of formula is rather long, so it's advisable to calculate step by step in empty columns first, and once you've confirmed the results are correct, combine them into a single formula.

4. Why does content copied from a PDF or web page to Excel often come out wrong during extraction?

Text copied from elsewhere often contains invisible line breaks, spaces, or special characters that you cannot see, and these can cause keyword searches to fail. You can first use find and replace to remove line breaks and extra spaces, and then perform the extraction. If the content comes from a scanned document, you should first confirm that the recognition results are correct.

5. Will the original table's data be modified after extraction?

When you use a formula, the original data is not modified; the result is simply displayed in a new cell. When you use Text to Columns, the results overwrite the original column, so it is best to make a backup before you start.

📝 Summary

When the position of content within a cell is not fixed, the key is to find a stable delimiter or keyword, then choose Text to Columns, Flash Fill, or text functions to extract the value. First test on a small sample, then apply in batch, and check for error values, extra spaces, and number formats against a checklist. Once you master this approach, whether you are wondering how to extract the content you want from a cell in Excel or how to pull text out of an Excel table, you will have a clear method to follow.

Open OmniDoc and process your spreadsheet file

Updated 2026-11-29