Vlookup partial text from a single cell

S

Sparky13

I use a spread sheet which includes the customer address (city and state) in
a single (merged) cell. The spreadsheet also containes a look up table with
2-letter state abbreveations. I need to capture only the state from the
address (cell E5) for the vlookup.
=IF(VLOOKUP(E5,$GC$9:$GD$59,2,FALSE)=0,"NO",IF(VLOOKUP(E5,$GC$9:$GD$59,2,FALSE)>0,"Yes")) Excel 2003 SP1
 
T

Toppers

Are you saying the you want to use "California" in the address cell to return
"CA"?

How are the City/State delimited in the address cell?
 
D

Debra Dalgleish

If the state code is the last two letters in cell E5:

VLOOKUP(RIGHT(E5,2),$GC$9:$GD$59,2,FALSE)
 
S

Sparky13

Thank you Deb, this does exactly what I wanted.

Debra Dalgleish said:
If the state code is the last two letters in cell E5:

VLOOKUP(RIGHT(E5,2),$GC$9:$GD$59,2,FALSE)
 
Top