ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUMIF using a multiple-column range (https://www.excelbanter.com/excel-worksheet-functions/28663-sumif-using-multiple-column-range.html)

Stefan Wrobel

SUMIF using a multiple-column range
 
I have a very simple task and I don't get why SUMIF isn't doing what I expect
it to. Observe this set of data:

1 15 4
0 3 2
1 1 8

If I do SUMIF(A1:A3,"=1",B1:C3) then I just get 16, which is the result of
SUMIF(A1:A3,"=1",B1:C3), rather than 28, which is the sum of 15+4+1+8. I
realize that I could do SUMIF(A1:A3,"=1",B1:B3) + SUMIF(A1:A3,"=1",C1:C3),
but that just seems silly, since SUMIF takes in a Range, I don't get why it
doesn't actually sum over the range. And yes I have tried using
Ctrl+Shift+Enter when entering it, no help.

Domenic

Try...

=SUMPRODUCT((A1:A3=1)*B1:C3)

Hope this helps!

In article ,
"Stefan Wrobel" wrote:

I have a very simple task and I don't get why SUMIF isn't doing what I expect
it to. Observe this set of data:

1 15 4
0 3 2
1 1 8

If I do SUMIF(A1:A3,"=1",B1:C3) then I just get 16, which is the result of
SUMIF(A1:A3,"=1",B1:C3), rather than 28, which is the sum of 15+4+1+8. I
realize that I could do SUMIF(A1:A3,"=1",B1:B3) + SUMIF(A1:A3,"=1",C1:C3),
but that just seems silly, since SUMIF takes in a Range, I don't get why it
doesn't actually sum over the range. And yes I have tried using
Ctrl+Shift+Enter when entering it, no help.



All times are GMT +1. The time now is 01:14 AM.

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