+ Reply to Thread
Results 1 to 7 of 7

put 0 in front of number

  1. #1
    dlb1228
    Guest

    put 0 in front of number

    i have a field that has a number in it for example
    100
    115
    116
    12

    i want these to always be 4 digits and put zeros in front of the number
    how can i do this

  2. #2
    T Kirtley
    Guest

    RE: put 0 in front of number

    You can use a formula like =TEXT(A4,"0000") to force padded zeros to show, or
    you can make a custom number format like 0000 to make up to 4 leading zeros
    show, (but the actual data will not be changed)

    Hope that helps,

    TK

    "dlb1228" wrote:

    > i have a field that has a number in it for example
    > 100
    > 115
    > 116
    > 12
    >
    > i want these to always be 4 digits and put zeros in front of the number
    > how can i do this


  3. #3
    Bob Phillips
    Guest

    Re: put 0 in front of number

    Format it as 0000 (Format>Cells>Custom)

    --

    HTH

    Bob Phillips

    (replace xxxx in the email address with gmail if mailing direct)

    "dlb1228" <[email protected]> wrote in message
    news:[email protected]...
    > i have a field that has a number in it for example
    > 100
    > 115
    > 116
    > 12
    >
    > i want these to always be 4 digits and put zeros in front of the number
    > how can i do this




  4. #4
    Nick Hodge
    Guest

    Re: put 0 in front of number

    You can 'display' it as four digits by selecting the data, going to
    Format>Cells...>Custom and type 0000 in the text box

    I stress display...the underlying data is still a number without leading
    zeroes

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    [email protected]HIS


    "dlb1228" <[email protected]> wrote in message
    news:[email protected]...
    >i have a field that has a number in it for example
    > 100
    > 115
    > 116
    > 12
    >
    > i want these to always be 4 digits and put zeros in front of the number
    > how can i do this




  5. #5
    Toppers
    Guest

    RE: put 0 in front of number

    Format as "0000"

    "dlb1228" wrote:

    > i have a field that has a number in it for example
    > 100
    > 115
    > 116
    > 12
    >
    > i want these to always be 4 digits and put zeros in front of the number
    > how can i do this


  6. #6
    Marcelo
    Guest

    RE: put 0 in front of number

    Hi

    =rept("0",4-len(a2))&a2


    assuming that the 100 are in A2, please, have notice that the numbers will
    be a text.

    Hope this helps
    Regards from Brazil - going to the 6th
    Marcelo


    "dlb1228" escreveu:

    > i have a field that has a number in it for example
    > 100
    > 115
    > 116
    > 12
    >
    > i want these to always be 4 digits and put zeros in front of the number
    > how can i do this


  7. #7
    Dave Peterson
    Guest

    Re: put 0 in front of number

    You can preformat the cells as Text first and type all 4 digits.

    You can prefix the entry with an apostrophe: '0012

    Or you can give the column a custom format of: 0000
    (Format|Cells|number tab|custom category and type 0000 in that box)

    The value won't change, but you'll see leading zeros in the cell (not in the
    formula bar, though).

    dlb1228 wrote:
    >
    > i have a field that has a number in it for example
    > 100
    > 115
    > 116
    > 12
    >
    > i want these to always be 4 digits and put zeros in front of the number
    > how can i do this


    --

    Dave Peterson

+ 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