Function Problems

How to Extract the First Few Words from a Cell in Excel

Nimra MalikNimra Malik Oct 19, 2026 871 views

Question details

The user needs a method or formula to extract a specific number of words from the beginning of a text string within a single cell.

How to Extract the First Few Words from an Excel Cell
Product
Excel
Device & OS
not provided
Scenario
Processing text data where only the first few words are relevant, such as pulling first and middle names, or isolating introductory keywords from a longer phrase.
Observed behavior
Looking to isolate and extract the first two or more words from a continuous text string inside a cell without manually copying, pasting, or using text-to-columns.
Before you start

Determine exactly how many words you need to extract and ensure your text cells are separated by standard single spaces before applying the formulas.

Solution 1Recommended

Extract Words Using TRIM, LEFT, SUBSTITUTE, and REPT Formulas

This classic nested formula works across all versions of Excel to isolate and extract a specific number of words from a longer text string.

This method uses a combination of functions to manipulate the spaces between words. The REPT function creates a large gap of spaces, SUBSTITUTE replaces normal spaces with these large gaps, LEFT grabs the beginning chunk of the text, and TRIM cleans up any leftover trailing spaces.

1
Select the destination cell

Click on an empty cell where you want the extracted words to be displayed.

2
Enter the formula

Type the formula: =TRIM(LEFT(SUBSTITUTE(C6," ",REPT(" ",100)),200)). Replace 'C6' with the reference to the cell containing your source text.

3
Apply and drag

Press Enter to see the result. If you have a column of data, click the small square at the bottom-right corner of the cell and drag it down to fill the formula for the remaining rows.

Extract Words Using TRIM, LEFT, SUBSTITUTE, and REPT Formulas
Adjusting for More Words: The formula above extracts approximately the first two words. If you need to extract three or more words, simply increase the '200' in the LEFT function (e.g., to 300 or 400) to ensure the formula grabs enough characters before trimming.
Advanced Spreadsheet Alternative

Easily Extract Text and Manage Data with WPS Spreadsheet

WPS Spreadsheet fully supports advanced text manipulation formulas like TRIM, LEFT, SUBSTITUTE, and more. You can easily process text data, clean up messy cells, and organize your spreadsheets with its comprehensive set of built-in functions.

  1. 1. Open your file: Launch WPS Spreadsheet and open the document containing your text data.
  2. 2. Select the target cell: Click on the blank cell where you want the extracted words to appear.
  3. 3. Input the formula: Type your preferred formula, such as =TRIM(LEFT(SUBSTITUTE(C6," ",REPT(" ",100)),200)), and press Enter.
  4. 4. Auto-fill the column: Drag the fill handle down to apply the exact same text extraction logic to the rest of your list.
Fully compatible with Microsoft Excel formulas, functions, and file formats (.xlsx)Lightweight architecture that runs smoothly on Windows, Mac, and LinuxIncludes hundreds of built-in functions for complex data manipulation and text extractionFree to use with a familiar, easy-to-navigate tabbed interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I extract the last few words instead of the first?

Yes. You can use a similar nested formula using RIGHT instead of LEFT. The logic involves using SUBSTITUTE to create large gaps, and then RIGHT to extract a chunk of text from the end before using TRIM to clean it up.

Why is my formula returning extra spaces or miscounting words?

This usually happens if your original text has double spaces or leading spaces. You can wrap your initial cell reference in a TRIM function, such as SUBSTITUTE(TRIM(C6)," ",...), to ensure uniform single spaces before the main formula processes it.

Does this formula work if words are separated by commas?

If your text uses commas instead of spaces as separators, you simply need to change the delimiter in the SUBSTITUTE or TEXTBEFORE function. Replace the space " " with a comma "," in your formula.

What is the simplest way to extract only the very first word?

To extract just the first word, you don't need the REPT function. You can use a shorter formula: =LEFT(C6, FIND(" ", C6) - 1), which locates the first space and extracts all characters before it.