View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default sumproduct error

On Mar 7, 10:01*am, LUIS ANGEL wrote:
Im getting a #VALUE error. Any thoughts?
In this example the C cell should give the sum of all 2010's (=30)
A * * * * * * * *B * * * * * * C
2010 * *2 * * * * * *=SUMPRODUCT(--($A$1:$B$24="2010"),$B$1:$B$24)
2011 * *3


First, the formula should be at least:

=SUMPRODUCT(--($A$1:$A$24="2010"),$B$1:$B$24)

Note the change in the first range.

Second, if A1:A24 contains numbers (most likely), the formula should
be:

=SUMPRODUCT(--($A$1:$A$24=2010),$B$1:$B$24)

Note: no quotes around 2010.

Finally, you can use SUMIF in this case, and it would be better to do
so. To wit:

=SUMIF($A$1:$A$24,2010,$B$1:$B$24)