+ Reply to Thread
Results 1 to 5 of 5

need to add o's in between two numbers, need help!

  1. #1
    Registered User
    Join Date
    03-31-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    need to add o's in between two numbers, need help!

    hi , I've a problem on a formula to add zero's in between two numbers, like

    if A1 16225 & B1 22546 =CONCATENATE(A1,REPT(0,9-LEN(A1)),B1) Result = 1622500022546

    the problem is when i need total 13 numbers

    if A1 16225 & B1 22546 =CONCATENATE(A1,REPT(0,9-LEN(A1)),B1) Result = 162250002546

    Result 162200022546
    16220002456

    instead i need 162200022546
    162200002456

    Help guys!

    Sorry for mistakes, Thanks in advance.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: need to add o's in between two numbers, need help!

    I get this result using that formula

    16225000022546

    four zeroes between the two values.

    Are A1 and B1 always 5 digits? If so and you just want 3 zeroes try

    =A1&"000"&B1
    Audere est facere

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: need to add o's in between two numbers, need help!

    =a1&rept(0,13-(len(a1)+len(b1)))&b1
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    03-31-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: need to add o's in between two numbers, need help!

    martindwilson, If u don't mind can u explain that....?

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: need to add o's in between two numbers, need help!

    =a1&rept(0,13-(len(a1)+len(b1)))&b1 is the same as

    CONCATENATE(A1,rept(0,13-(len(a1)+len(b1))),B1)

    rept(0,13-(len(a1)+len(b1))) you need 13 digits so take the total length of the original so say a1=12 b1=100 length is 5
    13-5=8 so add 8 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