View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default SUM and IF statements

You've got your test criteria mixed up:

Instead of this:
=SUM(IF($G$2:$G$839,IF($G$2:$G$83<-9,I2:I83)))

Try this:
=SUM(IF($G$2:$G$83-9,IF($G$2:$G$83<9,I2:I83)))
Note: that is an array formula, so commit it with [ctrl]+[shift]+[enter]

OR
You might conisider using SUMPRODUCT, instead. :
(Just [enter].....not [ctrl]+[shift]+[enter])
=SUMPRODUCT(($G$2:$G$839)*($G$2:$G$83<-9)*I2:I83)

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"bob" wrote:

Column G, rows 2-83 have numbers ranging from -30 to +30.
Column I has a list of numbers I want to add when the values in Column G are
greater than 9 or less than -9.

I have tried this but do not get the correct result:

=SUM(IF($G$2:$G$839,IF($G$2:$G$83<-9,I2:I83)))

Can anyone help?
Thanks,
Bob