# 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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

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

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,953
Messages
5,856,481
Members
431,817
Latest member
db74

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