TB's Code Library
If it ain't tight, it ain't right!
Search
Friday, August 12, 2005
Excel - 9 digit zip codes trimmed to first 5 digits
This code will trap for zip codes that have a "-" in it as a separator then trim 5 characters off the end to reveal only 5 digits.
=IF(LEN(P2)=5,P2,LEFT(P2,LEN(P2)-5))
Example: 46033-9695
after code execution "46033" will be displayed.
Newer Post
Older Post
Home