# Help with Countifs with multiple criteria

#### trone77

##### Board Regular
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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

#### jasonb75

##### Well-known Member
The last bracket and the one after \$N5 shouldn't be there, delete those and it should work.

#### trone77

##### Board Regular
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?

#### jasonb75

##### Well-known Member
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

Replies
2
Views
150
Replies
3
Views
91
Replies
0
Views
79
Replies
4
Views
141
Replies
1
Views
55

1,128,138
Messages
5,628,919
Members
416,353
Latest member
Nenza

### 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.

### Which adblocker are you using?

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

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