Extract data from right until blank

kchbs

New Member
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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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))

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

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))

north19701 said:
...

=REPLACE(A1,SEARCH(B1,A1),LEN(A1),"")

...

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

You need to wrap TRIM around whichever you choose to apply though.

Replies
20
Views
2K

Threads
1,217,347
Messages
6,136,046
Members
449,984
Latest member
Ffprojectjkt

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

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