Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Split Number into Digits: 3 Easy Ways

· 5 min read · Home Tech

In this article
  1. Formula
  2. Worked Example
  3. When to Use This Method
  4. Alternative Methods
  5. Common Mistakes and Pitfalls
  6. Limitations of the Formula
  7. Frequently Asked Questions

To split a number into its individual digits in Excel, use the TEXT function combined with MID, or use Flash Fill (Excel 2013 and later). For example, to split 123 into 1, 2, 3, enter =MID(TEXT($A$1,"000"),1,1) in one cell, then change the start position for the next digit.

in num | Number | - | 12345 | 0
out d1 | Digit 1 | - | MID(TEXT(num,"00000"),1,1)*1 | 0
out d2 | Digit 2 | - | MID(TEXT(num,"00000"),2,1)*1 | 0
out d3 | Digit 3 | - | MID(TEXT(num,"00000"),3,1)*1 | 0
out d4 | Digit 4 | - | MID(TEXT(num,"00000"),4,1)*1 | 0
out d5 | Digit 5 | - | MID(TEXT(num,"00000"),5,1)*1 | 0

Formula

The core formula uses TEXT to convert the number into a fixed-length text string, and MID to extract one character at a time. In general:

=MID(TEXT(number, "repeated zeros"), position, 1) * 1

  • number – the cell reference or value you want to split (e.g., A1).
  • "repeated zeros" – a text string of zeros equal to the maximum number of digits you expect. For a 5-digit number, use "00000".
  • position – the character position to extract (1 = leftmost digit).
  • * 1 – converts the text character back to a number so you can use it in calculations.

Worked Example

Using the default value 12345, the formula for each digit is:

  1. Digit 1: =MID(TEXT(12345,"00000"),1,1)*1 → TEXT gives "12345", MID extracts "1", *1 → 1
  2. Digit 2: =MID(TEXT(12345,"00000"),2,1)*1 → extracts "2" → 2
  3. Digit 3: =MID(TEXT(12345,"00000"),3,1)*1 → extracts "3" → 3
  4. Digit 4: =MID(TEXT(12345,"00000"),4,1)*1 → extracts "4" → 4
  5. Digit 5: =MID(TEXT(12345,"00000"),5,1)*1 → extracts "5" → 5

Notice that the TEXT function pads the number with leading zeros if it has fewer digits than the format string. For example, if the number is 12 and the format is "00000", TEXT returns "00012", so MID extracts "0", "0", "0", "1", "2". This is useful when you want to keep leading zeros.

When to Use This Method

Use the TEXT/MID approach when you need the digits to be dynamic – if the source number changes, the digits update automatically. It works for any positive integer up to the length of the format string. It is ideal for:

  • Breaking apart ID numbers, product codes, or serial numbers.
  • Extracting individual digits for checksum validation.
  • Creating separate columns for each digit of a number.

Alternative Methods

Besides the formula, Excel offers other ways to split digits:

  • Flash Fill – Type the first digit manually in a cell, then press Ctrl+E. Excel fills the rest based on the pattern. Works in Excel 2013 and later, but is static (does not update if the source changes).
  • Text to Columns – If the numbers are stored as text with a delimiter (like spaces or commas), use Data > Text to Columns. For plain numbers, you can first use TEXT to add spaces between digits, then split.
  • Power Query – Use the "Extract" feature to pull characters from a column. More advanced, but good for large datasets.

Common Mistakes and Pitfalls

Several issues often trip up users:

  • Not converting text to number – Without the *1, the extracted digit is text, so SUM or other math functions may ignore it. Always multiply by 1 or use VALUE().
  • Wrong format string length – If the number has more digits than the format string, TEXT returns the full number, and MID may extract only part of it. Use a format long enough for the largest number you expect.
  • Negative numbers – The formula will treat the minus sign as a character. To handle negatives, use ABS() first or adjust the format to include a minus.
  • Decimal numbers – The formula splits the integer part only if you use a format with no decimal point. For decimals, you need to separate the integer and fractional parts first.

Limitations of the Formula

The TEXT/MID method has a few limitations:

  • It only works for numbers up to 15 digits, because Excel stores numbers with 15-digit precision. Beyond that, digits are rounded.
  • It treats the number as a string, so leading zeros are preserved only if you use the format string. If you don't, Excel drops them.
  • It is not dynamic for variable-length numbers – you need to know the maximum length in advance.

Frequently Asked Questions

How do I split a number into digits without using formulas?

Use Flash Fill. Type the first digit in a cell next to your data, then press Ctrl+E. Excel will automatically fill the rest of the column with the first digit of each number. Repeat for each digit position. This is quick but static – if the original numbers change, the split digits do not update.

Can I split a number into digits in Google Sheets?

Yes, the same MID/TEXT formula works in Google Sheets. You can also use the SPLIT function with a delimiter, but for plain numbers you need to convert them to text first. For example, =SPLIT(TEXT(A1,"00000"),"") will split each character into separate cells.

How do I split a number into digits and keep leading zeros?

Use the TEXT function with a format string that has as many zeros as the maximum number of digits. For example, =MID(TEXT(A1,"00000"),1,1) will return "0" for a number like 12, preserving the leading zero in the first digit position.

What if my number has more than 15 digits?

Excel stores numbers with up to 15 significant digits. For longer numbers, convert them to text first (format the cell as Text before entering, or use TEXT with a format like "0"). Then the MID formula will work on the text string without rounding.

Can I split a decimal number into its digits?

Yes, but you need to separate the integer and fractional parts first. For the integer part, use =MID(TEXT(INT(A1),"000"),1,1). For the fractional part, use something like =MID(TEXT(MOD(A1,1),"0.000"),3,1) to get the first decimal digit (position 3 because of the "0.").