Countifs with Multiple Criteria

GMC The Macro Man

Board Regular
Joined
Mar 23, 2023
Messages
104
Office Version
  1. 2021
Platform
  1. Windows
Hi everyone, can someone help with this query
On the attached sheet, I need to calculate for each pupil, how many exams they are sitting for each Nat Level, and how many are they "Predicted" to pass at that level.
Columns M, O and Q counts the number for each of the Nat Levels in the range D2:J2 using this formula
M2=COUNTIFS($D$2:$J$2,"Nat 4")
O2=COUNTIFS($D$2:$J$2,"Nat 5")
Q2=COUNTIFS($D$2:$J$2,"Nat 6")

The next part is where I am stuck.
In columns N, P and R, how would I calculate the number of "Predicted" passes for each NAT Level by pupil (1 to 6 are pass, 7 to 9 are fail). I've manually entered the values her taken from columns F, I and L

A quick reference to the column names
A&D = Art & Design
BIO = Biology
BUS=Business
Nat Level = National Level grade at which a pupil will sit an exam at the end of year, according to their age, year group, knowledge.
Target = An agreed score at which the pupil should achieve in the exam
Predicted = Based the pupils daily work, this is the predicted score that they will achieve (1 to 6 are pass, 7 to 9 are fail)
Count NAT 4 = Counts the number of exams the pupil sat in the 3 subjects that equal to Nat 4. (the same for Nat 5 and then Nat 6)
Count of Pass = Counts the number of passes (1 to 6) from the predicted columns (F, I and L) - (the same for Nat 5 and then Nat 6)

The table is just a small excerpt from the main workbook where there are 26 subjects and over 400 pupils so any help would be great

TIA
GMC

Book1
ABCDEFGHIJKLMNOPQRS
1Full NameYear GroupReg ClassA&D Nat LevelA&D TargetA&D PredictedBio Nat LevelBio TargetBio PredictedBus Nat LevelBus TargetBus PredictedCount NAT 4Count of PASSCount NAT 5Count of PASSCount NAT 6Count of PASS
2Abbie RunningS44ANat 556Nat 644Nat 568002111
3Aiden GallS44ANat 455Nat 544Nat 667111110
4Aiden John KearneyS44ANat 455Nat 447Nat 666210011
5Alana CallaghanS44ANat 557Nat 548Nat 466112000
Sheet1
Cell Formulas
RangeFormula
N2:N5N2=COUNTIFS($D2:$J2,"Nat 4")
P2:P5P2=COUNTIFS($D2:$J2,"Nat 5")
R2:R5R2=COUNTIFS($D2:$J2,"Nat 6")
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try new, "universal" version of N2 (assuming there is always 3letters, space and single digit in designation) :
Excel Formula:
=COUNTIF($D2:$J2,RIGHT(N$1,5))
(but of course you can keep the "manually edited formula")
and in O2:
Excel Formula:
=COUNTIFS($D2:$J2,RIGHT(N$1,5),$F$1:$L$1,"* Predicted",$F2:$L2,"<7")
If you have both new,
Now copy this pair of formulas to columns on roght (P&Q then R & S)
if only second one - copy to Q2 and S2

and now copy all 6 formulas down.
 
Upvote 0
Solution
Try new, "universal" version of N2 (assuming there is always 3letters, space and single digit in designation) :
Excel Formula:
=COUNTIF($D2:$J2,RIGHT(N$1,5))
(but of course you can keep the "manually edited formula")
and in O2:
Excel Formula:
=COUNTIFS($D2:$J2,RIGHT(N$1,5),$F$1:$L$1,"* Predicted",$F2:$L2,"<7")
If you have both new,
Now copy this pair of formulas to columns on roght (P&Q then R & S)
if only second one - copy to Q2 and S2

and now copy all 6 formulas down.
Hey Kaper

Thank you so much for this formula, I have tried it on the main workbook and it works perfectly. (Of course it would) 😂. Thanks again
 
Upvote 0
Thanks for feedback, kind words and for marking answer as a solution.
(y)
 
Upvote 0

Forum statistics

Threads
1,223,869
Messages
6,175,087
Members
452,611
Latest member
bls2024

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