ZIP code to text?

S

Scott Schaus

I need to convert ZIP code to text, keeping the leading zeros in the text. Formatting a cell as ZIP CODE shows the leading zero(s), but formulas "see" the value without the zero(s). I have temporarily worked around by entering ZIPs with leading zero(s) as text, using the apostrophe prefix, but this would mean a lot of manual overrides in final project.

Example:
ZIP code in cell B2 is 04986; shows correctly as 04986 with ZIP format in cell, but shows 4986 in formula bar. When I calculate LEFT(B2, 3), result is 498, instead of 049. Currently I manually enter ZIP as '04986, then LEFT(B2,3) yields 049 as expected.

TIA for any thoughts/suggestions.

Scott Schaus
Director of Education
Valley Anesthesia Educational Programs, Inc.
(e-mail address removed)
 
S

Steve

Use = left(TEXT(B2,"00000"),3) for your example and all will work with ZIP
codes entered as numbers.

Steve.

Scott Schaus said:
I need to convert ZIP code to text, keeping the leading zeros in the text. Formatting a cell as ZIP CODE shows the leading
zero(s), but formulas "see" the value without the zero(s). I have temporarily worked around by entering ZIPs with leading zero(s) as
text, using the apostrophe prefix, but this would mean a lot of manual overrides in final project.
ZIP code in cell B2 is 04986; shows correctly as 04986 with ZIP format in cell, but shows 4986 in formula bar. When I calculate
LEFT(B2, 3), result is 498, instead of 049. Currently I manually enter ZIP as '04986, then LEFT(B2,3) yields 049 as expected.
 

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