How to extract the nth word from a text string in Excel
Excel formula
=INDEX(TEXTSPLIT(A2," "),$E$1)Split the text into words and pick one: =INDEX(TEXTSPLIT(A2," "),2) returns the second word. In older versions use the TRIM, MID and SUBSTITUTE trick.
- Result on the example
- one result per row in
B2, filled down toB6 - Works in
- Excel 2024 and Microsoft 365
- Google Sheets
- Different formula, see below
See it work
The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.
How it works
TEXTSPLIT breaks the text at each space into a row of words, and INDEX picks the one at position E1. Change E1 to 3 and you get "Street", "Avenue" and so on.
The older formula pads every space to 100 spaces, so word n starts somewhere in characters (n-1)*100+1 to n*100; MID takes that block and TRIM removes the padding.
=INDEX(TEXTSPLIT(A2," "),$E$1)Result"Lake"
A2"1420 Lake Street Minneapolis"The value in A2.
TEXTSPLIT(A2," "){1 row × 4 cols} "1420", "Lake", "Street", "Minneapolis"TEXTSPLIT: Splits text across columns, and rows, at the delimiters you give.- text
A2"1420 Lake Street Minneapolis" - col_delimiter
" "
- text
$E$12The value in E1.
INDEX(TEXTSPLIT(A2," "),$E$1)"Lake"INDEX: Value at a given row and column of a range.- array
TEXTSPLIT(A2," "){1 row × 4 cols} "1420", "Lake", "Street", "Minneapolis" - row_num
$E$12
- array
In Google Sheets
Google Sheets needs a different formula: =INDEX(SPLIT(A2," "),1,$E$1). On the same data it gives the same result. Here it is running in Google Sheets mode.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",100)),($E$1-1)*100+1,100)) | Lake, Oak, Elm… | Works in every version and in Google Sheets, for words up to 100 characters long. |
Common mistakes
- Double spaces create empty "words" in TEXTSPLIT. Split the trimmed text,
TEXTSPLIT(TRIM(A2)," "), or set its ignore_empty argument to TRUE. - Asking for a word number larger than the word count returns #REF!. Wrap in
IFERROR(…,"").
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Extract the nth word from a text string
B2, return the word whose number is in E1 (the 2nd word) and fill down to B6.Questions
How do I get the nth item from a comma-separated list?
Split on the comma instead: =INDEX(TEXTSPLIT(A2,", "),$E$1).
How do I get the last word?
Use =TEXTAFTER(A2," ",-1).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.