[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using Countifs on the same Column Multiple Times

Posted on 2013-01-16
4
Medium Priority
?
363 Views
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?
0
Comment
Question by:-Polak
[X]
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
  • 2
4 Comments
 
LVL 7

Expert Comment

by:leptonka
ID: 38785141
Hi,

I would use SUMPRODUCT with boolean-arrays, where multiplication corresponds AND and addition corresponds OR, so something like:
=SUMPRODUCT((P1:P10="A")*((O1:O10="B")+(O1:O10="C")+(O1:O10="D")))

in this part:
((O1:O10="B")+(O1:O10="C")+(O1:O10="D"))
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:
=SUMPRODUCT((P1:P10="A")*(((O1:O10="B")+(O1:O10="C")+(N1:N10="D"))>0))

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

Cheers,
Kris
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 38785143
Try this setup

=SUM(COUNTIFS(P:P,"A",O:O,{"B","C","D","E"}))

regards, barry
0
 
LVL 7

Expert Comment

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

Author Closing Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

649 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