Function Problems

Extract the Last Word from a Cell in Excel

Huda QurayshiHuda Qurayshi Nov 25, 2026 870 views

Question details

Extract the final word from a cell into an adjacent cell, regardless of whether its length is fixed or variable.

How to Extract the Last Word from a Cell in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains text in column G, and the user wants the final word in column H.
Observed behavior
The adjacent cell should display the final word while the original text remains unchanged.
Before you start

Identify the source cell and an empty adjacent cell for the result. The examples below use G2 as the source and H2 as the destination.

Solution 1Recommended

Extract a Last Word of Any Length

Use this formula when the final word can have a variable number of characters.

1
Select the destination cell

Click H2, or another empty cell next to your source text.

2
Enter the formula

Type =TRIM(RIGHT(SUBSTITUTE(TRIM(G2)," ",REPT(" ",LEN(G2))),LEN(G2))) and press Enter. Replace G2 with your source cell if needed.

3
Copy the formula down

Drag the fill handle at the bottom-right corner of H2 down the column to extract words from additional rows.

Extract a Last Word of Any Length
Spaces and original text: The formula handles leading, trailing, and repeated ordinary spaces. It returns the final word without removing it from the source cell.
Work with formulas in WPS Office

Extract the Last Word with WPS Spreadsheet

Open your workbook in WPS Spreadsheet and use the same formula to return the last word in an adjacent cell.

  1. 1. Open the workbook: Open WPS Spreadsheet and select Open to choose your Excel workbook.
  2. 2. Select an empty cell: Click H2 next to the source text in G2, or choose the corresponding empty cell in your sheet.
  3. 3. Enter the formula: Enter =TRIM(RIGHT(SUBSTITUTE(TRIM(G2)," ",REPT(" ",LEN(G2))),LEN(G2))) and press Enter.
  4. 4. Apply it to more rows: Drag the fill handle down from H2 to copy the formula to the remaining rows.
Extract variable-length final words with a formulaOpen and edit Microsoft Excel XLSX filesUse familiar spreadsheet cells and fill handlesWork with a free, easy-to-use office suite
microsoft office alternative - wps office

Frequently Asked Questions

How do I extract the last word if its length varies?

Enter =TRIM(RIGHT(SUBSTITUTE(TRIM(G2)," ",REPT(" ",LEN(G2))),LEN(G2))) in an empty cell such as H2. Replace G2 with the cell containing your text.

Does the formula remove the word from the original cell?

No. The formula displays the extracted word in the destination cell and leaves the source text unchanged.

What if the source cell has extra spaces?

The variable-length formula uses TRIM to handle leading, trailing, and repeated ordinary spaces. Other characters, such as nonbreaking spaces or tabs, may need to be replaced first.

How can I apply the formula to an entire list?

Enter the formula in the first destination cell, such as H2, then drag its fill handle down alongside the source cells.