Extract Text

zinah

Board Regular
Joined
Nov 28, 2018
Messages
241
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

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,444
Office Version
  1. 365
Platform
  1. Windows
If you just want the last word, how about
Excel Formula:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100))
 
Solution

zinah

Board Regular
Joined
Nov 28, 2018
Messages
241
Office Version
  1. 365
Platform
  1. Windows
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
62,444
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

AhoyNC

Well-known Member
Joined
Oct 10, 2011
Messages
4,840
Office Version
  1. 365
Platform
  1. Windows
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.
 

zinah

Board Regular
Joined
Nov 28, 2018
Messages
241
Office Version
  1. 365
Platform
  1. Windows
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 :)
 

Forum statistics

Threads
1,141,416
Messages
5,706,310
Members
421,441
Latest member
VapesRub

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
Top