# Sumproduct question

#### bab01824

##### Board Regular
I use sumproduct often in the form;

Code:
``SUMPRODUCT((RESULT="Y")*(MODULE="Fax")*(BETA="Y))``
, where RESULT, MODULE and BETA are column ranges and I am looking for a count where all three criteria are met.

But now I have to count incidences where the RESULT could be "Y" OR "B" in addition to the other criteria. Other than a long formula like;

Code:
``SUMPRODUCT((RESULT="Y")*(MODULE="Fax")*(BETA="Y))+SUMPRODUCT((RESULT="B")*(MODULE="Fax")*(BETA="Y))``

is there a simpler way?

bb

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

#### Zack Barresse

##### MrExcel MVP

=SUMPRODUCT(or((RESULT="Y"),(RESULT="B"))*(MODULE="Fax")*(BETA="Y))

#### Joe4

Try this:

=SUMPRODUCT((RESULT={"Y","B"})*(MODULE="Fax")*(BETA="Y"))

##### MrExcel MVP
Three options: In order of flexibilty and speed...

=SUMPRODUCT(--ISNUMBER(MATCH(RESULT,{"Y","B"},0)),--(MODULE="Fax"),--(BETA="Y"))

=SUMPRODUCT(((RESULT="Y")+(RESULT="B")),--(MODULE="Fax"),--(BETA="Y"))

=SUMPRODUCT((RESULT={"Y","B"})*(MODULE="Fax")*(BETA="Y"))

##### MrExcel MVP
firefytr said:

=SUMPRODUCT(or((RESULT="Y"),(RESULT="B"))*(MODULE="Fax")*(BETA="Y))

OR computes a scalar value, not an array, hence it won't work.

#### Zack Barresse

##### MrExcel MVP

i got to looking at that, and now see my folly. sorry bout the mis-post. fingers ahead of the mind

thank you for the correction!

i apologize bruce, didn't mean to screw up your post.

#### bab01824

##### Board Regular
I had tried the OR and it didn't work. The { } solution worked,

Thanks as always.

bb

##### MrExcel MVP
bab01824 said:
... The { } solution worked...

That's not too specific, is it?

Replies
2
Views
182
Replies
4
Views
702
Replies
7
Views
142
Replies
0
Views
41
Replies
0
Views
100

1,171,538
Messages
5,876,094
Members
433,175
Latest member
hp109

### 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.

### Which adblocker are you using?

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

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