Extract last word from a cell value

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,215
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
I am having 'NAMES' in column X5:X9999. NAMES contains 4 words MAXIMUM of alphanumeric characters separated by either a blank or "/" or "-".
How to get the last word from the NAMES? All output required in UPPERCASE only in column Z5:Z9999

Ex:
PETER ENGLAND ENGLAND
sUN/Water-Rose Prime PRIME
Daniel Murray-8horse/55buffALo123 55BUFFALO123
riSiNg888 RISING888

I am using Excel2007. Thanks in advance.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
lik this?
Excel 2010
X
Z
1PETER ENGLAND ENGLANDENGLAND
2sUN/Water-Rose Prime PRIMEPRIME
3Daniel Murray-8horse/55buffALo123 55BUFFALO12355BUFFALO123
4riSiNg888 RISING888RISING888

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1=UPPER(TRIM(RIGHT(SUBSTITUTE(TRIM(X1)," ",REPT(" ",99)),99)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
It WORKS. Thanks.
Can I get FIRSTWORD + LASTWORD 'together'.
Answer for 3: DANIEL55BUFFALO123
 
Upvote 0
=trim(left(substitute(trim(a1)," ",rept(" ",200)),200))&trim(right(substitute(trim(a1)," ",rept(" ",200)),200))
 
Upvote 0
It WORKS, Thanks again.
There are three cells in which 3 special characters are punched like AA1="+", AB1="/" & AC1="-".
Can these 3 special characters be included in between FIRSTNAME & LASTNAME.
Answer: DANIEL+/-55BUFFALO123
There can be blank also in AA1:AC1.
 
Upvote 0
=trim(left(substitute(trim(a1)," ",rept(" ",200)),200))&aa1&ab1&ac1&trim(right(substitute(trim(a1)," ",rept(" ",200)),200))
 
Upvote 0
=substitute(left(substitute(x1," ",rept("*",len(x1))),len(x1)),"*","")&substitute(right(substitute(x1," ",rept("*",len(x1))),len(x1)),"*","")
 
Upvote 0

Forum statistics

Threads
1,216,176
Messages
6,129,316
Members
449,501
Latest member
Amriddin

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