ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sumproduct error (https://www.excelbanter.com/excel-programming/444314-sumproduct-error.html)

LUIS ANGEL

sumproduct error
 
Hi,

I cant seem to get this working. Farely simple I think. Im trying to
have sumproduct sum what corresponds to a specific number. Here is my
example:

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
2012 4
2013 5
2014 6
2015 7
2016 8
2017 9
2010 10
2011 11
2012 12
2013 13
2014 14
2015 15
2016 16
2017 17
2010 18
2011 19
2012 20
2013 21
2014 22
2015 23
2016 24
2017 25

joeu2004

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)


All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com