+ Reply to Thread
Results 1 to 5 of 5

Adding Leading Zeros to Text

  1. #1
    Jenn
    Guest

    Adding Leading Zeros to Text

    In column A I have text like the following
    1.2
    01.34
    03.4
    2.1

    What I need excel to do is look in Column A and any text that does not begin
    with a zero character, add a zero to the beginning of the text string, else
    leave it alone. So that my above example when done would look like:

    01.2
    01.34
    03.4
    02.1

    Any quick fixes for this? I have a thousand rows so doing this by hand would
    really stink!
    Thanks in advance!



  2. #2
    Bob Phillips
    Guest

    Re: Adding Leading Zeros to Text

    sorry, meant custom format not formula.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jenn" <Jenn@discussions.microsoft.com> wrote in message
    news:0CF83E0C-5BA9-4694-AF79-B8DF110AD110@microsoft.com...
    > In column A I have text like the following
    > 1.2
    > 01.34
    > 03.4
    > 2.1
    >
    > What I need excel to do is look in Column A and any text that does not

    begin
    > with a zero character, add a zero to the beginning of the text string,

    else
    > leave it alone. So that my above example when done would look like:
    >
    > 01.2
    > 01.34
    > 03.4
    > 02.1
    >
    > Any quick fixes for this? I have a thousand rows so doing this by hand

    would
    > really stink!
    > Thanks in advance!
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: Adding Leading Zeros to Text

    How about adding a formula of 00.0#?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jenn" <Jenn@discussions.microsoft.com> wrote in message
    news:0CF83E0C-5BA9-4694-AF79-B8DF110AD110@microsoft.com...
    > In column A I have text like the following
    > 1.2
    > 01.34
    > 03.4
    > 2.1
    >
    > What I need excel to do is look in Column A and any text that does not

    begin
    > with a zero character, add a zero to the beginning of the text string,

    else
    > leave it alone. So that my above example when done would look like:
    >
    > 01.2
    > 01.34
    > 03.4
    > 02.1
    >
    > Any quick fixes for this? I have a thousand rows so doing this by hand

    would
    > really stink!
    > Thanks in advance!
    >
    >




  4. #4
    Dave O
    Guest

    Re: Adding Leading Zeros to Text

    This formula did it for me:
    =TEXT(VALUE(A1),"00.00")

    Working from the inside out, this formula converts your text to a value
    to standardize each entry so it does not have a leading zero. Then the
    formula converts it back to text in 00.00 format- this to accommodate
    the 2 decimal places required as in the 01.34 example.


  5. #5
    Jenn
    Guest

    Re: Adding Leading Zeros to Text

    Thanks! Both worked like a charm!

    "Dave O" wrote:

    > This formula did it for me:
    > =TEXT(VALUE(A1),"00.00")
    >
    > Working from the inside out, this formula converts your text to a value
    > to standardize each entry so it does not have a leading zero. Then the
    > formula converts it back to text in 00.00 format- this to accommodate
    > the 2 decimal places required as in the 01.34 example.
    >
    >


+ 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