Quick answer
Extract digits from a text value.
=TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,""))Example data layout
Use a small table first, confirm the result, then copy the formula down the column.
| Input | Helper value | Result |
|---|---|---|
| A2 | B2 | Formula result |
| A3 | B3 | Copied formula result |
Copy-paste examples
Beginner
Basic Extract numbers from text example
=TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,""))Adjust the cell references to match your worksheet layout.
Beginner
Extract numbers from text copied down rows
=TEXTJOIN("",TRUE,IFERROR(MID(A3,SEQUENCE(LEN(A3)),1)*1,""))Adjust the cell references to match your worksheet layout.
Intermediate
Extract numbers from text with clean fallback
=IFERROR(TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,"")),"")Adjust the cell references to match your worksheet layout.
Intermediate
Extract numbers from text with structured references
=TEXTJOIN("",TRUE,IFERROR(MID([@Input],SEQUENCE(LEN([@Input])),1)*1,""))Adjust the cell references to match your worksheet layout.
Advanced
Extract numbers from text with dynamic data
=TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,""))Adjust the cell references to match your worksheet layout.
Advanced
Extract numbers from text inside a report formula
=LET(result,TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,"")),result)Adjust the cell references to match your worksheet layout.
Step-by-step tips
- Paste the formula into the first result cell.
- Replace sample references like A2, B2, or Table1 with your real cells or table columns.
- Test the formula on two or three rows before copying it down.
- Format the result column as Number, Date, Currency, or Percentage when needed.
- Keep a backup copy of your original data before applying formulas across a large range.
Common mistakes
- Using text values where Excel expects numbers or dates.
- Forgetting quotation marks around text criteria.
- Copying a formula without locking fixed references using dollar signs.
- Applying the wrong number format and thinking the formula is wrong.