ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SUMIF question (https://www.excelbanter.com/excel-worksheet-functions/14631-sumif-question.html)

CarlosAntenna

SUMIF question
 
I have a formula that attempts to use SUMIF to sum a range that includes two
columns.

=SUMIF(C3:C500,C3,D3:E500)

The result of this formula is the sum of column D only.
I had to break it down as follows:

=SUMIF(C3:C500,C3,D3:D500)+SUMIF(C3:C500,C3,E3:E50 0)

Is this normal behavior or is something wrong?

--Carlos



Peo Sjoblom

Yes it is normal behaviour, in SUMIF the corresponding sum range needs to be
of the same size, you can use

=SUMPRODUCT((C3:C500=C3)*(D3:E500))


--

Regards,

Peo Sjoblom



"CarlosAntenna" wrote in message
...
I have a formula that attempts to use SUMIF to sum a range that includes

two
columns.

=SUMIF(C3:C500,C3,D3:E500)

The result of this formula is the sum of column D only.
I had to break it down as follows:

=SUMIF(C3:C500,C3,D3:D500)+SUMIF(C3:C500,C3,E3:E50 0)

Is this normal behavior or is something wrong?

--Carlos





CarlosAntenna

Thanks Peo, I have never used SUMPRODDUCT before but there is always a first
time. This must be it.

-- Carlos

"Peo Sjoblom" wrote in message
...
Yes it is normal behaviour, in SUMIF the corresponding sum range needs to

be
of the same size, you can use

=SUMPRODUCT((C3:C500=C3)*(D3:E500))


--

Regards,

Peo Sjoblom



"CarlosAntenna" wrote in message
...
I have a formula that attempts to use SUMIF to sum a range that includes

two
columns.

=SUMIF(C3:C500,C3,D3:E500)

The result of this formula is the sum of column D only.
I had to break it down as follows:

=SUMIF(C3:C500,C3,D3:D500)+SUMIF(C3:C500,C3,E3:E50 0)

Is this normal behavior or is something wrong?

--Carlos








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

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