+ Reply to Thread
Results 1 to 5 of 5

turning 1,2,3 into 1,1,1,2,2,2,3,3,3

  1. #1
    Forum Contributor
    Join Date
    04-14-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    133

    turning 1,2,3 into 1,1,1,2,2,2,3,3,3

    in column A, i have 1,2,3
    how to write a formular that turns into 1,1,1,2,2,2,3,3,3?
    or 1,1,1,1,2,2,2,2,3,3,3,3?

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: turning 1,2,3 into 1,1,1,2,2,2,3,3,3

    hi slxia1, is it a maximum of just 3 numbers in column A? otherwise, it's just too long a formula & you might want to consider VBA. here's the current formula to handle 3 numbers:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    change all those in red to 4 if you want it to repeat 4 times

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: turning 1,2,3 into 1,1,1,2,2,2,3,3,3

    And if your data is from A1 to A10 write this in B1 and pull down:

    Please Login or Register  to view this content.
    This will return you:
    a,a,a,b,b,b,c,c,c,m,m,m,a,a,a,b,b,b, etc (in Column B).

    To change from a,a,a, to a,a,a,a, change number 3 to 4 (or any other number for repetitions)

  4. #4
    Forum Contributor
    Join Date
    04-14-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    133

    Re: turning 1,2,3 into 1,1,1,2,2,2,3,3,3

    Hi Guys,

    I was hoping to avoid vba. Do you know a quick loop for it?

    Also, thanks for the formula, but I have a lot of data. Ill try zbor's formula nevertheless.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: turning 1,2,3 into 1,1,1,2,2,2,3,3,3

    If you have more than 3 comma seperated values, to keep the formula manageable, you could consider using a named range,and helper columns (hidden with the +/- grouping button).

    Name:= "Repeated"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This handles up to 6 values, extend the array if you need more.

    Then drag B2 Across and Down until blanks are returned.

    Lastly extend the concatenation in J2.

    In B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Change the value in Cell $J$1 to change the number of repeats per value.
    Attached Files Attached Files
    Last edited by Marcol; 02-24-2013 at 09:44 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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