Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listing top three names which have the most blank values

I have two classes (ABC and XYZ) and some students which have taken test in these classes. However, due to personal reason, a few students couldn't take several of the exams. I want to find the top 3 amounts of test not taken and top 3 names of the students that haven't taken the most exams. Below is an illustration of what I'm trying to do:

Test Scores

In cell F3, I've written the following code to get the top 3 amount of test not taken:

=LARGE(COUNTIFS(C:C,"="&"",B:B,UNIQUE(FILTER(OFFSET($B$2,0,0,COUNTA(B:B)-1,1),OFFSET($A$2,0,0,COUNTA(A:A)-1,1)=$F$2))),ROWS(B$2:B2))

My goal is to now list the top 3 non test taker names. I've tried a variation of the above code but can't seem to make it work. I have excel version 2209 if this helps. Thank you in advanced!

like image 413
OscarV Avatar asked Dec 04 '25 01:12

OscarV


1 Answers

Try:

enter image description here

Formula in E2:

=LET(x,UNIQUE(FILTER(B:B,(A:A=F1)*(C:C=""))),SORTBY(x,MAP(x,LAMBDA(y,COUNTIFS(A:A,F1,B:B,y,C:C,""))),-1))

Or, for both names and count:

enter image description here

=LET(x,UNIQUE(FILTER(B:B,(A:A=F1)*(C:C=""))),SORT(HSTACK(x,MAP(x,LAMBDA(y,COUNTIFS(A:A,F1,B:B,y,C:C,"")))),2,-1))
like image 101
JvdV Avatar answered Dec 06 '25 21:12

JvdV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!