Consulting

Results 1 to 5 of 5

Thread: Solved: Dealing with numbers with leading 0's

  1. #1
    VBAX Regular
    Joined
    Jul 2007
    Posts
    71
    Location

    Solved: Dealing with numbers with leading 0's

    I have a spreadsheet of account numbers.

    There are 3 parts to an account number - each in it's own cell.

    I need to make this into a single account number.

    I'm using Concatenate(A1,A2,A3)

    However, there are some accounts which have leading zeros. I tried applying a custom format to get the zeros to show, but they won't move over when I concatenate.

    For example if I have the following account:

    05 555 00555

    When I concatenate I get 5555555 and what I need is 0555500555.

    Is there an easy way to handle this? I was able to do a search/replace on a lot of them because they first numbers are standard. The others there are tons of values so I can't do that.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =TEXT(A1,"00")&TEXT(A2,"000")&TEXT(A3,"00000")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Another way

    =TEXT(A1*100000000+A2*100000+A3,"0000000000")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    ... or ... to make it more readable

    =TEXT(A1*10^8+A2*10^5+A3,"0000000000")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Jul 2007
    Posts
    71
    Location
    Ahhh...thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •