Sumif on multiple ranges

baindes

Board Regular
Joined
Dec 5, 2005
Messages
183
Hello,

I have this formula which works fine: IF(F90>0,F90/SUMIF($F$90:$F$96,">0"),"-") However I am now trying to use the same formula but in a non-contiguous range. I want: IF(F90>0,F90/SUMIF($F$50,$F11,$F$190,$F$200,">0"),"-"). This formula will not work because it is not a range. I also tried sumproduct but maybe I am doing something wrong.

Thank you for any suggestions.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Not recommended for large numbers of cells but for 4......

=IF(F90>0,F90/(($F$50>0)+($F11>0)+($F$190>0)+($F$200>0)),"-")
 
Upvote 0
Yes, that is a problem as I will have a range with over 15 cells. Is there another way?

Thank you~
 
Upvote 0
Perhaps a little simpler, then.....

=IF(F90>0,F90/SUM(SUMIF(INDIRECT({"F50","F11","F190","F200"}),">0")),"-")

.....edit: and that original version wouldn't do quite as you wanted anyway - it counts the >0 values rather than summing them, this one will sum as required...thanks to Marcelo Branco for pointing that out.

Note: I assume you have some negative values in those cells, if there are just zeroes and positives you can just sum them......
 
Last edited:
Upvote 0
Perhaps a little simpler, then.....

=IF(F90>0,F90/SUM(SUMIF(INDIRECT({"F50","F11","F190","F200"}),">0")),"-")

.....edit: and that original version wouldn't do quite as you wanted anyway - it counts the >0 values rather than summing them, this one will sum as required...thanks to Marcelo Branco for pointing that out.

Note: I assume you have some negative values in those cells, if there are just zeroes and positives you can just sum them......

My pleasure.

M.
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,451
Members
452,915
Latest member
hannnahheileen

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