How to Extract the First Word in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
To extract the first word from A2, use =TEXTBEFORE(A2," ") in Microsoft 365 or Excel 2024. In any version, use =LEFT(A2,FIND(" ",A2)-1), which keeps everything before the first space. To stop one-word cells from causing an error, write =LEFT(A2,FIND(" ",A2&" ")-1). Wrap A2 in TRIM if the text might start with spaces.
Key takeaways
- =TEXTBEFORE(A2," ") returns everything before the first space (Microsoft 365 and Excel 2024).
- =LEFT(A2,FIND(" ",A2)-1) works in every version: FIND locates the space, LEFT keeps the characters before it.
- Adding a space with A2&" " stops one-word cells from returning #VALUE!.
- Leading spaces make the first word come back empty, so clean the text with TRIM first.
On this page+
To extract the first word in Excel, take everything before the first space. In Microsoft 365 that is =TEXTBEFORE(A2," "), and in any version =LEFT(A2,FIND(" ",A2)-1) does the same job. This guide is for anyone pulling first names from full names, brands from product titles or codes from IDs, and it shows how to fix the cells that break these formulas.
The example data#
All the examples use this list in column A. It includes the awkward cases you will meet in real data: three words, one word and leading spaces.
| A | Wanted result | |
|---|---|---|
| 1 | Text | |
| 2 | Grace Hopper | Grace |
| 3 | Lin Wei Chen | Lin |
| 4 | Tomas | Tomas |
| 5 | Ravi Patel (two leading spaces) | Ravi |
| 6 | Blue cotton shirt | Blue |
The quick way: TEXTBEFORE#
TEXTBEFORE returns the text before a delimiter, which is the character that separates the parts. For the first word, the delimiter is a space:
=TEXTBEFORE(A2," ")For A2 this returns Grace. For A3 it returns Lin, because TEXTBEFORE stops at the first space by default.
For a one-word cell like A4, plain TEXTBEFORE returns #N/A, because there is no space to stop at. Fix it with the fifth argument, match_end. Setting it to 1 tells Excel to treat the end of the text as a delimiter too:
=TEXTBEFORE(A4," ",,,1)Now A4 returns Tomas. The three commas skip the arguments you don't need. TEXTBEFORE needs Microsoft 365, Excel 2024 or Excel for the web. The guide to TEXTBEFORE and TEXTAFTER explains every argument, and the TEXTBEFORE and TEXTAFTER lesson lets you try them.
The classic way: LEFT and FIND#
In every version of Excel, combine two functions: FIND to locate the first space, and LEFT to keep the characters before it.
=LEFT(A2,FIND(" ",A2)-1)Here is how it works on "Grace Hopper":
FIND(" ",A2)returns 6, because the space is the 6th character.-1gives 5, the number of characters before the space.LEFT(A2,5)returns the first 5 characters: Grace.
Fill the formula down (Windows: Ctrl+D; Mac: ⌘D) to process the whole list. The LEFT function guide and the FIND function guide give the full syntax, and the article on LEFT, RIGHT and MID shows the other text-cutting functions.
You could use SEARCH instead of FIND here. The only differences are that SEARCH ignores capitals and accepts wildcards, and neither matters for a space. See how FIND and SEARCH locate text for when the difference does matter.
Handle one-word cells and extra spaces#
Two kinds of cell break the basic formulas, and each has a short fix.
Cells with only one word#
For "Tomas", there is no space, so FIND returns #VALUE! and the whole formula fails. Add a space to the end of the text inside FIND:
=LEFT(A4,FIND(" ",A4&" ")-1)The & joins a space onto the text, so FIND always finds one. For "Tomas" it finds the added space at position 6, and LEFT returns Tomas. For cells with several words, FIND still finds the real first space, so the result doesn't change. This is the safest version to fill down a long list.
Cells that start with spaces#
" Ravi Patel" begins with two spaces, so the first space is at position 1. LEFT then keeps 0 characters and the result is empty. TEXTBEFORE has the same problem. Clean the text with TRIM, which removes leading and trailing spaces and squeezes double spaces down to one:
=LEFT(TRIM(A5),FIND(" ",TRIM(A5)&" ")-1)This returns Ravi. In Microsoft 365 the TEXTBEFORE version is shorter: =TEXTBEFORE(TRIM(A5)," ",,,1). If TRIM doesn't seem to work, the data may contain non-breaking spaces from a web page; replace them first with SUBSTITUTE(A5,CHAR(160)," ").
First word before a comma, dash or other character#
The first "word" isn't always followed by a space. Change the delimiter to match your data:
| Text | Formula | Result |
|---|---|---|
| Hopper, Grace | =TEXTBEFORE(A2,",") | Hopper |
| INV-2026-118 | =TEXTBEFORE(A2,"-") | INV |
| INV-2026-118 | =LEFT(A2,FIND("-",A2)-1) | INV |
| sales@example.com | =TEXTBEFORE(A2,"@") | sales |
For names written as "Last, First", the first word is the surname. The guide to splitting a full name into first and last name covers both name orders.
Get everything except the first word#
Sometimes you want the opposite: the text after the first word. In Microsoft 365, use TEXTAFTER:
=TEXTAFTER(A3," ")For "Lin Wei Chen" this returns Wei Chen. In older versions, use MID to start one character after the space:
=MID(A3,FIND(" ",A3)+1,LEN(A3))This also returns Wei Chen. Using LEN(A3) as the length simply means "take everything that's left"; MID stops at the end of the text. If you need the final word rather than the first, see how to extract the last word, which uses TEXTAFTER with -1.
Other ways: TEXTSPLIT and Flash Fill#
Two more tools can do the job, each with a trade-off:
- TEXTSPLIT splits the text into one cell per word.
=INDEX(TEXTSPLIT(A2," "),1)keeps only the first piece: Grace. It is handy when you also need the second or third word. TEXTSPLIT needs Microsoft 365 or Excel 2024. - Flash Fill needs no formula. Type Grace in B2, then press Ctrl+E on Windows or choose Data > Flash Fill on a Mac. Excel fills the rest by copying your pattern. The results are fixed text, though, so they don't update when column A changes, and you should spot-check them.
For a list that will keep changing, a formula is the better choice.
Practise it#
Try the exercise on this page first: it extracts a first name with LEFT and FIND. Then practise LEFT, RIGHT, MID and LEN in a live spreadsheet, where you type each formula and it is checked instantly. Next, take the FIND and SEARCH lesson to locate characters, and the TEXTBEFORE and TEXTAFTER lesson for the shorter Microsoft 365 way.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Click B2 and extract the first name from A2 with LEFT and FIND, then press Enter.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | First word | |||
| 2 | Grace Hopper | |||
| 3 | Lin Wei Chen | |||
| 4 | Omar Haddad | |||
| 5 | Sofia Rossi | |||
| 6 | ||||
| 7 | ||||
| 8 |
Tip: FIND(" ",A2) gives the position of the first space. LEFT should keep one character fewer than that.
Practise this in a lesson
Frequently asked questions
What is the formula to get the first word in Excel?
Use =LEFT(A2,FIND(" ",A2)-1) in any version, or =TEXTBEFORE(A2," ") in Microsoft 365 and Excel 2024. Both return the text before the first space, such as Grace from Grace Hopper.
Why does my first word formula return #VALUE!?
The cell has only one word, so FIND can't find a space. Use =LEFT(A2,FIND(" ",A2&" ")-1), which adds a space to the end so FIND always finds one.
How do I get the first word before a comma or dash?
Change the delimiter. =TEXTBEFORE(A2,",") returns the text before the first comma, and =LEFT(A2,FIND("-",A2)-1) returns the text before the first dash.
How do I remove the first word and keep the rest?
Use =TEXTAFTER(A2," ") in Microsoft 365, or =MID(A2,FIND(" ",A2)+1,LEN(A2)) in older versions. Both return everything after the first space.
Can I extract the first word without a formula?
Yes. Type the first word of the first cell in the next column, then use Flash Fill (Windows: Ctrl+E; Mac: Data > Flash Fill). The results are fixed text, so they won't update if the source changes.