# LEFT function in Excel

> LEFT returns a set number of characters from the start of a text string.

Source: https://spreadsheetpractice.com/functions/left · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** LEFT returns a set number of characters from the start of a text string.
- **Syntax:** `=LEFT(text, [num_chars])`
- **Most common use:** `=LEFT(A2,2)` returns NY (The state code: the first two characters)
- **Available in:** Every current version
- **Category:** [Text functions](https://spreadsheetpractice.com/functions/category/text)
- **Returns:** Text: the first num_chars characters, or the whole string if it is shorter than that.
- **Google Sheets:** Works the same in Google Sheets.

## What it does

LEFT returns a set number of characters from the start of a text string. Use it to pull fixed-length codes off the front of IDs, SKUs and account numbers, such as the state prefix in NY-2026-0142.

## Syntax

`=LEFT(text, [num_chars])`

| Argument | Required? | What it is |
|---|---|---|
| `text` | Required | The text or cell to read from. Numbers work too and come back as text. |
| `num_chars` | Optional | How many characters to return. Leave it out to get just the first character. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | `=LEFT(A2,2)` | NY | The state code: the first two characters |
| D3 | `=LEFT(B3)` | R | No num_chars, so just the first letter, handy for initials |
| D4 | `=LEFT(A4,FIND("-",A4)-1)` | TX | Everything before the first dash, whatever its length |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D |
|---|---|---|---|---|
| 1 | Order ID | Customer |  | Result |
| 2 | NY-2026-0142 | Ana Lima |  | NY |
| 3 | CA-2026-0187 | Raj Patel |  | R |
| 4 | TX-2025-0033 | Lee Wong |  | TX |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| A number comes back as text | LEFT always returns text, so =LEFT(2026,2) gives "20", which SUM ignores. Wrap it in VALUE or add 0: =VALUE(LEFT(A2,4)). |
| Dates return the wrong digits | A date is stored as a serial number such as 46088, and LEFT reads that number, not what you see. Use YEAR or TEXT(A2,"yyyy") instead. |
| Prefixes of different lengths get cut short | A fixed num_chars can't handle variable-length pieces. Find the delimiter with FIND, or use TEXTBEFORE in Excel 2024 and Microsoft 365. |

## Tips

- Cut at a character by pairing LEFT with FIND: =LEFT(A2,FIND(" ",A2)-1) returns the first word.
- If num_chars is longer than the text, LEFT returns the whole text without an error.

## Related functions

- [RIGHT](https://spreadsheetpractice.com/functions/right): RIGHT returns a set number of characters from the end of a text string.
- [MID](https://spreadsheetpractice.com/functions/mid): MID returns characters from the middle of a text string, starting at a position you choose.
- [TEXTBEFORE](https://spreadsheetpractice.com/functions/textbefore): TEXTBEFORE returns everything before a delimiter you name, such as the username before the @ in an email or the first name before a space.
- [FIND](https://spreadsheetpractice.com/functions/find): FIND returns the position of one piece of text inside another, counting from 1.

## Questions

### How do I extract the first word in Excel?

Use =LEFT(A2,FIND(" ",A2)-1). FIND gives the position of the first space, and you take one fewer character. In Excel 2024 or Microsoft 365, =TEXTBEFORE(A2," ") does the same.

### How do I remove the first few characters instead of keeping them?

Keep the rest with RIGHT: =RIGHT(A2,LEN(A2)-3) drops the first three characters. =REPLACE(A2,1,3,"") works too.

## Practice

A graded LEFT exercise ("City code") is on [the LEFT page](https://spreadsheetpractice.com/functions/left). It is checked instantly, then re-checked on changed data.

Lessons that use LEFT:

- [Lesson 18: LEFT, RIGHT, MID & LEN](https://spreadsheetpractice.com/learn/left-right-mid-len) (Pro)
- [Lesson 21: TEXTBEFORE, TEXTAFTER & FIND](https://spreadsheetpractice.com/learn/textbefore-textafter-find) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
