SUM IF Statement help

Special-K

Board Regular
Joined
Apr 18, 2006
Messages
63
I've got a statement that basically says:

(CELL AB6) ... my formula says that if either of these entries (HC, HL, HP, HE) are present in CELL A6 .... then take the value in CELL AA6 and divide it by the value in CELL F111.

My problem is: How do I get the value in AB6 to go blank/return to zero if the code that triggered it in CELL A5 is removed.

Here's the formula I have:
=SUM(SUMIF(A6,{"HC","HL","HP","HE"}),(AA6/F111))

CELL A6 ................ CELL AA6 ...............CELL AB6
HP ..........................4...............................2

(F111 = 2)

So, currently, if I remove "HP" ... the value in cell AB6 remains. And I need it to return to zero.

Thanks to all!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi,

was your formula really doing what you intended (except your zero-problem) ?

this would be my suggestion
=IF(ISNA(MATCH(A6,{"HC","HL","HP","HE"})),0,(AA6/F111))

kind regards,
Erik
 
Upvote 0
seems you didn't see Aladins formula

NOTE that my formula doesn't check if F111 is zero, while Aladin's formula does !
& I think ISNUMBER is faster then ISNA
so use Aladins formula

also you didn't need the brackets (you had in your formula which I copied)
=IF(ISNA(MATCH(A6,{"HC","HL","HP","HE"})),0,(AA6/F111))
this is enough
=IF(ISNA(MATCH(A6,{"HC","HL","HP","HE"})),0,AA6/F111)
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,952
Members
448,535
Latest member
alrossman

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