# LEFT formula generator

> Describe what you need and get a LEFT formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested LEFT examples.

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

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

Describe the task at [LEFT formula generator](https://spreadsheetpractice.com/tools/formula-generator/left) and get a LEFT formula for Excel and Google Sheets, tested on real data.

## Tested LEFT examples

### Extract the first N characters from a cell

`=LEFT(A2,$E$1)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/extract-first-n-characters)

### Extract the first name from a full name

`=TEXTBEFORE(A2," ")`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/extract-first-name)

### Extract text before a character

`=TEXTBEFORE(A2,$E$1)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/extract-text-before-a-character)

### Assign a group by the first letter of a name

`=XLOOKUP(LEFT(A2),$E$2:$E$5,$F$2:$F$5,,-1)`

Excel. Result on the sample sheet: 8 rows (B2:B9). [See it and try it](https://spreadsheetpractice.com/formulas/group-by-first-letter)

### Find cells with leading or trailing spaces

`=OR(LEFT(A2)=" ",RIGHT(A2)=" ")`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/find-cells-with-leading-or-trailing-spaces)

### Convert YYYYMMDD to a date

`=DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-yyyymmdd-to-a-date)

### Convert dd/mm/yyyy text to a date

`=DATE(RIGHT(A2,4),MID(A2,4,2),LEFT(A2,2))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-dd-mm-yyyy-text-to-a-date)

### Convert an ISO 8601 timestamp to a date and time

`=DATEVALUE(LEFT(A2,10))+TIMEVALUE(MID(A2,12,8))`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-an-iso-8601-timestamp)

## Questions

### What does the LEFT formula generator do?

You describe the task in plain English, and it writes the formula, using LEFT where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does LEFT do?

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

### Can I learn to write LEFT formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the LEFT function page has a practice exercise.

---

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