+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    03-02-2009
    Location
    india
    MS-Off Ver
    Excel 2000
    Posts
    17

    splitting a single number into multiple columns

    Hi friends,
    Suppose there is a number 223 and i want to split it into different columns col1-2,col2-2,col3-3

    like
    If A1=223
    then i want
    B1=2
    B2=2
    B3=3

    and i dont want any change in A1

    Is there any way to do that--
    Last edited by aapaan; 05-04-2009 at 07:53 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2003
    Posts
    270

    Re: splitting a single number into multiple columns

    B1 =MID($A$1,ROW(1:1),1)

    poll down

  3. #3
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,006

    Re: splitting a single number into multiple columns

    =MID(REPT("0",3-LEN($A$1)) & $A$1,ROW(),1)

    would allow for different sises of numbers, change 3 to the maximum digits in your number, if you want blank cells rather than leading zeros replace the "0" with " "
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  4. #4
    Registered User
    Join Date
    03-02-2009
    Location
    india
    MS-Off Ver
    Excel 2000
    Posts
    17

    Re: splitting a single number into multiple columns

    Quote Originally Posted by squiggler47 View Post
    =MID(REPT("0",3-LEN($A$1)) & $A$1,ROW(),1)

    would allow for different sises of numbers, change 3 to the maximum digits in your number, if you want blank cells rather than leading zeros replace the "0" with " "
    not working only one column is coming correct
    like
    If number is 661
    only 6 is coming

  5. #5
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: splitting a single number into multiple columns

    Try this:

    =IF(COLUMN(E12)-4<=LEN($D$12);MID($D$12;COLUMN(E12)-4;1);"")

    Where D12 is number
    E12 is first formula (extend other to right)
    COLUMN(E12)-4 is to get 1 first number... so if you put other column e.g. B you must take down other number A12 - 0, B12-1, C12-2, D12-3, E12-4, F12-5 etc
    "Relax. What is mind? No matter. What is matter? Never mind!"

  6. #6
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: splitting a single number into multiple columns

    Sorry, didn't wathc you going down

    =IF(ROW(B1)<=LEN($A$1);MID($A$1;ROW(B1);1);"")

    in B1 to as many as you need characters

    Book1.xls
    Last edited by zbor; 05-04-2009 at 06:30 AM.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  7. #7
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,478

    Re: splitting a single number into multiple columns

    deleted again i misread the question doh!
    but you say
    col1-2,col2-2,col3-3
    which is across columns
    and contradict that with
    b1 2
    b2 2
    b3 3
    which is down rows,
    did you mean A1 223 B1 2 C1 2 D1 3
    Last edited by martindwilson; 05-04-2009 at 07:45 AM.
    Mojito connoisseur and a dabbler in Cisco
    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

  8. #8
    Registered User
    Join Date
    03-02-2009
    Location
    india
    MS-Off Ver
    Excel 2000
    Posts
    17

    Re: splitting a single number into multiple columns

    Quote Originally Posted by zbor View Post
    Sorry, didn't wathc you going down

    =IF(ROW(B1)<=LEN($A$1);MID($A$1;ROW(B1);1);"")

    in B1 to as many as you need characters

    Attachment 42777

    yeah this one is working but when i copy paste to other rows its not working

  9. #9
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: splitting a single number into multiple columns

    what you mean by other rows? As I explain above, if you moving to other rows (as for toher columns) you must adjust formula to look to first row.

    This was for B1.

    If you putting formula to K823

    you must adjust formula to look at ROW(K823)-822
    "Relax. What is mind? No matter. What is matter? Never mind!"

  10. #10
    Registered User
    Join Date
    03-02-2009
    Location
    india
    MS-Off Ver
    Excel 2000
    Posts
    17

    Re: splitting a single number into multiple columns

    hmmm.i understood that if i want to apply this formula to 5000 cells i have to adjust it 5000 times..

  11. #11
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: splitting a single number into multiple columns

    no
    That's why we put in formula ROW(c500)-499

    So you don't need to change it...

    You should change if you put 0 in first, -1 in second, -2 in third..... -499 in 500th formula...

    With ROW you got it automatic, you just need to adopt it to the FIRST formula
    "Relax. What is mind? No matter. What is matter? Never mind!"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0