REMOVE LEADING ZEROS

G

Guest

00456 Tickford Dr.---->456 Tickford Dr.
0785 Fort St.---------->785 Fort St.
000309 Old Rock Dr.-->309 Old Rock Dr.

How do I remove the leading zeros for these addresses?
 
G

Guest

Say your first address is in A1. Use this formula:

=SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(A1," ","%"),"0"," ")),"
","0"),"%"," ")

This will convert existing spaces to percent signs, then convert zeros to
spaces so it can trim the leading spaces. Then it replaces the spaces with
zeros and the percent signs with spaces. Therefore, if any of your addresses
have percent signs in them for any reason, this wouldn't work. You'd have to
choose another character to change the original spaces to, like ~ or ^ or
somesuch.

There might be an easier way to do this, but this should work.
 

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