Extract Text

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

Anyone can help me with the right formula to extract the last text from the right. In below example, I need to extract whatever text comes after ABCD 1 or ABCD2.

Book2
AB
1TEXTExpected Result
2012 - USA - ABCD 2 GreenGreen
3011 - USA - ABCD 1 RedRed
4013 - USA - ABCD 2 YellowYellow
5014 - USA - ABCD 2 GreenGreen
6015 - USA - ABCD 1 RedRed
7016 - USA - ABCD 2 YellowYellow
8017 - USA - ABCD 2 GreenGreen
Sheet1
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
If you just want the last word, how about
Excel Formula:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
 
Upvote 0
Solution
If you just want the last word, how about
Excel Formula:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
As usual THANK YOU so much, that worked perfectly great.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Another option with Excel 365 you could use FLASH FILL.
Type Green in cell B2.
Then go to DATA on ribbon
Then click on FLASH FILL and it will fill in the last word.
 
Upvote 0
Another option with Excel 365 you could use FLASH FILL.
Type Green in cell B2.
Then go to DATA on ribbon
Then click on FLASH FILL and it will fill in the last word.
That would work too, thank you for your help :)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top