Extract last word from a cell value

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
lik this?
Excel 2010
X
Z
PETER ENGLAND ENGLANDENGLAND
sUN/Water-Rose Prime PRIMEPRIME
Daniel Murray-8horse/55buffALo123 55BUFFALO12355BUFFALO123
riSiNg888 RISING888RISING888

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]4[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]B1[/TH]
[TD="align: left"]=UPPER(TRIM(RIGHT(SUBSTITUTE(TRIM(X1)," ",REPT(" ",99)),99)))
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
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,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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