Pulling partial information from a cell

E

Emeryville John

Hi,

Thanks to Dave and Peo for help on my previous request.

I have a list of 5 digit zip codes (eg. 90210) and a list of 5 + 4 digit zip
codes (eg. 90210-1234). How can I pull just the first 5 digits from the 5 +
4 digit zip codes?
 
R

Ron Coderre

With
A1 containing a numeric zip code, formatted as either a 5-digit zip code OR
a 5+4 zip code

This formula returns the 5 digit part:
B1: =LEFT(TEXT(A1,"00000"&IF(A1>=10000,"-0000","")),5)

Is that something you can work with?

Regards,

Ron Coderre
Microsoft MVP (Excel)
 

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