COUNTIFS with multiple criteria, including "OR"

Wanderarzt

New Member
Joined
Apr 2, 2018
Messages
6
Dear all,

Could you please advise on how I can make this work?

I am using google sheets. The excel file is here: https://docs.google.com/spreadsheet...9dvpA_dBjk/pubhtml?gid=1919792096&single=true

I want to calculate a number of all the raws, where cells in A column are not empty (i.e., in my case - have date in them). But the second criteria is to calculate the number of only those rows with anything in column A, where column C or E also has something.

Working formula is COUNTIFS(A2:A1000, "<>", C2:C1000, "<>", E2:E1000, "")+COUNTIFS(A2:A1000, "<>", C2-C1000, "", E2:E1000, "<>")+COUNTIFS(A2:A1000, "<>", C2:C1000, "<>", E2-E1000, "<>")
This formula is bulky, however, and it is too much complicated when I need to employ more columns.

So I only want count any row once, if it meets at least one criteria. And not count it twice just because it has values in both row C and row E. Row A, however, is a must criteria and is above all.

I have found out that probably "SUM" or "SUMPRODUCT" is the key, but I failed to understand how it works.
How do I make it work, please?

Thank you!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to the Board.

Try:

=SUMPRODUCT(--(A2:A1000<>""),--((C2:C1000<>"")+(E2:E1000<>"")>0))
 
Upvote 0
Not magic, just Boolean algebra! :biggrin: The + is the equivalent of OR. Glad it works for you! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,800
Messages
6,181,046
Members
453,014
Latest member
Chris258

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