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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
So, now I'm trying to take the average of the numbers in the same setup, and I tried adapting your formula to the AVERAGEIFS function, but I'm getting the #VALUE ! error again :) which says "A value used in the formula is of the wrong data type":

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

I'm suspecting that the issue is caused by the initial range of the function "
Scores!$B$2:$I$5"
perhaps?

Thanks a lot!
[/FONT]
 
Upvote 0
Shouldn't that be
AVERAGEIFS(Scores!$B2:$I2,Scores!$B2:$I2
 
Upvote 0
Ah I see! :) I don't know why I was thinking the initial range refers to the entire range the formula will scan, so I was including the lower rows too.

That's it for now until I encounter other conditions :)

Thanks a lot!!!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

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