Skip to main content

Get or extract the last word from text string in Excel

To extract the last word from text string which are separated by the space characters, normally, you can create a formula based on the TRIM, SUBSTITUTE, RIGHT and REPT functions in Excel.


Get or extract the last words from a list of text strings in Excel

The generic syntax for extracting the last word from a text string is:

=TRIM(RIGHT(SUBSTITUTE(text," ",REPT(" ",100)),100))
  • text: The text string or cell value that you want to extract last word from.
  • 100: The number 100 is a random number which should be big enough to handle the long words, you can change it if your words are longer.

1. Please copy the below formula into a blank cell where you want to output the result:

=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))

2. And then, drag the fill handle down to the cells that you want to fill this formula to other cells, and all the last words have been extracted from the text strings as following screenshot shown:


Explanation of the formula:

SUBSTITUTE(A2," ",REPT(" ",100)): This SUBSTITUTE function replaces each single space with 100 spaces between each word in cell A2.

RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100): This RIGHT function will extract 100 characters from right of the new text string returned by the SUBSTITUTE function.

TRIM(): The TRIM function is used to remove all leading spaces.


Relative functions used:

  • RIGHT:
  • The RIGHT function returns the text from right of the text string.
  • SUBSTITUTE:
  • The SUBSTITUTE function replaces text or characters within a text string with another text or characters.
  • TRIM:
  • The TRIM function removes all extra spaces from text string and only keeps single spaces between words.
  • REPT:
  • The REPT function is used to repeat the characters a specified number of times.

More articles:

  • Extract Substring From Text String In Excel
  • It may be a common task for you that you need to extract substrings from text strings, in Excel, there is not a direct function for doing this, but, with the help of the LEFT, RIGHT, MID and SEARCH functions, you can extract kinds of substrings as you need.
  • Extract Last Line Of Text From A Multi-Line Cell
  • To extract the last line of text from a text string which is separated by line breaks, normally, there is no direct way for you to solve this. This article, I will introduce a formula to deal with this task in Excel.

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations