Adding countifs incorrectly

mtaylor

Board Regular
Joined
May 1, 2013
Messages
73
Platform
  1. Windows
  2. MacOS
Hi there,

I am completing data analysis for the school and one of the subjects is still using letters to record grades (A* - E)

I have several countifs in a formula which counts a certain letter based upon the class the student is in.

Here is what I currently have:

=(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"C"))+(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"B"))+(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"A"))+(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"A*"))+(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"D"))

Column C is the class hence looking up 10-A
Column CX is the Term 3 Grade which I'm counting from. It would appear all is correct, however I end up with more students than are actually in the class.

If any more info is required, please let me know - thank you

Matt
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
The problem is here
(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"A*"))

The * character is a wildcard so it will be counting "A" as well as "A*" (it will count anything that starts with "A")

You can either use your existing formula and remove the section that only counts "A" so that the "A*" part counts both, or change the criteria in the "A*" section to "A~*" so that it looks for the * character instead of treating it as a wildcard.
 
Upvote 0
Solution
The problem is here
(COUNTIFS('Grade 10'!$C$3:$C$100,"10-A",'Grade 10'!$CX$3:$CX$100,"A*"))

The * character is a wildcard so it will be counting "A" as well as "A*" (it will count anything that starts with "A")

You can either use your existing formula and remove the section that only counts "A" so that the "A*" part counts both, or change the criteria in the "A*" section to "A~*" so that it looks for the * character instead of treating it as a wildcard.
Hero - many thanks
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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