If you’ve ever wanted to pull out a specific word from a sentence—or check whether the nth word matches something—in Google Sheets, this post is for you.
I’ll walk you through how to extract the nth word from a line using two handy methods, and then show you how to match the nth word using formulas. We’ll use both SPLIT + INDEX and regular expressions (REGEXEXTRACT / REGEXMATCH). Let’s dive in.
Extract the Nth Word from a Sentence in Google Sheets
To keep things simple, let’s use this sentence in cell A2:
Let the cat out of the bag
(I just picked an idiom to make it fun—feel free to try this on your real data.)
Using SPLIT + INDEX to Extract the Nth Word
This is probably the easiest approach when your text is nicely spaced. Here’s the formula:
=INDEX(SPLIT(A2, " "), 0, n)
Just replace n with the word position you want.
To extract the third word (“cat”):
=INDEX(SPLIT(A2, " "), 0, 3)
What’s happening:
SPLIT(A2, " ")breaks the sentence into separate words using spaceINDEX(..., 0, 3)picks the third one
Result:
cat
It’s simple, readable, and works great when your data doesn’t have extra spaces.
Can I use this in an array? Yes, you can:
=INDEX(SPLIT(A2:A, " "), 0, 3)
This formula will extract the 3rd word from each line in a vertical range.
Using REGEXEXTRACT to Extract the Nth Word
Want a formula that uses regex? Here’s how to extract the 3rd word:
=REGEXEXTRACT(A2, "(?:\S+\s+){2}(\S+)")
Let me break it down:
(?:\S+\s+){2}skips the first two words (non-capturing group)\S+captures the 3rd word (non-space characters)
So if you change the {2} to {n-1}, you can pull any word by position. For example:
=REGEXEXTRACT(A2, "(?:\S+\s+){4}(\S+)")
…would get you the fifth word.
Can I use this in an array? Yes, you can:
=ArrayFormula(IFNA(REGEXEXTRACT(A2:A, "(?:\S+\s+){2}(\S+)")))
Both formulas work well—pick based on whether you prefer simplicity or pattern control.
Match the Nth Word in a Line in Google Sheets
Let’s say you now want to check if the 3rd word is “cat”. You’ve got two options: a regex formula (case-sensitive) or a non-regex one using XMATCH (case-insensitive).
Using REGEXMATCH (Case-Sensitive)
Try this:
=REGEXMATCH(A2, "^(?:\S+\s+){2}cat\b")

Here’s what it does:
^anchors the match at the start(?:\S+\s+){2}skips the first two wordscat\bmatches the exact word “cat”
If the 3rd word is “cat”, it’ll return TRUE. Otherwise, FALSE. Just note: it’s case-sensitive.
Using SPLIT + INDEX + XMATCH to Match the Nth Word
Prefer something without regex? Here’s a cleaner alternative:
=NOT(ISNA(XMATCH("cat", INDEX(SPLIT(A2, " "), 0, 3))))
This one grabs the 3rd word using SPLIT + INDEX, then compares it to “cat” using XMATCH. It’s more forgiving when it comes to letter case.
Wrapping Up
So here’s a quick recap:
To extract the nth word in Google Sheets:
- Use
SPLIT + INDEXif your text is well-structured - Use
REGEXEXTRACTfor more control or compact formulas
To match the nth word:
- Use
REGEXMATCHfor case-sensitive matching - Use
SPLIT + INDEX + XMATCHfor a simpler, case-insensitive check
Each method has its place—go with whatever suits your workflow best.
Further Reading
- Extract, Replace, Match Nth Occurrence of a String or Number in Google Sheets
- Substitute Nth Match of a Delimiter from the End of a String in Google Sheets
- XLOOKUP Nth Match in Google Sheets – How to Return the Nth Occurrence
- INDEX MATCH Every Nth Column in Google Sheets
- Regex to Get All Words after Nth Word in a Sentence in Google Sheets
- Extract Different Text Strings from a Cell in Google Sheets
- Extract Numbers Prefixed by Currency Signs from a String in Google Sheets
- Extract Last N Values from a Delimiter Separated String in Google Sheets
- How to Extract Negative Numbers from Text Strings in Google Sheets




















