Text
Remove non-numeric characters (keep digits only, or strip all digits)
Extract only digits 0–9 from messy IDs ("Order #482-B9" -> "4829") or strip all digits to isolate text labels using double-TEXTSPLIT.
The double-TEXTSPLIT trick: split on digits, then split on non-digits
1. To STRIP digits 0–9 and keep letters/symbols: TEXTSPLIT(A2, {"0","1","2","3","4","5","6","7","8","9"}, , TRUE) removes every digit and leaves {"Order #", "-B"}, which TEXTJOIN("", TRUE, ...) stitches back into "Order #-B".
2. To STRIP non-digits and keep ONLY 0–9: pass that exact nonDig array back into a second TEXTSPLIT(A2, nonDig, , TRUE)! Splitting the original string on all of its own non-digit chunks leaves strictly the digits {"482", "9"} -> "4829"!
| Raw Input (A) | Keep Digits Only | Strip Digits (Letters/Symbols) |
|---|---|---|
| Order #482-B9 | 4829 | Order #-B |
| 00940-XT | 00940 (leading 0s safe!) | -XT |
| 90210 | 90210 | (empty) |
| SKU-ONLY | (empty) | SKU-ONLY |
Keep digits only (preserving leading zeros) and strip digits
Keeping the output as text preserves leading zeros on ZIPs and badge codes ("00940"); wrap in VALUE(...) only when you want arithmetic numbers.
=IF(A2="","",LET(s, A2 & "", nonDig, TEXTSPLIT(s, {"0","1","2","3","4","5","6","7","8","9"}, , TRUE), IF(ISERROR(INDEX(nonDig,1,1)), s, IF(INDEX(nonDig,1,1)="", s, IFERROR(TEXTJOIN("", TRUE, TEXTSPLIT(s, nonDig, , TRUE)), "")))))Strip all digits 0–9 and keep non-numeric text
Removes every digit 0–9 in a single array delimiter call.
=IF(A2="","",IFERROR(TRIM(TEXTJOIN("", TRUE, TEXTSPLIT(A2, {"0","1","2","3","4","5","6","7","8","9"}, , TRUE))),""))Inputs and interpretation
This extracts ASCII digits 0–9, not signed or decimal numbers: signs and decimal separators are removed. Other numeral scripts are not included. Enter identifiers as text to preserve leading zeros before extraction. The strip-digits formula also normalizes ordinary spaces with TRIM.
Try the example
Use the original values or change them to test your understanding.