How to find the most frequent combination in a dataset.

winds

Board Regular
Joined
Mar 9, 2022
Messages
69
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Hello. I have a dataset that goes something like this

texttypechangecharactervaluereason
Alfredabad
Bettyacacgs
Charlievvvgd

The letters in the columns do not matter (it's actually numbers, I'm just altering the data for privacy purposes). But basically, I want to know in this data set, which is the most common combination. In this simple example, the highest combination can be taken from type, value and character where they occur three times. Second highest would be reason and change, and the least would be text.

The actual data set is much larger hence the need for some.. method.
 
What 2nd example?
Why would there be two frequency lines of 2?
If there are no headers with the frequency of 5 why would it be there?
How do you determine what goes in that Additional column?

You're posting in pieces. Please give a complete data sample reflective of your actual data and the expected output from that in one post.
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
What 2nd example?
Why would there be two frequency lines of 2?
If there are no headers with the frequency of 5 why would it be there?
How do you determine what goes in that Additional column?

You're posting in pieces. Please give a complete data sample reflective of your actual data and the expected output from that in one post.
My apologies. I made a bit amendment to the original data which was at end of page 1 of this thread
 

Attachments

  • 1000033776.jpg
    1000033776.jpg
    50.9 KB · Views: 4
Upvote 0
Is this what you mean?
I don't see how the a,c,v frequencies have to do with the frequency of the headers.

Book1
ABCDEFGHIJKLM
1texttypechangecharactervaluereason
2Alfredaaaa3type, character, value6c
3Bettycccccc2text, change, reason5v
4Charlievvvvv4a
5
6Count232332
7
Sheet11
Cell Formulas
RangeFormula
I2:I3I2=UNIQUE(LARGE($B$6#,SEQUENCE(COLUMNS(B1:G1))))
J2:J3J2=BYROW(IF(I2#=B6#,B1:G1,""),LAMBDA(r,TEXTJOIN(", ",TRUE,r)))
L2:M4L2=LET(a,UNIQUE(TOCOL(B2:G4,3)),b,BYROW(a,LAMBDA(r,COUNTIF(B2:G4,r))),SORTBY(HSTACK(b,a),b,-1))
B6:G6B6=BYCOL(B2:G4,LAMBDA(col,COUNTA(col)))
Dynamic array formulas.
 
Upvote 0
Y
Is this what you mean?
I don't see how the a,c,v frequencies have to do with the frequency of the headers.

Book1
ABCDEFGHIJKLM
1texttypechangecharactervaluereason
2Alfredaaaa3type, character, value6c
3Bettycccccc2text, change, reason5v
4Charlievvvvv4a
5
6Count232332
7
Sheet11
Cell Formulas
RangeFormula
I2:I3I2=UNIQUE(LARGE($B$6#,SEQUENCE(COLUMNS(B1:G1))))
J2:J3J2=BYROW(IF(I2#=B6#,B1:G1,""),LAMBDA(r,TEXTJOIN(", ",TRUE,r)))
L2:M4L2=LET(a,UNIQUE(TOCOL(B2:G4,3)),b,BYROW(a,LAMBDA(r,COUNTIF(B2:G4,r))),SORTBY(HSTACK(b,a),b,-1))
B6:G6B6=BYCOL(B2:G4,LAMBDA(col,COUNTA(col)))
Dynamic array formulas.
Yes something like that, but if it's possible so that it can figure out which one most frequent combination.

Example acv occus 3x, as well as cv occus 5x
 
Upvote 0
I don't think it's possible to do that with formulas and must use VBA instead. Secondly, the maximum unique value (a,b,c,v, etc...) you can have is 20 before it reaches the last row of Excel. I think you're understating the problem with your example. I don't think I can assist further here. Post your question in a new thread. Clearly show what you want and provide better sample data that reflects your actual data.
 
Upvote 0

Forum statistics

Threads
1,215,212
Messages
6,123,656
Members
449,114
Latest member
aides

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top