View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default IF statement on a range of cells in Excel 2007

Perhaps you forgot to enter it as an array formula?

Also, you can lose some of the parentheses.
=SUM(IF(G17:G31="Y",$C17:$C31*80,0)) as an array formula will do.
--
David Biddulph


Harix wrote:
Hi,

I'm trying to put up this formula:

=SUM(IF((G17:G31="Y"),($C17:$C31*80),0))

so that it multiplies with 80 and then sums all those values C17
through C31 for which values of G17 through G31 are Y.

But this gives me a value error in excel. When I remove the range and
enter a single cell, it works fine. I'm not sure what I'm doing wrong
here.