+ Reply to Thread
Results 1 to 8 of 8

analyzing existing combinations

  1. #1
    Registered User
    Join Date
    09-12-2020
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    10

    analyzing existing combinations

    Hi, I have a set of transactional data where I want to list all existing combinations and then analyze those combinations in different ways. I've found some things on how to list/count every possible combination but in my case that would not be useful. The number of possible combinations of my data is huge while the number of actual combinations is relatively small. The attached excel file gives an example of how this might work. Imagine there are dozens of classes but only some are being taught and, as the output shows, there are only three actual combinations. An additional complication to this data set is that combinations can include any number of variables. So, in my example a student may be taking one, two, or three classes. I need a solution to be flexible enough to account for any number of classes taken. Thanks in advance for your help.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-02-2020
    Location
    Paris, France
    MS-Off Ver
    Professional Plus 2013
    Posts
    41

    Re: analyzing existing combinations

    Hi Essen,

    I don't know how excel can list all possible distributions of your course values.
    It's computation, so I presume some script in vba can do the trick.
    Pivot table can offer some help and the best I could do is this.
    Attachment 702365

    Probably not enough since it won't consolidate the students with the same course options.

  3. #3
    Registered User
    Join Date
    09-12-2020
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    10

    Re: analyzing existing combinations

    Hi Exl-Noob,

    Just to be clear I am not trying to list all possible combinations. I'm only looking to list the actually occurring combinations that can be found in my data. Let's call these the "course builds" in my pretend example. I had trouble downloading your attachment. It doesn't seem to be there. I don't know anything about VBA but I'd be willing to learn if that's the only path to a solution.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,588

    Re: analyzing existing combinations

    This proposal employs custom sorting and two helper columns (which may be moved and/or hidden for aesthetic purposes) as modeled on Sheet2.
    1. Sort the data by name and then course.
    2. Helper column D is populated using: =IF(A4<>A3,B4,D3&","&B4)
    3. Helper column E is populated using: =IF(A4<>A5,D4,INDEX(D$4:D$12,AGGREGATE(14,6,(ROW(D$4:D$12)-ROW(D$3))/(A$4:A$12=A4),1)))
    4. The Course Build column is populated using: =IFERROR(INDEX(E$4:E$12,MATCH(0,INDEX(COUNTIF(G$3:G3,E$4:E$12),,),)),"")
    5. The # Students column is populated using: =IF(G4="","",COUNTIFS(E$4:E$12,G4)/(LEN(G4)-LEN(SUBSTITUTE(G4,",",""))+1))
    6. The Collective GPA column is populated using: =IF(G4="","",SUMIFS(C$4:C$12,E$4:E$12,G4)/(H4*(LEN(G4)-LEN(SUBSTITUTE(G4,",",""))+1)))
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    09-12-2020
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    10

    Re: analyzing existing combinations

    Hi JeteMc

    Thanks for looking into this. Unfortunately this doesn't quite capture what I need, although it's close. It seems that your solution works with the columns as they are organized in my example with the names appearing in that specific order. However, when I put the names out of order the results are no longer correct. I probably should have made a better example file, sorry. The solution needs to be such that the names can occur randomly in any order and still yield the same result.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,588

    Re: analyzing existing combinations

    Your file had the names out of order on Sheet 1 so the example was fine. I used custom sort (Home tab > Sort & Filter > 3rd option) to produce A4:B12. I am just thinking that you could use the same method on your actual data.
    As modeled on Sheet 1 of the attached copy of the file, the same sorting could be accomplished using the following:
    1. To rank the name/course combinations in alphabetical order: =SUMPRODUCT(--(A$4:A$12&B$4:B$12<=A4&B4))
    2. To display the names, courses and grades: =INDEX(A$4:A$12,MATCH(ROWS(A$1:A1),$D$4:$D$12,0))
    After the names, courses and grades are sorted the formulas from post #4 are used to produce the desired outcomes as displayed on Sheet 2.
    Let us know if you have any questions.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-12-2020
    Location
    U.S.
    MS-Off Ver
    2013
    Posts
    10

    Re: analyzing existing combinations

    Now I understand where you're going with this. That is a really clever solution, JeteMc, and it appears to have worked. One difference that cut down on the calculating time - to build the final schedule I just copied/pasted the second to last build column and ran "remove duplicates." It seems to have produced identical results. Thank you very much for your help! I will mark this solved.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,588

    Re: analyzing existing combinations

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Analyzing daa using VBA
    By spiderbladex in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2016, 04:10 PM
  2. [SOLVED] Analyzing #N/A in the output
    By macrolearnerkk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-02-2015, 10:30 AM
  3. Analyzing Data
    By wildwestarena in forum Excel General
    Replies: 28
    Last Post: 05-11-2015, 08:17 PM
  4. Finding possible combinations & listing the wanted combinations
    By Zoke in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 07-16-2012, 03:41 PM
  5. Data analyzing
    By NTB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2010, 12:06 AM
  6. Analyzing values
    By maheshg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2010, 11:58 PM
  7. Excel 2007 : analyzing xy coordinates
    By someguy85 in forum Excel General
    Replies: 0
    Last Post: 01-21-2010, 05:15 PM

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