FormulaCraft

How to get the nth word from a sentence in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",100)),(2-1)*100+1,100))

Verified example

Computed by a real spreadsheet engine on the sample data below.

Sentence
The quick brown fox
Hello world today
One two three four
Data is valuable

=TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",100)),(2-1)*100+1,100))quick

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Replace 2 in the formula with the word position you want (1 = first word, 2 = second word, etc.), or reference a cell containing the number.
  2. 2SUBSTITUTE(A2," ",REPT(" ",100)) expands each space to 100 spaces, padding every word to a known width.
  3. 3MID(...,(N-1)*100+1,100) extracts the Nth 100-character block.
  4. 4TRIM() removes all the padding spaces, leaving only the desired word.
  5. 5Use =TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",100)),(B2-1)*100+1,100)) where B2 holds the word number for a dynamic version.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

What happens if N is greater than the number of words?

The formula returns an empty string. Wrap in IFERROR or add an IF to check TRIM is non-empty before displaying the result.

Does this handle multiple consecutive spaces?

Not perfectly. Pre-clean the text with =TRIM(A2) to collapse multiple spaces to one before applying the word-extraction formula.

More on Text manipulation

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: