Smart Systems for Home

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

Excel Split String by Length: 3 Easy Ways

· 4 min read · Home Tech

In this article
  1. Formula
  2. Worked Example
  3. Using Text to Columns with Fixed Width
  4. Dynamic Splitting with a Single Formula
  5. Common Mistakes and Pitfalls
  6. Alternatives for Complex Splitting
  7. Frequently Asked Questions

To split a string by a fixed number of characters in Excel, you can use the LEFT, MID, and RIGHT functions to extract chunks of a specified length, or use the Text to Columns wizard with a fixed width. This article explains both methods, plus a formula-based approach for dynamic splitting, with step-by-step examples and common pitfalls to avoid.

in t | Text | - | ABCDEFGHIJ | 0
in n | Chunk length | chars | 3 | 1
out first | First chunk | - | LEFT(t, n) | 0
out second | Second chunk | - | MID(t, n+1, n) | 0
out third | Third chunk | - | MID(t, 2*n+1, n) | 0

Formula

The core formulas for splitting text by length are:

  • LEFT(text, n) – returns the first n characters.
  • MID(text, start_num, n) – returns n characters starting at position start_num.
  • RIGHT(text, n) – returns the last n characters.

For example, to split the text in cell A1 into chunks of 3 characters, you would use:

  • First chunk: =LEFT(A1, 3)
  • Second chunk: =MID(A1, 4, 3)
  • Third chunk: =MID(A1, 7, 3)

Each function takes the original text and a character count. The MID function’s second argument is the starting position, which increments by the chunk length each time.

Worked Example

Suppose cell A1 contains the text ABCDEFGHIJ and you want chunks of 3 characters. Using the formulas above:

  1. First chunk: =LEFT(A1, 3) → ABC
  2. Second chunk: =MID(A1, 4, 3) → DEF
  3. Third chunk: =MID(A1, 7, 3) → GHI

If you need the fourth chunk, use =MID(A1, 10, 3) → J (only one character remains). The formulas work even when the last chunk is shorter than the specified length.

Using Text to Columns with Fixed Width

If you prefer a non-formula approach, Excel’s Text to Columns wizard can split text based on a fixed width:

  1. Select the column with your text.
  2. Go to Data tab → Text to Columns.
  3. Choose Fixed width and click Next.
  4. In the preview, click to add break lines at the desired character positions (e.g., after every 3 characters).
  5. Click Finish. The text is split into separate columns.

This method is quick for one-time splits, but it doesn’t update automatically if your source text changes. For dynamic splitting, use formulas.

Dynamic Splitting with a Single Formula

If you need to split text into multiple chunks that update automatically, you can use the MID function with a calculated start position. For example, to split text in A1 into chunks of length n (placed in B1), you can fill down:

  • In B1: =MID($A$1, (ROW()-1)*$B$1+1, $B$1)
  • Copy down for as many chunks as you need.

This formula uses the row number to calculate the starting position. For row 1, start is 1; row 2, start is 4; row 3, start is 7; etc. The result is a list of chunks in a column.

Common Mistakes and Pitfalls

  • Off-by-one errors: When using MID, the start position is 1-based. For the second chunk of length 3, start at 4, not 3.
  • Spaces and special characters: The functions count every character, including spaces, punctuation, and line breaks. If your text has leading/trailing spaces, use TRIM first.
  • Empty results: If the start position exceeds the text length, MID returns an empty string. This is fine, but you may want to hide those cells.
  • Unicode and double-byte characters: For languages like Chinese or Japanese, each character may be double-byte. Excel’s LEFT/MID/RIGHT count each character as one, which is usually what you want, but be aware if you’re dealing with byte-based splitting.

Alternatives for Complex Splitting

If your split is based on a delimiter (like comma or space) rather than a fixed length, use Text to Columns with Delimited, or the TEXTSPLIT function (available in Excel 365). For splitting by length, you can also use Power Query: load your data, split column by number of characters, and load back. Power Query is more robust for large datasets and can be refreshed automatically.

Frequently Asked Questions

How do I split a string into equal parts in Excel?

Use the MID function with a calculated start position, as shown above. For example, to split A1 into 3-character chunks, use =MID($A$1, (ROW()-1)*3+1, 3) and copy down.

Can I split a string by length without formulas?

Yes, use Text to Columns with the Fixed width option. You can set break lines at any character position, and Excel will split the text into separate columns.

What if my text has a different length each time?

The formulas work regardless of the text length. If the text is shorter than the chunk length, LEFT returns the entire text, and MID returns an empty string if the start position is beyond the end.

How do I split a string into a specific number of characters from the right?

Use the RIGHT function. For example, =RIGHT(A1, 5) returns the last 5 characters. To get the second-to-last chunk, combine MID with LEN: =MID(A1, LEN(A1)-9, 5).

Does Excel have a built-in SPLIT function?

No, but Excel 365 offers TEXTSPLIT, which splits by delimiter, not by length. For length-based splitting, you’ll need the formulas or Text to Columns.