+ Reply to Thread
Results 1 to 6 of 6

How to show zero as a first number

  1. #1
    Registered User
    Join Date
    03-08-2008
    Posts
    7

    How to show zero as a first number

    I am a beginner at Excel and would like to know how export numbers into another spreadsheet that begin with zero, at the moment it deletes them, I would like them to remain as they are bar codes, I have to import a thousand of lines at a time, some of which begin with a zero and some do not.

    It seems that when I copy and paste, the numbers paste in OK but not the format, so the numbers that begin with a zero effectively lose that zero and the numbers that begin with any other number paste accross unchanged.

    I can Format cells, then in custom change type to "0"# but this simply adds a zero to every number in column, if I could import the correct number into Excel to start with it should work. I realise this is no doubt quite straightforward but I just can't work it out, help!

    Many thanks

    Paul Smith
    Last edited by Paul Smith; 03-08-2008 at 07:51 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, Copy this for future ref, It's on the Microsoft support website.
    ------------------
    Using a custom number format to display leading zeros
    In Microsoft Excel, you can use either of two methods for using a custom number format to display leading zeros. Use one method for fixed-length numbers and use the other method for variable-length numbers.
    Method 1: Fixed-length Numbers
    When you want to display leading zeros for a fixed-length number, create a custom format with the same number of zeros (0) as digits that you want to display. For example, if you want to display a fixed-length number with five digits, create a custom number format with five zeros.

    Example 1:

    Use the 00000 format to display a number with five digits. When you use this format, the numbers that you type and the numbers that Microsoft Excel displays are listed in the following table.
    Typed number Displayed number
    --------------------------------
    28217 28217
    1234 01234
    Example 2:

    Use the 00000-0000 format when you want the number to appear as five digits followed by a hyphen and four more digits. When you use this format, the numbers that you type and the numbers that Microsoft Excel displays are listed in the following table.
    Typed number Displayed number
    --------------------------------
    8217 00000-8217
    82170000 08217-0000
    Method 2: Variable-length Numbers
    When you want to display leading zeros for variable-length numbers, create a custom format with the same number of zeros (0) (in quotation marks) as leading zeros that you want to display, followed by the number sign (#). For example, if you want to format a variable-length number with three leading zeros, create the following custom number format:
    "000"# Example 1:

    Use the "0"# format when you want to display one leading zero. When you use this format, the numbers that you type and the numbers that Microsoft Excel displays are listed in the following table.
    Typed number Displayed number
    --------------------------------
    123 0123
    45 045
    Example 2:

    Use the "000"# format when you want to display three leading zeros. When you use this format, the numbers that you type and the numbers that Excel displays are listed in the following table.
    Typed number Displayed number
    --------------------------------
    123 000123
    45 00045
    --------------------------
    Regards Mick

  3. #3
    Registered User
    Join Date
    03-08-2008
    Posts
    7
    Thanks very much, appreciated

    Paul

  4. #4
    Registered User
    Join Date
    09-29-2008
    Location
    City so nice, they named it twice! New York, New York
    MS-Off Ver
    2007
    Posts
    2

    Re: How to show zero as a first number

    It may have helped Paul, but not me. I've got variable numbers which also have a variable number of zeroes which could precede.

    Formatting as text does not help, fixed length does not help, nor does variable. (Because variable has a FIXED number of zeroes attached.) Sigh....

  5. #5
    Registered User
    Join Date
    09-29-2008
    Location
    City so nice, they named it twice! New York, New York
    MS-Off Ver
    2007
    Posts
    2

    Re: How to show zero as a first number

    Wow. A member since 2008, and that was only my FIRST post!

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to show zero as a first number

    and you managed to hijack a thread! please start your own linking to this if required.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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