Pull “ABC” and “123” apart from a code like “ABC123.” Regex grabs the letter run and the number run separately — ideal for splitting SKUs and part numbers.
The example
A part code split into its two parts.
| A | B | C | |
|---|---|---|---|
| 1 | Code | Letters | Numbers |
| 2 | ABC123 | ABC | 123 |
The formula
Two patterns, two parts:
How it works
Each regex targets one character class:
[A-Za-z]+matches one or more letters — the letter portion.[0-9]+matches one or more digits — the number portion.- REGEXEXTRACT returns the first run of each, so “ABC123” splits into “ABC” and “123.”
- No 365? Find the first digit’s position, then LEFT for letters and MID for the number.
Mixed patterns: for codes like “12AB34” (digits and letters interleaved), REGEXEXTRACT with the all-matches option returns each run as a spilled list. The simple two-pattern version assumes one letter group and one number group.
Try it: interactive demo
Type a code like ABC123.
Variations
Pre-365 letters
Up to the first digit:
Number part (no regex)
Strip letters:
All runs
Spill each group:
Pitfalls & errors
365 (2024+) for REGEXEXTRACT. Older Excel needs FIND/LEFT/MID logic.
One run each assumed. Interleaved letters and digits need the all-matches option.
No match errors. If a part is missing (e.g. all letters), the digit pattern returns #N/A — wrap with IFERROR.
Practice workbook
Frequently asked questions
How do I split letters from numbers in Excel?
How do I split a code without regex?
What if letters and numbers are interleaved?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class