Or Function vs (Condition a+ Logical b)

aes89

New Member
Joined
Aug 4, 2011
Messages
40
Hello,

I want to achieve a criterion whereby the row/record is counted if Condition A is met and (any of condition 2 and 3 is met). Was just wondering why the below two formulas are not the same? I checked my answer with a pivot table and it gives me the same answer as formula 1)

Range A and B are of the same size
Condition 1 = Range A = X
Condition 2 = Range B = Y
Condition 3 = Range B = ""

1) =Sum(If((Condition 1)*(Condition 2 + Condition 3)=1,1,0)) entered as an array

2) =Sum(If((Condition 1)*Or(Condition 2,Condition 3)=1,1,0)) entered as an array

Thanks guys!
 
Last edited:

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The proper syntax should be

=Sum(If((Condition 1)*((Condition 2) + (Condition 3)>0),1,0))

doing it like
(Condition 2 + Condition 3)=1
Will fail if both conditions are true, 1+1=2
 
Upvote 0
Hi

Also:


=Sum((Condition 1)*((Condition 2) + (Condition 3)>0))

confirmed with CSE, or

=SumProduct((Condition 1)*((Condition 2) + (Condition 3)>0))

confirmed with Enter
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

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