+ Reply to Thread
Results 1 to 3 of 3

Splitting a string of numbers into separate cells: where to even begin?

  1. #1
    Registered User
    Join Date
    05-31-2013
    Location
    Michigan, US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Splitting a string of numbers into separate cells: where to even begin?

    I am posting this here because I don’t even know if the “VBA/Macros” forum or the “Formulas & Functions” forum would be better (and also to indicate the very basic level at which the answer will need to be for me to understand it).

    Basically, I learned recently how to collapse the contents of many cells into one (separated by commas) by going to VBE, inserting a module, copying a code into it, and then back in the spreadsheet typing =ConCat(the cells I want to merge).

    I want to reverse that process and split a strong of numbers (without commas- something like 24314231342 but longer) into separate columns. Right now I’m using “text to columns”/fixed width and manually clicking the break line for each digit. But I feel there must be a faster, easier, and less error-prone way.

    I did see this thread: http://www.excelforum.com/excel-prog...to-digits.html and tried to understand it. But while I can copy the codes provided, of course, I don’t understand how to use them. I need the kind of step by step directions you would give to the most stupid person possible.

    (I’m in Excel 2010, if that helps). I feel like this is hopefully an easy one? I appreciate any help.
    Last edited by confused_teacher; 06-03-2013 at 02:34 PM.

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

    Re: Splitting a string of numbers into separate cells: where to even begin?

    With your number in A1
    In B1 and copied to the right as far as you want to. Copy down as far as you need to also.
    =IFERROR(MID(A1,COLUMNS($A$1:A1),1),"")

    If you want them to be considered numbers (for calculations)
    =IFERROR(MID(A1,COLUMNS($A$1:A1),1)+0,"")

    COLUMNS($A$1:A1) is a way of iterating your value. it counts the number of columns between parenthese (in this case 1) as you drag/copy your formula to the right, it becomes
    COLUMNS($A$1:B1) (which equals 2 columns) COLUMNS($A$1:C1) (or 3) and so on.
    Last edited by ChemistB; 05-31-2013 at 04:24 PM.
    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
    Registered User
    Join Date
    05-31-2013
    Location
    Michigan, US
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Splitting a string of numbers into separate cells: where to even begin?

    Thanks for your quick answer! I don't completely follow the explanation, but once I anchored the originating cell with $ signs it seemed to work perfectly. This will save me so much time! Thanks so much!

+ Reply to Thread

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.6.0 RC 1