# sumproduct Formula help

#### irenesboy

##### Board Regular
This formula is in cell D4.
=SUMPRODUCT((B4="aro")+(B4="aru")+(B4="ov")+(B4="und")+(B4="pao")+(B4="pau")+(B4="aco")+(B4="acu"),F4+G4)
As long as B4 contains any of the above text it works fine.
if B4 has any other text but the above I get a 0 (zero).
F4 and G4 contain numbers.
I do not want the 0 (zero) in cell D4 if the text in cell B4 is not what the formula is looking for.
There is probably an easier way to write the formula but I am only a little more than a beginner in excel.
Thank you.
irenesboy

### Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

#### Lewiy

##### Well-known Member
Does this do what you need?:
Code:
`` =IF(OR(B4="aro",B4="aru",B4="ov",B4="und",B4="pao",B4="pau",B4="aco",B4="acu"),G4,"")``

#### ExcelChampion

##### Well-known Member
How's this:

=IF(ISNA(MATCH(TRUE,ISNUMBER(FIND({"aro","aru","ov","und","pao","pau","aco","acu"},B4)),0)),"",F4+G4)

Actually, Lewiy's can be simplified to:

=IF(OR(B4={"aro","aru","ov","und","pao","pau","aco","acu"}),G4+F4,"")

#### irenesboy

##### Board Regular
Thanks to Lewly and to XL Champ.
I choose to use Lewly formula because it is much easier for a novice like me to understand.
Again thanks to both of you for your help.
irenesboy

Replies
1
Views
382
Replies
3
Views
136
Replies
1
Views
216
Replies
3
Views
488
Replies
10
Views
2K

1,181,658
Messages
5,931,272
Members
436,786
Latest member
Deniel

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