Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default REMOVE LEADING ZEROS

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default REMOVE LEADING ZEROS

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.

--
Mike Lee
McKinney,TX USA


"ichihina" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default REMOVE LEADING ZEROS

=VALUE(LEFT(A2,FIND(" ",A2)-1))&MID(A2,FIND(" ",A2),255)

"ichihina" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove leading zeros from column Rich K. Excel Discussion (Misc queries) 2 January 2nd 07 09:43 PM
How to remove leading zeros using excel 2000 RodJB Excel Discussion (Misc queries) 7 December 23rd 05 02:28 AM
remove leading zeros from text strings snooze Excel Worksheet Functions 2 July 26th 05 05:59 PM
Leading zeros Paul Excel Discussion (Misc queries) 4 June 12th 05 04:04 AM
save text field w/ leading zeros in .csv format & not lose zeros? Ques Excel Discussion (Misc queries) 1 May 4th 05 06:21 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"