Manually separating merged text and numbers in Excel is a notoriously tedious struggle that drains valuable analytical time. When auditing standard funding sources, financial data often arrives consolidated into single, messy alphanumeric strings. Utilizing a dynamic Excel formula to isolate these distinct elements grants your team immediate processing efficiency and eliminates manual entry errors. As an educational stipulation, these logical formulas require a consistent data structure, such as text always preceding the numbers. For instance, cleanly parsing the identifier "NSF50000" into "NSF" and "50000" ensures flawless database integration. Below, we outline the exact formula configurations needed to automate this extraction process.
Data cleaning is one of the most common yet tedious tasks in Microsoft Excel. Frequently, database exports, invoice systems, or legacy software output text and numbers merged into a single cell-such as "Widget500", "99RedBalloons", or "TX78281-North". To perform analysis, calculations, or proper sorting, you must separate these mixed characters into two distinct columns: one for text and one for numbers.
While Excel's Flash Fill or Power Query are great manual or semi-automated workarounds, dynamic formulas remain the gold standard. Formulas update automatically when your source data changes. In this guide, we will explore various formula-based approaches to split text and numbers, ranging from traditional formulas compatible with older Excel versions to cutting-edge dynamic array functions available in Excel 365.
Before writing a formula, you must analyze how your data is structured. Mixed text and numbers generally fall into three categories:
Laptop5500) or numbers followed by text (e.g., 4500Invoices).Apple 100 or 12-Banana).A1b2C3d4).We will address each of these scenarios with practical, step-by-step formulas.
If you are using Excel 365 or Excel 2021, you have access to powerful new text-manipulation functions like TEXTSPLIT, TEXTBEFORE, and TEXTAFTER. These make splitting text and numbers significantly simpler than in previous versions.
If you want to strip out the numbers and keep only the text, you can use TEXTSPLIT by treating all numbers from 0 to 9 as delimiters.
=CONCAT(TEXTSPLIT(A2, {"0","1","2","3","4","5","6","7","8","9"}, , TRUE))
How it works:
{"0","1","2","3","4","5","6","7","8","9"}: This array acts as a list of delimiters. Excel will split the string every time it encounters a digit.TRUE: This parameter tells Excel to ignore empty values created by consecutive digits.CONCAT: Since TEXTSPLIT spreads the split characters across multiple columns, CONCAT glues the remaining text characters back together.To extract both text and numbers separately when the text is always on the left and numbers are on the right, you can use the LET function to define variables, keeping your formulas elegant and easy to read.
To Extract Text:
=LET(text, A2, num_start, MIN(FIND({0,1,2,3,4,5,6,7,8,9}, text&"0123456789")), LEFT(text, num_start-1))
To Extract Numbers:
=LET(text, A2, num_start, MIN(FIND({0,1,2,3,4,5,6,7,8,9}, text&"0123456789")), MID(text, num_start, LEN(text)))
If your team works across different Excel versions (such as Excel 2016 or 2019), you cannot rely on 365-exclusive array formulas. Instead, we use combinations of MIN, FIND, LEFT, MID, and LEN.
| Source Data (Cell A2) | Target Element | Formula | Result |
|---|---|---|---|
| Keyboard150 | Text | =LEFT(A2, MIN(FIND({0,1,2,3,4,5,6,7,8,9}, A2&"0123456789"))-1) |
Keyboard |
| Keyboard150 | Numbers | =MID(A2, MIN(FIND({0,1,2,3,4,5,6,7,8,9}, A2&"0123456789")), LEN(A2)) |
150 |
The engine behind these classic formulas is the expression:
MIN(FIND({0,1,2,3,4,5,6,7,8,9}, A2&"0123456789"))
Here is exactly how Excel processes this step-by-step:
A2&"0123456789": We append all digits to the end of the source string. This is a safety measure. If cell A2 does not contain any numbers (e.g., "Keyboard"), the FIND function would return a #VALUE! error. Appending digits ensures every digit is found at least once.FIND({0,1,2,3,4,5,6,7,8,9}, ...): This searches for each of the ten digits within our modified string and returns an array of ten positions. For "Keyboard150", the digit "1" is found at position 9.MIN(...): The MIN function identifies the lowest index in that array. This lowest number represents the starting position of the very first digit in our cell. For "Keyboard150", this returns 9.LEFT(A2, 8) to pull out the first 8 characters ("Keyboard").MID(A2, 9, LEN(A2)) to extract all characters starting from position 9 to the end of the text.In some datasets, the pattern is reversed: the digits appear first, followed by alphabetical text (e.g., "1200Invoices"). To handle this scenario, we must locate where the numbers end and where the alphabetical characters begin.
Use this array formula (press Ctrl + Shift + Enter in Excel 2016 or earlier):
=LEFT(A2, MATCH(FALSE, ISNUMBER(1*MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)), 0) - 1)
How it works:
ROW(INDIRECT("1:"&LEN(A2))): Creates an array of numbers representing each character's index (e.g., `{1, 2, 3, 4, ...}`).MID(A2, ..., 1): Slices the text character by character into an array.1*...: Multiplying by 1 attempts to convert each character to a number. Non-numeric text characters will produce a #VALUE! error.ISNUMBER(...): Evaluates each item in the array, returning TRUE for numbers and FALSE for errors/text.MATCH(FALSE, ..., 0): Finds the position of the first FALSE value, which marks the start of the text. Subtracting 1 gives us the exact length of the preceding number.Once you have isolated the numeric part on the left, extracting the text on the right is simple. Use the LEN function to calculate how many characters to pull from the right:
=RIGHT(A2, LEN(A2) - LEN(B2))
(Assuming your extracted number is in cell B2).
What if your text and numbers are completely jumbled, or the numbers are nested deep inside the string (e.g., "ID-9842-Active")? You can use a mathematical array formula to strip away all text characters, leaving only the digits behind.
=SUMPRODUCT(MID(0&A2, LARGE(INDEX(ISNUMBER(--MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)) * ROW(INDIRECT("1:"&LEN(A2))), 0), ROW(INDIRECT("1:"&LEN(A2)))), 1) * 10^(ROW(INDIRECT("1:"&LEN(A2)))-1))
Important Note: While this formula is an engineering marvel that works in older Excel versions without VBA, it can significantly slow down large workbooks because it performs complex matrix math across thousands of rows. For heavy datasets with random formats, transitioning your data cleaning workflow to Power Query is highly recommended.
If you only need to perform this task once and do not require your output to be dynamic, Excel's Flash Fill is the fastest alternative:
Select your method based on your version of Excel and your project requirements:
LET combined with TEXTSPLIT or FIND arrays for clean, readable formulas.LEFT / MID combined with MIN(FIND({0..9})) trick.Flash Fill (Ctrl + E) to save time and skip formulas entirely.
Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.