# How to insert a character at a specific position in text in Excel

Use REPLACE with a length of 0, which inserts instead of replacing: =REPLACE(A2,4,0,"-") puts a dash before the 4th character.

**Excel:** `=REPLACE(A2,$E$1,0,$G$1)` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G |
| --- | --- | --- | --- | --- | --- | --- |
| Code | Formatted |  | Position | 4 | Insert | - |
| ABC1042 |  |  |  |  |  |  |
| NWX2087 |  |  |  |  |  |  |
| SEA0031 |  |  |  |  |  |  |
| MSP7710 |  |  |  |  |  |  |
| DLH0450 |  |  |  |  |  |  |

Formula in B2, filled to B6: `=REPLACE(A2,$E$1,0,$G$1)`

Result: ABC-1042; NWX-2087; SEA-0031; MSP-7710; DLH-0450

## How it works

REPLACE removes a number of characters at a position and puts new text there. With 0 characters to remove, nothing is lost and the new text is simply inserted before the character at that position.

## Other ways

- `=LEFT(A2,$E$1-1)&$G$1&MID(A2,$E$1,LEN(A2))`: Split the text in two and join it back with the new character between the halves.

## Common mistakes

- Positions start at 1. To insert after the 3rd character, use position 4.
- Codes stored as numbers lose their leading zeros before you start. Store them as text, or pad first with `TEXT(A2,"0000000")`.

## Questions

**How do I insert characters at several positions?**

Nest REPLACE, working from the end so the positions don't shift: `=REPLACE(REPLACE(A2,7,0,"-"),4,0,"-")`.

**How do I add a space between letters and numbers?**

If the letters are always 3 characters, insert at 4: `=REPLACE(A2,4,0," ")`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/insert-a-character-at-a-position
