Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Using Countifs on the same Column Multiple Times

Posted on 2013-01-16
Last Modified: 2013-01-17
Is it possible to use Countifs in this way:

I would like to count X if A is true and B is true or C is true or D is true or E is true .
B, C, D, and/or E are all in Column O. A is in column P

So essentially I'm looking for a way to make the formula work with:

Countifs(P:P, "variable A", AND O:O, "variable B", OR O:O "variable C", OR O:O, "variable D") etc....

If not, what can I use to accomplish?
Question by:-Polak
  • 2

Expert Comment

ID: 38785141

I would use SUMPRODUCT with boolean-arrays, where multiplication corresponds AND and addition corresponds OR, so something like:

in this part:
you use the same column, so it is not possible that two or more part is true at the same time. If it is not the case, you need to use an additional checking:

Anyway, would be great to see the original problem to write the correct boolean-tests.

LVL 50

Accepted Solution

barry houdini earned 500 total points
ID: 38785143
Try this setup


regards, barry

Expert Comment

ID: 38785167
wow, that is great barry! I did not know it could work this way with array.

Author Closing Comment

ID: 38787551
Beautiful, I'm glad we could all learn something here today.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question