+ Reply to Thread
Results 1 to 15 of 15

Permutations - Combinations

  1. #1
    Registered User
    Join Date
    03-02-2007
    Posts
    6

    Permutations - Combinations

    I need the desired output as found in the image.
    Is it possible?
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    yes

    Note: Answer gives as much info as your posting gave details
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    03-02-2007
    Posts
    6
    Quote Originally Posted by mudraker
    yes

    Note: Answer gives as much info as your posting gave details
    What is the solution then, mudraker?

    Regards,
    Dilip Samuel

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    See attached ...
    Attached Files Attached Files
    HTH
    Carim


    Top Excel Links

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You have attached a picture of your desired output which means you already have the sheet setup as required. Remmber seeing it on screen is just one of the many ways you can have an output.

    More details of what you realy want to acheive will get you the reponse you require

  6. #6
    Registered User
    Join Date
    03-02-2007
    Posts
    6
    Quote Originally Posted by mudraker
    You have attached a picture of your desired output which means you already have the sheet setup as required. Remmber seeing it on screen is just one of the many ways you can have an output.

    More details of what you realy want to acheive will get you the reponse you require

    Hello Mudraker,

    I have column A and B with me and they are more than 1000 records. I need to achieve the same result for all 1000 entries. Obviously C is desired output.

    Let me know if you can help, please.

    Regards,
    Dilip Samuel

  7. #7
    Registered User
    Join Date
    03-02-2007
    Posts
    6
    Quote Originally Posted by Carim
    Hi,

    See attached ...
    Thanks a million Carim but I have more than three colors and many other sizes so the permutation and combination needs to work for more than 3 colors too and more than two sizes

    Column A: WHITE, BLACK, RED
    Column B: A-B, C-D, QUEEN1, QUEEN2,
    Desired Output in Column C: WHITE/A-B, WHITE/ C-D, QUEEN1, QUEEN2, , BLACK, RED/A-B, BLACK, RED/ C-D, QUEEN1, QUEEN2,

    Misses some combinations.

    Any general formula?

    Regards
    Dilip Samuel

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Quite difficult for me to guess you are dealing with more colors and sizes ...
    Would recommend you establish a complete list of all possibilities and take a look at generic permutation code ...
    http://www.j-walk.com/ss/excel/tips/tip46.htm

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Please change the header title or this post will be deleted.

    Headers like

    Help
    Can this be done
    etc

    will be deleted on sight. You must have a header that relates to the question

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  10. #10
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    @ VBA Noob ...

    Totally agree ... have just modified it accordingly ...

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thx Carim

    VBA Noob

  12. #12
    Registered User
    Join Date
    03-02-2007
    Posts
    6
    Quote Originally Posted by avveerkar
    Just copy this function in standard module sheet so that this function is available to your worksheet. I am assuming that color and size values are separated by comma's as shown in your figure. I am also assuming that max number of colors and sizes you can have is 10 each ( else modify function to increase the number. Change declaration Dim Col(10) and Siz(10)

    Now in C2 if you enter formula "=ColSiz(A2,B2)" you will have the required result.
    I don't know where to copy this function, I'm very new to this. Is it in the Tools>Macro>Visual Basic Editor>Insert> Module?

    I have tried doing that but I didnt get any output.

  13. #13
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Quote Originally Posted by samneric
    I don't know where to copy this function, I'm very new to this. Is it in the Tools>Macro>Visual Basic Editor>Insert> Module?

    I have tried doing that but I didnt get any output.
    Easiest way for you to go there is open your workbook and then just record any macro. ( Start record macro, select any cell and then stop recording the macro) Then go to edit the macro you have just recorded. This wil open the module code sheet where EXCEL records the macro code. We don't need the macro you have recorded. We just need the code sheet. Delete the complete macro code and then paste our code on that sheet and you are ready to go.
    Remember this function is now available only to this workbook.
    If you want this function to be available to all workbooks ( old and the new ones you open ) then you need to copy this code to module sheet of Personal.xls or E_R.xla ( depending on which version of EXCEL you have.) Actually when you get to the module code sheet as I had suggested, the left side of the screen will have project explorer. Browsing the project explorer you wil be able to go to the desired code sheet. It has stucture just like Windows Explorer.

    I think my post was deleted because I had not wrapped the code. I am giving the code again
    Please Login or Register  to view this content.
    I have also attached the file for you. Just check it out.

    A V Veerkar
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    03-02-2007
    Posts
    6
    Quote Originally Posted by avveerkar
    I have also attached the file for you. Just check it out.

    A V Veerkar
    That thing worked for me!!! Everything done in a span of seconds!!!

    Thanks A V Veerkar!!! By the way where are you from?

  15. #15
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Quote Originally Posted by samneric
    That thing worked for me!!! Everything done in a span of seconds!!!

    Thanks A V Veerkar!!! By the way where are you from?
    You are most welcome.

    I am in Kolkata, Inda

    A V Veerkar

+ 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