First three characters
| A | |
|---|---|
| 1 | Code |
| 2 | NYC-1042 |
Formula: C1: =LEFT(A2,3)
Result: NYC
Takes the first three characters of the code.
First n characters.
LEFT(text, [num_chars])Example: =LEFT(A2,2)
Available in: All versions
LEFT returns a number of characters from the start of a text string: =LEFT(text, num_chars). Together with RIGHT (from the end) and MID (from any position) it splits codes, IDs and names into parts.
| A | |
|---|---|
| 1 | Code |
| 2 | NYC-1042 |
Formula: C1: =LEFT(A2,3)
Result: NYC
Takes the first three characters of the code.
| A | |
|---|---|
| 1 | Code |
| 2 | NYC-1042 |
Formula: C1: =MID(A2,5,4)
Result: 1042
Starts at character 5 and takes 4 characters.
| A | |
|---|---|
| 1 | |
| 2 | sam@example.com |
Formula: C1: =LEFT(A2,FIND("@",A2)-1)
Result: sam
FIND returns the position of @ (4); subtracting 1 leaves the characters before it.
A tiny spreadsheet with example data. Edit the formula or any number and see the result.
Formula in D2: =LEFT(A2,5)
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Text | Other | Result | |
| 2 | Alice Johnson | alice johnson | Alice | |
| 3 | alice@shop.com | ALICE@shop.com | ||
| 4 | extra spaces | |||
| 5 | SKU-2026-0415 | |||
| 6 | iced coffee, tea, sugar | |||
| 7 | Order 417 shipped |
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page