+ Reply to Thread
Results 1 to 3 of 3

concatenation of cells to equal length

  1. #1
    Registered User
    Join Date
    03-29-2010
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    21

    concatenation of cells to equal length

    hi,
    the data in the excel sheet is
    1
    456
    69023456
    12
    1556
    1890765
    1234567890
    12345
    178902345
    111111
    12345678

    Now this data may be even more jumbled in the files that i work on
    can you suggest a formulae to make the lenght of this cells=10 by appending zeros before the number
    Ex:1 should change to '0000000001
    and 1234567890 should remain as it is (as its length is already 10)
    Last edited by udayg10; 04-08-2010 at 08:22 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: concatenation of cells to equal length

    Try:

    =TEXT(A1,REPT(0,10))

    copied down

    replacing A1 with actual first cell to change.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

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

    Re: concatenation of cells to equal length

    If you're planning on continuing to use them as numbers in calculations, then another option is to format the cell (Numbers> custom), enter 0000000000 Otherwise, NBVC's formula is the best (I've always used =REPT(0,10-LEN(A1))&A1, his is way better).
    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

+ 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