+ Reply to Thread
Results 1 to 4 of 4

Concatenate - number zero

  1. #1
    Registered User
    Join Date
    01-11-2011
    Location
    Calgary
    MS-Off Ver
    Excel 2007
    Posts
    10

    Concatenate - number zero

    Hi there

    I have a spreadsheet with 6 columns;

    The data in the columns for example are:

    100 01 02 022 10 A3

    I need to concatenate them, but when I do I lose the first '0' in the column and get the following result:

    100122210A3

    I need the result as: 100010202210A3

    What do I need to change to get the zero back?

    Thanks
    Lynn

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Concatenate - number zero

    100 01 02 022 10 A3

    Assuming 1st and 4th value to always be 3 digits, 2nd, 3rd and 5th to be 2 digits and 6th to be letter and single digit, values in A1,B1,C1,D1,E1,F1

    =TEXT(A1,"000")&Text(B1,"00")&Text(C1,"00") &Text(D1,"000")&Text(E1,"00")& F1

    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor TechRetard's Avatar
    Join Date
    06-14-2009
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Concatenate - number zero

    Lynn, if your #s with leading zeros are always in the same column, you can use the text() function for those...

    i.e.:

    Please Login or Register  to view this content.
    would give you 100010202210a3

    so the "00" means the cell will always show with at least 2 digits...1 would be 01, 10 would still be 10, 001 would be 01, etc...edit the formula as you see fit

  4. #4
    Registered User
    Join Date
    01-11-2011
    Location
    Calgary
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Concatenate - number zero

    Perfect - thanks!!!!

+ 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