How to Extract Text Before Mhz Using TEXTSPLIT in Excel
Question details
The user needs to extract specific text appearing right before the first occurrence of the marker 'Mhz' from a cell or a range of cells, returning the extracted values as a comma-separated list.

- Product
- Microsoft Excel 365
- Device & OS
- not provided
- Scenario
- Cleaning and extracting specific data points bounded by a specific word marker from complex text strings.
- Observed behavior
- The user requires an automated way to parse the strings, as standard Text-to-Columns is insufficient for extracting specific text before a repeating delimiter dynamically.
Ensure you are using a spreadsheet version that supports dynamic array functions like TEXTSPLIT, TEXTBEFORE, and TEXTAFTER. Evaluate the delimiters in your source data (like spaces or brackets) as the formulas may need minor adjustments based on your exact text structure.
Use TEXTSPLIT and TEXTBEFORE for a Single Cell
This method is ideal when you need to extract values from an individual cell using dynamic array formatting to output a comma-separated list.
This formula splits the text based on a specific character, identifies the string before 'Mhz', and outputs it as an array text string.
Click on the empty cell where you want the comma-separated result to appear.
Type the formula: =ARRAYTOTEXT(TOROW(TEXTAFTER(TEXTBEFORE(TEXTSPLIT(A1,"{"),"Mhz"),",",3)))
Modify the "{" or "," characters in the formula if your source text separates items with different symbols.
Press Enter to generate the text string containing the data found before 'Mhz'.

Extract Text from an Entire Range Using BYROW
Use this combination if you need to process an entire column or large range without dragging formulas down manually.
Use the LET Function for Easier Modification
The LET function allows you to define variables inside the formula, making it easier to adjust delimiters or markers later without rewriting the whole string.
Use WPS Spreadsheet to Extract Complex Text Data
WPS Spreadsheet fully supports modern dynamic array formulas, allowing you to seamlessly use functions like TEXTSPLIT, TEXTBEFORE, and BYROW. You can easily clean and extract your data without paying for expensive software subscriptions.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the data.
- 2. Select output cell: Click on the blank cell where you want to output the extracted text.
- 3. Enter dynamic array formula: Type your formula, for example: =ARRAYTOTEXT(TOROW(TEXTAFTER(TEXTBEFORE(TEXTSPLIT(A1,"{"),"Mhz"),",",3))).
- 4. Apply and drag: Press Enter to execute the formula and instantly extract your data. You can then copy it down if not using a spilling BYROW function.

Frequently Asked Questions
Why is my TEXTSPLIT formula returning a #NAME? error?
The #NAME? error typically occurs if your spreadsheet software version does not support dynamic array functions. Ensure you are using Microsoft 365, Office 2021, or the latest updated version of WPS Office.
Can I use TEXTJOIN instead of ARRAYTOTEXT?
Yes. ARRAYTOTEXT automatically adds a space after the comma delimiter. If you want strict comma separation without spaces, replace ARRAYTOTEXT with TEXTJOIN(",",, [your_formula]).
How do I change the extraction marker from 'Mhz' to another word?
Simply replace the text "Mhz" in the TEXTBEFORE, TEXTSPLIT, or FIND arguments of your formula with your desired word enclosed in quotation marks, such as "GHz" or "kg".
Does this method work if the marker appears multiple times in a cell?
The standard TEXTBEFORE function extracts text before the first occurrence of the delimiter by default. If you need it for subsequent occurrences, you can modify the instance number argument (the third parameter) in the TEXTBEFORE function.




