Combining Countifs with 3 or more criteria

Rameses

Board Regular
Joined
Mar 3, 2010
Messages
137
Hi there

I wish to combine the following COUNTIFS together but am becoming stuck and stuckier.. as I cant seem to get past the first 2 COUNTIFS

Essentially (C2:C47,"Y") is the most important

Column C 1st must be a Y to continue with COUNTIFS which are meant to be adding the number of times "N" or "-1" or "-2" or "-3" or "-4" appear in column W

The formula I have attempted is as below

(C2:C47,"Y",W2:W47,"N",0,W2:W47,"-4>0")

any comments will be much appreciated

many thanks

Rameses :)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I don't think countifs can work with an AND / OR scenario, you would need a formula for each possible result in W, not 1 to cover all.

The following array formula does what you're asking,
=SUM((C2:C47="Y")*(W2:W47={"N",-1,-2,-3,-4}))

copy / paste the formula then enter it with shift + ctrl + enter.
 
Upvote 0
Re: `Editing an Array Formula

Thank you so much

The last formula worked really well

However I forgot to add soem extra conditions to column C

I am looking for the array to be based on if any of the following conditions in column C a "Y", "P", "S", "A" are met

many thaks once again
all comments are appreciated

Rameses
 
Upvote 0
Re: `Editing an Array Formula

I'm sure one of the MVP's will have a solution to this but I don't think it can be done as a single formula, I've tried various ways of entering multiple arrays in a single cell, all of which produce either an error or an incorrect result.

The only solution I have so far is to use a helper column

Enter the formula =OR(C2={"Y","P","S","A"})*OR(W2={"N",-1,-2,-3,-4}) into say Z2 and copy it down to Z47 (this column could be hidden after)
then =SUM(Z2:Z47) would give the correct result for your criteria.

Both are regular fomulae and do not need to be entered with shift / ctrl / enter.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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