ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   is there anyway to use sumif using 2 criteria (https://www.excelbanter.com/excel-worksheet-functions/106552-there-anyway-use-sumif-using-2-criteria.html)

Steve 51

is there anyway to use sumif using 2 criteria
 
I am trying to sum the values in a column based on data in two other columns
of the same row meeting specific criteria.

I have data in A2:A10, C2:C10 and E2:E10 and I only want to sum the values
in A2:A10 if spedified, different criteria is met in BOTH C2:C10 and E2:E10.

Toppers

is there anyway to use sumif using 2 criteria
 
Use SUMPRODUCT

=SUMPRODUCT--(C2:C10=condition1),--(E2:E10=condition2),A2:A10)

HTH

"Steve 51" wrote:

I am trying to sum the values in a column based on data in two other columns
of the same row meeting specific criteria.

I have data in A2:A10, C2:C10 and E2:E10 and I only want to sum the values
in A2:A10 if spedified, different criteria is met in BOTH C2:C10 and E2:E10.


Steve 51

is there anyway to use sumif using 2 criteria
 
This appears to work. However, I do not understand why it is necessary to put
-- before the conditions.

"Toppers" wrote:

Use SUMPRODUCT

=SUMPRODUCT--(C2:C10=condition1),--(E2:E10=condition2),A2:A10)

HTH

"Steve 51" wrote:

I am trying to sum the values in a column based on data in two other columns
of the same row meeting specific criteria.

I have data in A2:A10, C2:C10 and E2:E10 and I only want to sum the values
in A2:A10 if spedified, different criteria is met in BOTH C2:C10 and E2:E10.


Toppers

is there anyway to use sumif using 2 criteria
 
this (--) converts True/False conditions to 1/0 so you can do calculations.
If, using your example, you have C1=True, E1=True and A1=20 then SUMPRODUCT
calculates 1*1*20 =20. If C1 was False then 0*1*20=0

Look here for a full explanation of SUMPRODUCT:


http://www.xldynamic.com/source/xld.SUMPRODUCT.html

HTH


"Steve 51" wrote:

This appears to work. However, I do not understand why it is necessary to put
-- before the conditions.

"Toppers" wrote:

Use SUMPRODUCT

=SUMPRODUCT--(C2:C10=condition1),--(E2:E10=condition2),A2:A10)

HTH

"Steve 51" wrote:

I am trying to sum the values in a column based on data in two other columns
of the same row meeting specific criteria.

I have data in A2:A10, C2:C10 and E2:E10 and I only want to sum the values
in A2:A10 if spedified, different criteria is met in BOTH C2:C10 and E2:E10.


Steve 51

is there anyway to use sumif using 2 criteria
 
Thanks a lot. The formula worked and your explanation was very helpful in
understanding how the functions works.

"Toppers" wrote:

this (--) converts True/False conditions to 1/0 so you can do calculations.
If, using your example, you have C1=True, E1=True and A1=20 then SUMPRODUCT
calculates 1*1*20 =20. If C1 was False then 0*1*20=0

Look here for a full explanation of SUMPRODUCT:


http://www.xldynamic.com/source/xld.SUMPRODUCT.html

HTH


"Steve 51" wrote:

This appears to work. However, I do not understand why it is necessary to put
-- before the conditions.

"Toppers" wrote:

Use SUMPRODUCT

=SUMPRODUCT--(C2:C10=condition1),--(E2:E10=condition2),A2:A10)

HTH

"Steve 51" wrote:

I am trying to sum the values in a column based on data in two other columns
of the same row meeting specific criteria.

I have data in A2:A10, C2:C10 and E2:E10 and I only want to sum the values
in A2:A10 if spedified, different criteria is met in BOTH C2:C10 and E2:E10.



All times are GMT +1. The time now is 12:30 PM.

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