Help with Countifs with multiple criteria

trone77

Board Regular
Joined
Dec 28, 2009
Messages
152
Office Version
  1. 2019
Platform
  1. Windows
Wondering if there is a way to execute the formula below using countifs?


=countifs('[AY.xlsx]1998-2015'!$W$1:$W$8766,$M5)+countifs('[AY.xlsx]1998-2015'!$W$1:$W$8766,$N5),'[AY.xlsx]1998-2015'!$C$1:$C$8766,$Q5,'[AY.xlsx]1998-2015'!$X$1:$X$8766,$O5,'[AY.xlsx]1998-2015'!$Y$1:$Y$8766,U$3,'[AY.xlsx]1998-2015'!$Z$1:$Z$8766,$AH$2,'[AY.xlsx]1998-2015'!$AA$1:$AA$8766>=$AZ$2,'[AY.xlsx]1998-2015'!$AA$1:$AA$8766,$AZ$3))
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
The last bracket and the one after $N5 shouldn't be there, delete those and it should work.
 
Upvote 0
The last bracket and the one after $N5 shouldn't be there, delete those and it should work.

The last bracket and the one after $N5 shouldn't be there, delete those and it should work.

Thanks for the reply. However after removing the bracket after $N5 and the one at the end, there still returns the error too few arguments. Is there alternative formula without an array that would work?
 
Upvote 0
Not sure why you're seeing a 'too few arguments' error, there is a syntax error that I missed.

=countifs('[AY.xlsx]1998-2015'!$W$1:$W$8766,$M5)+countifs('[AY.xlsx]1998-2015'!$W$1:$W$8766,$N5,'[AY.xlsx]1998-2015'!$C$1:$C$8766,$Q5,'[AY.xlsx]1998-2015'!$X$1:$X$8766,$O5,'[AY.xlsx]1998-2015'!$Y$1:$Y$8766,U$3,'[AY.xlsx]1998-2015'!$Z$1:$Z$8766,$AH$2,'[AY.xlsx]1998-2015'!$AA$1:$AA$8766">="&$AZ$2,'[AY.xlsx]1998-2015'!$AA$1:$AA$8766,$AZ$3)

Some of the criteria look a bit dubious, as far as I can see the syntax is now correct, but whether or not the formula will give you the result that you want is something totally different.

I suspect that $AZ$3 at the end of the formula should actually be "<="&$AZ$3
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,034
Members
449,061
Latest member
TheRealJoaquin

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