Count Unique for children who have not taken a test

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,174
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Good morning,
I have some data that has a number of tests on it that kids are allowed to take. The first problem is that kids can take any number of tests. The second problem is that the for each test that the kid is enrolled in, it will show a 1 for test taken and a 0 for test not taken. As long as a kid has a 1 then that means that a kid has taken a test. I need to count how many kids did not take a test. based on the school. This is the formula that I used if I know how many tests a child has taken =SUM(IF(FREQUENCY(IF(($B$2:$B$27=0)*($C$2:$C$27=$I2),$A$2:$A$27),$A$2:$A$26)=10,1)) but it obviously does not work because each child will take a different amount of tests.
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>ID</th><th>Test Taken</th><th>School</th></tr></thead><tbody>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>1</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>9999</td><td>0</td><td>xxxx</td></tr>
<tr><td>1111</td><td>0</td><td>yyyy</td></tr>
<tr><td>1111</td><td>0</td><td>yyyy</td></tr>
<tr><td>1111</td><td>0</td><td>yyyy</td></tr>
<tr><td>1111</td><td>0</td><td>yyyy</td></tr>
<tr><td>1111</td><td>0</td><td>yyyy</td></tr>
<tr><td>1111</td><td>0</td><td>yyyy</td></tr>
<tr><td>2222</td><td>0</td><td>yyyy</td></tr>
<tr><td>2222</td><td>1</td><td>yyyy</td></tr>
<tr><td>2222</td><td>0</td><td>yyyy</td></tr>
<tr><td>2222</td><td>0</td><td>yyyy</td></tr>
<tr><td>2222</td><td>1</td><td>yyyy</td></tr>
<tr><td>2222</td><td>1</td><td>yyyy</td></tr>
<tr><td>2222</td><td>0</td><td>yyyy</td></tr>
</tbody></table>

This is what I am looking for
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>ID</th><th>Test Taken</th></tr></thead><tbody>
<tr><td>xxxx</td><td>0</td></tr>
<tr><td>yyyy</td><td>1</td></tr>
<tr><td>zzzz</td><td>0</td></tr>
</tbody></table>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Maybe:

ABCDEF
1IDTest TakenSchoolSchool# students who have taken no tests
299990xxxxxxxx0
399990xxxxyyyy1
499990xxxx
599990xxxx
699991xxxx
799990xxxx
899990xxxx
999990xxxx
1099990xxxx
1199990xxxx
1211110yyyy
1311110yyyy
1411110yyyy
1511110yyyy
1611110yyyy
1711110yyyy
1822220yyyy
1922221yyyy
2022220yyyy
2122220yyyy
2222221yyyy
2322221yyyy
2422220yyyy
25

<tbody>
</tbody>
Sheet8

Array Formulas
CellFormula
E2{=IFERROR(INDEX($C$2:$C$30,MATCH(0,COUNTIF($C$2:$C$30,"<"&$C$2:$C$30)-SUM(COUNTIF($C$2:$C$30,F$1:F1)),0)),"")}
F2{=IF(E2="","",SUM(SIGN(FREQUENCY(IF($C$2:$C$30=E2,IF(COUNTIFS($A$2:$A$30,$A$2:$A$30,$B$2:$B$30,1,$C$2:$C$30,E2)=0,$A$2:$A$30)),$A$2:$A$30))))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



If you already have a list of schools, you can use that. Otherwise, the E2 formula creates a sorted unique list of the schools. The F2 formula counts how many students at each school have take no tests. This assumes the student ID is numeric, but it's easy enough to change if that's not true.
 
Last edited:
Upvote 0
Eric W! Amazing, I have been on this for days trying to figure it out. Thanks to you I am good!!! Appreciate all of your help and guidance. Thank you again!!!!!!!!!
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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