select multiple ranges in formula

D

dschanak

I'm trying to select a bunch of ranges of data as a single argument in a
formula. I select the first range (ie, C2:C20), but when I select the second
range (ie, C24:C42), it automatically puts a comma, and the formula treats
this as the next argument. Is there a way to group all of the ranges I'm
selecting?

My specific task is =SUMIF( C2:C20,C24:C42 , D2 , E2:E20,E24:E42)

Thanks for the help.
 
D

Don Guillett

try
=SUMPRODUCT(SUMIF(INDIRECT({"C2:c20","c24:c42"}),D2,INDIRECT({"e2:e20","e24:e42"})))
 
Top