sumproduct Formula help

irenesboy

Board Regular
Joined
May 28, 2004
Messages
90
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.
If there is an easier way to do what I am trying to do please help.
Thank you.
irenesboy
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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,"")
 
Upvote 0
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,"")
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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