Creating list of all instances where sum of occurrences is greater than a certain number.

Skrej

Board Regular
Joined
May 31, 2013
Messages
159
Office Version
  1. 365
Platform
  1. Windows
I have an attendance sheet where instructors enter various codes from a drop down list. One of the codes is "A" for an absence.


Sheet is set up with class roster starting in C2, with Cols D-V being the daily attendance columns (sheet is for a month at a time). Col headers D-V contain the dates.

What I'd like to do is have the sheet automatically list all names who have five or more absences, along with the total number of absences for that student somewhere at the bottom, say starting in C30.

Here's what I have so far, planning to copy it down the respective number of rows starting in about C30.


However, it's not indexing the names, instead just leaving a blank.
=IFERROR(INDEX($C$2:$C$25,SMALL(IF($D$2:$J$2=(IF(COUNTIF(D2:J2,"a")>4,COUNTIF(D2:J2,"a"),"")),ROW($D$2:$D$12)),ROW(1:1))-1,1),"")

I'd appreciate if somebody could either point me in the right direction, or suggest a better way of doing it. Rather than listing all names and a total of absences, I'd ideally only like it to list those with five or more absences. Anyone names with less than five won't appear on the list.

As mentioned, names start in C2 running down to C25, with attendance codes in Col D-V.
 
Try
Excel Formula:
=LET(b,BYROW(D8:V25,LAMBDA(br,SUM(--(left(br)="T")))),FILTER(HSTACK(C8:C25,b),b>=5))
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Thank you, once again. Much appreciated.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,028
Members
449,092
Latest member
ikke

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