Extract data from right until blank

kchbs

New Member
Joined
Jan 15, 2004
Messages
2
Can someone please help me with a formula to extract a word from a cell starting from the right moving left until blank. I want to put this information into a separate cell.

Here is sample of the data:

Univ. Connecticut Med School Farmington
266 Coldbrook Road Glastonbury
100 Retreat Avenue Hartford
195 S. Main Street Middleton
87 Grandview Avenue Waterbury
87 Grandview Avenue Waterbury




THANKS so much for any assistance

Karen
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,203
A generic formula to extract last word...

=RIGHT(A1,LEN(A1)-SEARCH(CHAR(127),SUBSTITUTE(A1," ",CHAR(127),LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))

Simpler and faster if you install the morefunc.xll add-in...

=WMID(A1,WORDCOUNT(A1))
 

kchbs

New Member
Joined
Jan 15, 2004
Messages
2
thank you, thank you, thank you!!

One more question - how do I cut the same text I extracted out of the first cell so that now they are split into 2 and there is no duplication of the city

Karen
 

north19701

Active Member
Joined
Jun 17, 2003
Messages
491
Book8
ABCDE
1Univ.ConnecticutMedSchoolFarmingtonFarmingtonUniv.ConnecticutMedSchool
2266ColdbrookRoadGlastonburyGlastonbury266ColdbrookRoad
3100RetreatAvenueHartfordHartford100RetreatAvenue
4195S.MainStreetMiddletonMiddleton195S.MainStreet
587GrandviewAvenueWaterburyWaterbury87GrandviewAvenue
687GrandviewAvenueWaterburyWaterbury87GrandviewAvenue
7
8
9
10
Sheet1


Using Aladin's formula in b1, the formula in c1 is what I used to separate the city out. Surely, Aladin's solution will probably be much cleaner and more efficient, but I just started playing around with text and I thought I'd take a stab at it.

Else, another formula that could go in C1 is:

=LEFT(A1,LEN(A1)-LEN(B1))
 

Watch MrExcel Video

Forum statistics

Threads
1,129,594
Messages
5,637,299
Members
416,963
Latest member
zazama

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