# How to extract the first name from a full name in Excel

In Excel 365 use =TEXTBEFORE(A2," "). In any version, =LEFT(A2,FIND(" ",A2)-1) takes everything before the first space.

**Excel:** `=TEXTBEFORE(A2," ")` (Excel 2024 and Microsoft 365)

**Google Sheets:** `=LEFT(A2,FIND(" ",A2)-1)`

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Full name | First name |
| Maria Lopez |  |
| James O'Neil |  |
| Aiko Tanaka |  |
| Mary Ann Smith |  |
| Lars Eriksen |  |
| Chidi Okafor |  |

Formula in B2, filled to B7: `=TEXTBEFORE(A2," ")`

Result: Maria; James; Aiko; Mary; Lars; Chidi

## How it works

TEXTBEFORE returns the text before a delimiter, here the first space. The classic version finds the space with FIND and takes one character less than that position with LEFT.

The Google Sheets version uses LEFT and FIND, which work the same in every version of Excel too.

## Other ways

- `=LEFT(A2,FIND(" ",A2)-1)`: Works in every version of Excel and in Google Sheets.
- `=LEFT(A2,SEARCH(" ",A2)-1)`: SEARCH works the same here; it only matters for letters, since it ignores case.

## Common mistakes

- A name with no space returns #N/A from TEXTBEFORE (and #VALUE! from FIND). Add a fallback: `=TEXTBEFORE(A2," ",,,,A2)` returns the whole name.
- Leading spaces make the first "word" empty. Clean the column with TRIM first.
- Middle names: "Mary Ann Smith" gives "Mary". Whether that's right depends on your data.

## Questions

**How do I get the last name?**

Use the last space: `=TEXTAFTER(A2," ",-1)`.

**Is there a way without formulas?**

Flash Fill (Ctrl+E) or Text to Columns can split names once, but they don't update when the names change.

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

Source: https://spreadsheetpractice.com/formulas/extract-first-name
