Lookup Function

J

Jason Harman

How would I "split" a cell valuve between multiple cells.

Example.

I have City, ST ZIP in A1.

I want in

A2 City
A3 ST
A4 ZIP

The Comma is a Separator and the State always has two charaters for my use.

Help PLease

JCH
 
D

Domenic

Provided that your format is consistent, try the following...

City...

=LEFT(A1,FIND(",",A1)-1)

State...

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

Zip Code...

=RIGHT(A1,LEN(A1)-(FIND(",",A1)+4))

Hope this helps!
 
G

Guest

Your Subject says "Lookup Function", but the solution below assumes that
you're not actually asking about the Excel LOOKUP Function. Rather, the
formulas below extract the city, state, & zip from a single cell (A1), &
return those 3 fields in 3 separate cells (A2, A3, A4).

A1: New York, NY 10001
A2: =LEFT(A1,FIND(",",A1)-1)
A3: =MID(A1,FIND(",",A1)+2,2)
A4: =VALUE(RIGHT(A1,5))

You'll probably need to format A4 using the Zip Code format:
Format Menu | Format Cells | Number Tab | Special | Zip Code
This prevents zip codes such as "00101" be displayed as "101".

If you don't want to convert the zip code to a value, then use this formula
in A4:
=RIGHT(A1,5)
With this formula, the zip code will be text, & Zip Code formatting isn't
needed.

You probably know this, but just in case - you may want to place the
formulas in B1, C1, & D1.

These formulas are relatively simple, and may not work if you have +4 zip
codes, extra spaces, missing spaces, or other syntax variations. The
formulas assume your data has this consistent syntax:
"New York, NY 10001"

Good luck.
 

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