SumIf with discontinuous cells?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use the SumIF (and SumProduct) on a collection of summary row cells
that have sub-component data between them and are therefore discontinuous. A
comma is used to separate these values in the formula, but a comma is also
used to separate the three components of the SumIf formula syntax....so it is
not working. I tried putting extra parens around the range data, but still
doesn't work. Any ideas?
 
I tried something like...

=SumIf(a5,a10,a15,a20,">0",b5,b10,b15,b20)

and...

=SumIf((a5,a10,a15,a20),">0",(b5,b10,b15,b20))

added complicating factor...I can't use a 'name the ranges' approach here
(longer story)
 
Here's something to try:

=IF(AND(A5>0,A10>0,A15>0,A20>0),SUM(A5,A10,A15,A20,B5,B10,B15,B20),"")

Dave
 
RBee,

=SUMPRODUCT((MOD(ROW(A1:A100),5)=0)*(A1:A100>0)*B1:B100)

HTH,
Bernie
MS Excel MVP
 
thanks!....two questions:
-wouldn't that add all cells in A & B if condition is met?
-more importantly, that would add ALL values when ALL rows are > 0, what I
want to do is to add ONLY those rows in B when the corresponding row in A is
 
Back
Top