How to add a condition to COUNTIFS formula to exclude certain numbers?

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
528
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a COUNTIFS formula [=COUNTIFS(B2:I2,"<70")] that calculates the number of times a score is less than 70, as follows:

Dates3/4/20193/11/20193/18/20193/25/20194/1/20194/8/20194/15/2019etc.
Student171687892799673etc.
Student256716875708177
Student379918989949092
etc.

<tbody>
</tbody>

How can I add a condition to the formula that allows to exclude scores that correspond to dates marked with an "X" within the "Calendar" sheet with the same organization as the above sheet, as follows:

Dates:3/4/20193/11/20193/18/20193/25/20194/1/20194/8/20194/15/2019etc.
XXX

<tbody>
</tbody>

Thanks for any input!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about
=COUNTIFS(B2:I2,"<70",Calendar!B2:I2,"<>x")
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
What if each student has their own "Calendar" sheet criteria such as below:

Dates:3/4/20193/11/20193/18/20193/25/20194/1/20194/8/20194/15/2019etc.
Student1XXX
Student2XX
Student3XX
etc.

<tbody>
</tbody>


Thanks a lot!:)
 
Upvote 0
How about
=COUNTIFS(B2:I2,"<70",INDEX(Calendar!$B$2:$I$4,MATCH(A2,Calendar!$A$2:$A$5,0),0),"<>x")
 
Upvote 0
Amazing!! Thanks a lot!!

I might have one more condition added based on the new score sheets I have received, so I'll post if I can't figure out myself :)
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
I'm trying to use your formula from the "Main" Sheet, and I made adjustments as follows, but I'm getting the #VALUE ! error:

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]=COUNTIFS(Scores!B2:G2,"<70",INDEX(Calendar!$B$2:$I$4,MATCH(Scores!A2,Calendar!$A$2:$A$5,0),0),"<>x")

Am I missing anything? Thanks a lot! :)

(The scores are in the "Scores" sheet)<strike>
</strike>
[/FONT]
 
Upvote 0
You're ranges are different sizes
=COUNTIFS(Scores!B2:G2,"<70",INDEX(Calendar!$B$2:$I$4,MATCH(Scores!A2,Calendar!$A$2:$A$5,0),0),"<>x")
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,184
Members
448,554
Latest member
Gleisner2

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