+ Reply to Thread
Results 1 to 5 of 5

Adding Leading Zeros

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Adding Leading Zeros

    I have a large list of "random" numbers from 1 to 250000 I need to format these so that they are all 6 digits long by adding leading zeros where necessary.
    I have searched the information available to me but apart from TRIM to remove leading zeros I can't find anything that even mentions leading zeros. Has anyone some advice I can use.

    John

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Adding Leading Zeros

    Hi right click format>custom> 0000000 (put n no of zeros)
    Click just below left if it helps, Boo?ath?

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: Adding Leading Zeros

    Depends if you just want them to show six digits or whether you want them to physically have six digits, for example, if you want to create a .csv file with these numbers.

    If you just want to display them, use a custom format with six zeros. If you want to force the digits, you could use TEXT, for example, =TEXT(H1,"000000"). That would, of course, need to be in a separate column ... but you could hide the original column.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: Adding Leading Zeros

    Thanks for your interest. I need to go the TEXT way. It was the actual format code ie "000000" that I needed and did not know. Thanks for your help
    John

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: Adding Leading Zeros

    You're welcome. Thanks for the rep.


    Weather's brightening up a bit

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help adding leading and trailing zeros!
    By vpsaline in forum Excel General
    Replies: 4
    Last Post: 10-16-2013, 10:48 PM
  2. [SOLVED] Adding leading zeros to a number in excel
    By northcoms in forum Excel General
    Replies: 2
    Last Post: 07-04-2013, 09:00 AM
  3. Adding leading zeros to a text box
    By fbiasi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2013, 01:53 PM
  4. Excel 2007 : Adding leading zeros to 35K lines
    By budchevy in forum Excel General
    Replies: 2
    Last Post: 05-08-2011, 08:50 PM
  5. [SOLVED] Adding Leading Zeros to Text
    By Jenn in forum Excel General
    Replies: 4
    Last Post: 01-12-2005, 03:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1