# How to remove the first N characters from a cell in Excel

Keep everything except the first N characters: =RIGHT(A2,LEN(A2)-3), or =REPLACE(A2,1,3,"").

**Excel:** `=RIGHT(A2,LEN(A2)-$E$1)` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C | D | E |
| --- | --- | --- | --- | --- |
| Code | Without country |  | Remove | 3 |
| US-10442 |  |  |  |  |
| CA-20871 |  |  |  |  |
| MX-30019 |  |  |  |  |
| US-104577 |  |  |  |  |
| GB-4116 |  |  |  |  |
| DE-52208 |  |  |  |  |

Formula in B2, filled to B7: `=RIGHT(A2,LEN(A2)-$E$1)`

Result: 10442; 20871; 30019; 104577; 4116; 52208

## How it works

LEN gives the total length, so `LEN(A2)-$E$1` is how many characters remain after the first N. RIGHT returns that many from the end. It works for codes of any length, like "US-104577" and "GB-4116".

## Other ways

- `=REPLACE(A2,1,$E$1,"")`: Replaces the first N characters with nothing. Shorter, and easy to read.
- `=MID(A2,$E$1+1,LEN(A2))`: Starts one character after the ones you remove and takes the rest.

## Common mistakes

- If N is larger than the text, RIGHT gets a negative length and returns #VALUE!. REPLACE and MID return an empty text instead.
- The result is text even when it looks like a number. Use `=VALUE(RIGHT(A2,LEN(A2)-3))` for a number.

## Questions

**How do I remove only the first character?**

Use `=MID(A2,2,LEN(A2))`.

**How do I remove the first characters only when they match a prefix?**

Test first: `=IF(LEFT(A2,3)="US-",MID(A2,4,LEN(A2)),A2)`.

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/remove-first-n-characters
