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

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
Joined
Jan 5, 2007
Messages
4,284
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
Joined
Aug 12, 2005
Messages
976
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
Joined
May 28, 2004
Messages
90
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
 

Forum statistics

Threads
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.
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
Top