+ Reply to Thread
Results 1 to 7 of 7

Leading Zeros in Numeric Values

  1. #1
    DBavirsha
    Guest

    Leading Zeros in Numeric Values

    I need to combine or concatenate, two, three-digit values into one, six-digit
    value. For example, in column A, I have the value 123 and in column B, I
    have the value 456. In column C, I concatenate A & B into the text 123456.
    I run into a problem when the three digit values in columns A and B contain
    leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
    the two, three-digit values into one, six-digit value when one or both of the
    three-digit values contain leading zeros?

  2. #2
    JE McGimpsey
    Guest

    Re: Leading Zeros in Numeric Values

    One way:

    C1: =TEXT(A1,"000") & TEXT(B1,"000")

    In article <[email protected]>,
    DBavirsha <[email protected]> wrote:

    > I need to combine or concatenate, two, three-digit values into one, six-digit
    > value. For example, in column A, I have the value 123 and in column B, I
    > have the value 456. In column C, I concatenate A & B into the text 123456.
    > I run into a problem when the three digit values in columns A and B contain
    > leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
    > the two, three-digit values into one, six-digit value when one or both of the
    > three-digit values contain leading zeros?


  3. #3
    Jason Morin
    Guest

    Re: Leading Zeros in Numeric Values

    =TEXT(A1,"000")&TEXT(B1,"000")

    HTH
    Jason
    Atlanta, GA

    >-----Original Message-----
    >I need to combine or concatenate, two, three-digit

    values into one, six-digit
    >value. For example, in column A, I have the value 123

    and in column B, I
    >have the value 456. In column C, I concatenate A & B

    into the text 123456.
    >I run into a problem when the three digit values in

    columns A and B contain
    >leading zeros, such as 031, 002, 067, etc. How do I

    combine or concatenate
    >the two, three-digit values into one, six-digit value

    when one or both of the
    >three-digit values contain leading zeros?
    >.
    >


  4. #4
    Edgar Thoemmes
    Guest

    RE: Leading Zeros in Numeric Values

    As long as both values that you are concatenating are stored as text values
    they should concatenate fine.

    Check the Cell Format and make sure you have selected text.

    "DBavirsha" wrote:

    > I need to combine or concatenate, two, three-digit values into one, six-digit
    > value. For example, in column A, I have the value 123 and in column B, I
    > have the value 456. In column C, I concatenate A & B into the text 123456.
    > I run into a problem when the three digit values in columns A and B contain
    > leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
    > the two, three-digit values into one, six-digit value when one or both of the
    > three-digit values contain leading zeros?


  5. #5
    DBavirsha
    Guest

    Re: Leading Zeros in Numeric Values

    Thank you, Jason! Your formula was what I needed.

    Dave

    "Jason Morin" wrote:

    > =TEXT(A1,"000")&TEXT(B1,"000")
    >
    > HTH
    > Jason
    > Atlanta, GA
    >
    > >-----Original Message-----
    > >I need to combine or concatenate, two, three-digit

    > values into one, six-digit
    > >value. For example, in column A, I have the value 123

    > and in column B, I
    > >have the value 456. In column C, I concatenate A & B

    > into the text 123456.
    > >I run into a problem when the three digit values in

    > columns A and B contain
    > >leading zeros, such as 031, 002, 067, etc. How do I

    > combine or concatenate
    > >the two, three-digit values into one, six-digit value

    > when one or both of the
    > >three-digit values contain leading zeros?
    > >.
    > >

    >


  6. #6
    DBavirsha
    Guest

    Re: Leading Zeros in Numeric Values

    Thank you, JE! Your formula is what I was looking for.

    Dave

    "JE McGimpsey" wrote:

    > One way:
    >
    > C1: =TEXT(A1,"000") & TEXT(B1,"000")
    >
    > In article <[email protected]>,
    > DBavirsha <[email protected]> wrote:
    >
    > > I need to combine or concatenate, two, three-digit values into one, six-digit
    > > value. For example, in column A, I have the value 123 and in column B, I
    > > have the value 456. In column C, I concatenate A & B into the text 123456.
    > > I run into a problem when the three digit values in columns A and B contain
    > > leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
    > > the two, three-digit values into one, six-digit value when one or both of the
    > > three-digit values contain leading zeros?

    >


  7. #7
    DBavirsha
    Guest

    RE: Leading Zeros in Numeric Values

    The values are stored as numeric values, not text. they are formatted with
    the custom formatting 000. Converting a numberic value that contains one or
    more leading zeros to text by using the format cells, text command will
    remove the leading zeros from the numeric value. Thanks for your response,
    the formula provided by Jason and JE is what I was looking for.

    Dave

    "Edgar Thoemmes" wrote:

    > As long as both values that you are concatenating are stored as text values
    > they should concatenate fine.
    >
    > Check the Cell Format and make sure you have selected text.
    >
    > "DBavirsha" wrote:
    >
    > > I need to combine or concatenate, two, three-digit values into one, six-digit
    > > value. For example, in column A, I have the value 123 and in column B, I
    > > have the value 456. In column C, I concatenate A & B into the text 123456.
    > > I run into a problem when the three digit values in columns A and B contain
    > > leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
    > > the two, three-digit values into one, six-digit value when one or both of the
    > > three-digit values contain leading zeros?


+ 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