Slightly Different Extracting Text from a Cell

W

Wendy L

Windows XP
Office XP

Okay I already posted a similar question once but my needs have slightly
changed.

If i have a text string in a cell, I want to extract all text to the left of
the "space character" (" ") that is furthest to the right.

So if my address line is:
Stanton, Ohio 79541-6598 - the formula will extract the text "Stanton, Ohio"

Thanks so much for all your help.
 
G

Guest

=LEFT(A1,FIND(" ",A1,FIND(", ",A1)+2))

This is assuming you're always going to have the ", " separating the town
and state. If that assumption changes, modify the nested FIND to reflect the
changes.

Good luck!
Elma
 
F

Frank Kabel

Hi
try
=TRIM(LEFT(A1,VLOOKUP(2,1/(MID(A1,INDIRECT(ROW("1:1024")),1)="
"),INDIRECT(ROW("1:1024")))-1))
 
D

Dave Peterson

That line break position was unfortunate and I think Frank had a couple of
typos:

=TRIM(LEFT(A1,LOOKUP(2,1/(MID(A1,ROW(INDIRECT("1:1024")),1)=" "),
ROW(INDIRECT("1:1024")))-1))
(all one cell)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top