How to Extract Values from Text Longer Than 255 Characters in Excel
Question details
The user wants to extract specific figures and years from a text string that exceeds Excel's traditional 255-character limit, so they can reference the values in other sheets.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Need to reference numbers embedded in long text strings and link them to input sheets for calculation.
- Observed behavior
- Traditional lookup or criteria-based methods might fail or truncate when the cell text exceeds 255 characters, requiring specialized text formulas or Power Query for extraction.
Before extracting values, identify whether your long text follows a consistent pattern (like specific words always preceding the numbers). If the text structure varies greatly, you may need more advanced tools like Power Query rather than simple formulas.
Use Advanced Text Functions (TEXTBEFORE, MID, FIND) for Consistent Text
If your long text follows a predictable structure, combining Excel's built-in text functions is the fastest way to extract embedded figures and years without hitting the 255-character limit.
Functions like VLOOKUP or COUNTIF are limited to 255 characters for criteria, but string manipulation functions like MID, FIND, and SUBSTITUTE can handle much longer text limits (up to 32,767 characters).
Use the FIND function to get the starting numerical position of a specific keyword preceding your target number. For example: =FIND("Year:", A2).
Nest the FIND function inside a MID function to extract a specific number of characters following your keyword. Example: =MID(A2, FIND("Year:", A2) + 6, 4).
If using a newer version of Excel, use =TEXTAFTER(TEXTBEFORE(A2, " end_delimiter"), "start_delimiter ") to easily isolate values located between two known strings.
Wrap your extraction formula in the VALUE function (e.g., =VALUE(MID(...))) so the extracted string is converted into a calculable figure that can be referenced by your input sheets.

Extract Complex Text Values using Power Query
For changing text structures or massive datasets where writing nested formulas becomes too cumbersome, Power Query provides a robust, visual extraction tool.
Extract Text and Analyze Data Seamlessly in WPS Spreadsheet
WPS Spreadsheet offers powerful text functions like MID, FIND, and SUBSTITUTE, along with advanced data processing tools, allowing you to easily extract and calculate values from long text strings.
- 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your long text strings.
- 2. Apply text formulas: Click on an empty cell and enter your extraction formula, such as =MID(A2, FIND("Amount:", A2)+8, 5).
- 3. Use text-to-columns: For structured long text, go to the 'Data' tab and select 'Text to Columns' to automatically split the text based on delimiters.
- 4. Perform calculations: Reference the newly extracted cells in your calculation sheets using standard arithmetic or financial formulas.

Frequently Asked Questions
Why do some Excel functions fail with text longer than 255 characters?
Certain older Excel functions, like VLOOKUP, SUMIF, or COUNTIF, have a built-in character limit of 255 for criteria strings. When referencing text longer than this, they return a #VALUE! error. Standard text manipulation formulas like MID and FIND, however, do not have this limitation and can handle up to 32,767 characters.
How can I extract numbers from a text string that has no consistent pattern?
If the text is completely unstructured, standard formulas may not work well. You might need to use VBA (Visual Basic for Applications) with Regular Expressions (RegEx) to pattern-match numbers, or utilize the Flash Fill feature to train the software to recognize the extraction pattern.
Can I perform calculations directly on extracted text values?
By default, formulas like MID or TEXTAFTER extract data as a text string, even if it looks like a number. To perform mathematical calculations, you must convert the extracted text to a number by wrapping your formula in the VALUE function, or by multiplying the formula's result by 1.
Is Power Query available in all versions of Excel?
Power Query is a built-in feature for Excel 2016 and later, located under the 'Data' tab as 'Get & Transform Data'. For Excel 2010 and 2013, it must be downloaded as a separate, free add-in from Microsoft.




