Excel Productivity Guide
Useful Excel Tips | Keyboard Shortcuts | VBA Codes
Download this Free E-Book to take your excel skills to a whole next level using some smart Excel tactics.
Worth $20, Absolutely Free
Two days back I wrote about how you can use OR logic in SUMIFS and SUMIF. And today, I want to show, that you can also use the same OR logic and multiple conditions in COUNIFS and COUNIF.
Even you can create dynamic criteria for OR logic in COUNIFS and COUNIF.
Have you ever faced a situation where you need to count more than one value from a single column or a range?
If yes, then using a COUNIFS or a COUNIF with an OR logic is the best solution to this problem.
Normally, if you go with COUNTIF you can just count cells by specifying a single condition and if you go with COUNIFS you can specify more than one condition but it uses AND logic to count values.
That means you can’t use these functions to count more than a value from a single column or a range.
So today, in this post you will learn a simple but power way to applying OR condition in COUNIFS and COUNIF.
Have a look at below data where you have a list of people and their favorite social media platform. Download this sample file from here to follow along.
Now, from this list of 50 people, you need to count how many people like “Facebook” and “Twitter”.
With both of the above formulas, you will get 25 in the result which is the count of both of the values (17+8).
As I mentioned earlier, COUNTIFS uses AND logic and on the other hand, in COUNIF you can only specify one value to count.
To understand the application of OR you need to split this formula into three parts.
Here I have explained this concept in COUNTIFS but the in COUNTIF formula will work in the same way.
Two days back, when I explained about using OR in SUMIF/SUMIFS, Shay asked me that how can he use dynamic values instead of using hardcore values in this formula.
And for this, you need to do just two little amendments in your formula.
So, now your formula will be:
Using an OR logic in COUNIF/COUNIFS can increase its power and save you for writing long formulas. And, using dynamic criteria is super awesome. You can change values anytime you want, without changing the formula.
I hope you found this formula tips useful and it will help to become more efficient in your work.
So, what you think about this one. Have you tried this anytime before this? Or have any other method to use instead.
Tell me in the comment section, I would love to hear from you.