Split Letters from Numbers (ABC123)

Excel Formulas › Text

365 (2024+)REGEXEXTRACT

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.


Quick formula: letters then numbers from A2:
=REGEXEXTRACT(A2, "[A-Za-z]+") // letters =REGEXEXTRACT(A2, "[0-9]+") // numbers
Each pattern grabs the first run of that character type. Great when codes are letters-then-digits.

Functions used (tap for the full reference guide):

The example

A part code split into its two parts.

ABC
1CodeLettersNumbers
2ABC123ABC123

The formula

Two patterns, two parts:

=REGEXEXTRACT(A2, "[A-Za-z]+") =REGEXEXTRACT(A2, "[0-9]+") // ABC | 123

How it works

Each regex targets one character class:

  1. [A-Za-z]+ matches one or more letters — the letter portion.
  2. [0-9]+ matches one or more digits — the number portion.
  3. REGEXEXTRACT returns the first run of each, so “ABC123” splits into “ABC” and “123.”
  4. 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

Live demo

Type a code like ABC123.

Letters · Numbers

Variations

Pre-365 letters

Up to the first digit:

=LEFT(A2, MIN(FIND({0,1,2,3,4,5,6,7,8,9}&"...",A2&"0123456789"))-1)

Number part (no regex)

Strip letters:

=REGEXREPLACE(A2,"[^0-9]","")

All runs

Spill each group:

=REGEXEXTRACT(A2, "[A-Za-z]+|[0-9]+", 1)

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

📊
Download the free Split Letters from Numbers (ABC123) practice workbook
A code-splitter with the no-regex, number-only, and all-runs variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I split letters from numbers in Excel?
Use =REGEXEXTRACT(A2, "[A-Za-z]+") for the letters and =REGEXEXTRACT(A2, "[0-9]+") for the numbers. Requires Excel 365 (2024+).
How do I split a code without regex?
Find the first digit's position, then take LEFT for the letters and MID (or strip non-digits) for the number part.
What if letters and numbers are interleaved?
Use REGEXEXTRACT with the all-matches option and the pattern "[A-Za-z]+|[0-9]+" to spill each run.

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

Related formulas: REGEXEXTRACT · Extract numbers · Remove numbers from text

Function references: REGEXEXTRACT · REGEXREPLACE