Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

COUNTIF with multiple criteria

Can you please advise on how can I use COUNTIF with multiple conditions?

enter image description here

My proposal (left) shows the formula for one criterion (distinct regions).

However, I am interested in counting distinct regions for each distinct month (two criteria) - on the right: desired result.

like image 957
Sam Avatar asked Jun 20 '13 14:06

Sam


People also ask

Can I use Countif with multiple criteria?

Using COUNTIF with multiple criteria. The best function you can use for situations when you need to count cells based on multiple criteria is the COUNTIFS function. The “s” on the end of Countif makes it plural, and that means that there are multiple criteria.

Can you use Countif for 3 criteria?

#3 Count Cells with Multiple Criteria – Between Two DatesTo get a count of values between two values, we need to use multiple criteria in the COUNTIF function. We can do this using two methods – One single COUNTIFS function or two COUNTIF functions.

How many criterias you can add in Countifs formulas?

Additional ranges and their associated criteria. Up to 127 range/criteria pairs are allowed.

How do I combine two Countif?

If there are more than two criteria that you want to count in one column, just use =COUNTIF(range1, criteria1) + COUNTIF(range2, criteria2) + COUNTIF(range3, criteria3)+…


1 Answers

you can use COUNTIFS() instead

=1/COUNTIFS($A:$A,A2,$B:$B,B2)
like image 189
JosieP Avatar answered Sep 30 '22 12:09

JosieP