SFCChase
Board Regular
- Joined
- Jun 25, 2013
- Messages
- 114
- Office Version
- 2016
- Platform
- Windows
Is it possible to combine SUBTOTAL and COUNTIFS?
I have a data set that will change depending on filtering various columns. Currently I'm using the following formulas:
Cell E2: =COUNTIFS($B$5:$B$160, "<>",E5:E160,">="&TODAY())+COUNTIFS($B$5:$B$160, "<>",E5:E160,"N/A") Counts # of trainings that are not expired as of today
Cell E3: =COUNTIF($B$5:$B$160,"") Counts # of personnel assigned
Cell E4: =IF(E2=0,"",E2/E3) Calculates overall completion percentage (# of non-expired trainings/# of assigned personnel)
I would like the value of Cell H8 to change based on the # of assigned personnel shown when I filter Column A.
I have figured out a SUBTOTAL formula that will work for Cell E3 (=SUBTOTAL(3,$B$5:$B$160), but I can't figure out a SUBTOTAL for Cell E2 and therefore end up with % over 100% when I filter.
Given the data above....if I leave unfiltered:
E2=7
E3=9
E4=77.78%
If I filter Column A to only calculate "DCN" numbers I would like to result:
E2=1
E3=2
E4=50.00%
If I filter Column A to only calculate "MSU" numbers I would like to result:
E2=4
E3=5
E4=80.00%
Any suggestions would be appreciated!
I have a data set that will change depending on filtering various columns. Currently I'm using the following formulas:
Cell E2: =COUNTIFS($B$5:$B$160, "<>",E5:E160,">="&TODAY())+COUNTIFS($B$5:$B$160, "<>",E5:E160,"N/A") Counts # of trainings that are not expired as of today
Cell E3: =COUNTIF($B$5:$B$160,"") Counts # of personnel assigned
Cell E4: =IF(E2=0,"",E2/E3) Calculates overall completion percentage (# of non-expired trainings/# of assigned personnel)
I would like the value of Cell H8 to change based on the # of assigned personnel shown when I filter Column A.
I have figured out a SUBTOTAL formula that will work for Cell E3 (=SUBTOTAL(3,$B$5:$B$160), but I can't figure out a SUBTOTAL for Cell E2 and therefore end up with % over 100% when I filter.
TRAINING 1 | ||||
# TRAINED | ||||
# REQUIRED | ||||
UNIT | LAST | FIRST | % TRAINED | |
DCN | ADAMS | AARON | 5/20/25 | |
DCN | JONES | JOHN | 2/1/25 | |
IPSL | MICHAELS | MICHAEL | 5/20/25 | |
IPSL | JULES | JULIE | N/A | |
IPSL | ||||
MSU | SNUFFY | JOE | 3/25/25 | |
MSU | BAKER | BARNEY | 3/24/25 | |
MSU | LEWIS | LOU | 2/1/25 | |
MSU | JUAREZ | JUAN | N/A | |
MSU | SMITH | SAM | 3/21/25 | |
Given the data above....if I leave unfiltered:
E2=7
E3=9
E4=77.78%
If I filter Column A to only calculate "DCN" numbers I would like to result:
E2=1
E3=2
E4=50.00%
If I filter Column A to only calculate "MSU" numbers I would like to result:
E2=4
E3=5
E4=80.00%
Any suggestions would be appreciated!