COUNTIFS with multiple and/or - how to replace

lukasz_rz

New Member
Joined
Oct 13, 2013
Messages
48
Hi Guys.

Here is what I'm dealing with now. I need to check if the row follows the multiple criteria:

[TABLE="width: 320"]
<tbody>[TR]
[TD]Status (column)[/TD]
[TD]Prio (column)[/TD]
[TD]Days (column)[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]3[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]4[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]4[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD][/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD][/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD][/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]f[/TD]
[TD][/TD]
[TD]7[/TD]
[/TR]
</tbody>[/TABLE]

To explain, the row should have:
status a, prio 1 and days 2,
or
status b, prio 1 and days 2
or... so on so on until the end of table.

I was able to use DCOUNTA formula to count the number of rows following that set of criteria, however what I need to achieve is to know for each row, if it follows the requirements or not. Anyone could help?

Thx in advance.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
however what I need to achieve is to know for each row, if it follows the requirements or not.

Hi, something like this?


Excel 2013/2016
ABCD
1StatusPrioDaysFollows ?
2a12Yes Follows
3b12Yes Follows
4a24Does not follow
5b24Does not follow
6a35Does not follow
7b35Does not follow
8a47Does not follow
9b47Does not follow
10c7Does not follow
11d7Does not follow
12e7Does not follow
13f7Does not follow
Sheet1
Cell Formulas
RangeFormula
D2=IF(AND(OR(A2={"a","b"}),B2=1,C2=2),"Yes Follows","Does not follow")
 
Upvote 0
I was not precise enough.
This is just a list of conditions that I need to meet in another worksheet, where I have a lot of data. From that other worksheet, I need to figure out for each row, if it follows one of the criteria that I had provided in the table (12 criteria). For each of that rows I need to know if:
- status=a & prio=1 & days=2
or
- status=b & prio=1 & days=2
or
- ... other 10 criteria from the table

if it follows at least one, I would like to mark it somehow.
 
Last edited:
Upvote 0
I I need to figure out for each row, if it follows one of the criteria that I had provided in the table (12 criteria)

Hi, something like this then..:

Important Note: for this to work, the blank cells in the criteria table need to contain the formula ="" (See B10 in example below)


Excel 2013/2016
ABCDEFGHI
1StatusPrioDaysStatusPrioDaysFollows
2a12a12Yes it follows
3b12z13No it does not
4a24c7Yes it follows
5b24b24Yes it follows
6a35b25No it does not
7b35b35Yes it follows
8a47c35No it does not
9b47e27No it does not
10c 7e7Yes it follows
11d7
12e7
13f7
Sheet1
Cell Formulas
RangeFormula
I2=IF(SUMPRODUCT(COUNTIFS(F2,$A$2:$A$13,G2,$B$2:$B$13,H2,$C$2:$C$13)),"Yes it follows","No it does not")
B10=""
 
Last edited:
Upvote 0
Yes! That is exactly what I needed! I was thinking of using SUMPRODUCT, but I was not sure how to do that.

One remark: I could not use ="" for prio, as this must be from 1 to 4, so I just replaced it with >0.

Thanks!!!!
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,206
Members
453,022
Latest member
RobertV1609

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