ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Add cells from a range based on 2 conditions from 2 other ranges (https://www.excelbanter.com/excel-worksheet-functions/34290-add-cells-range-based-2-conditions-2-other-ranges.html)

Kelly

Add cells from a range based on 2 conditions from 2 other ranges
 
Hi,
I am trying to add cells from a column based on two conditions.
For example:
the chart below is on one worksheet and on another I am consolidating the
info.
What I want to see if how many types of Black there are with a forecast 0.
Answer should be 3, it should count the 4 without $ owned.
So the two conditions are "Black" and "0", then add the cells together that
meet those two conditions from the 2nd column.

Types $ owned
Black 3 1500
Black 4 0

Can anyone help?
Kelly



Hi

Try something like:
=SUMPRODUCT(--(A2:A50="Black")*(C2:C500),(B2:B50))

Hope this helps - or is a guide, at least!
Andy.

"Kelly" wrote in message
...
Hi,
I am trying to add cells from a column based on two conditions.
For example:
the chart below is on one worksheet and on another I am consolidating the
info.
What I want to see if how many types of Black there are with a forecast
0.

Answer should be 3, it should count the 4 without $ owned.
So the two conditions are "Black" and "0", then add the cells together
that
meet those two conditions from the 2nd column.

Types $ owned
Black 3 1500
Black 4 0

Can anyone help?
Kelly




Kelly

Thanks! Worked perfectly :)

"Andy" wrote:

Hi

Try something like:
=SUMPRODUCT(--(A2:A50="Black")*(C2:C500),(B2:B50))

Hope this helps - or is a guide, at least!
Andy.

"Kelly" wrote in message
...
Hi,
I am trying to add cells from a column based on two conditions.
For example:
the chart below is on one worksheet and on another I am consolidating the
info.
What I want to see if how many types of Black there are with a forecast
0.

Answer should be 3, it should count the 4 without $ owned.
So the two conditions are "Black" and "0", then add the cells together
that
meet those two conditions from the 2nd column.

Types $ owned
Black 3 1500
Black 4 0

Can anyone help?
Kelly






Thanks for the feedback!!

Andy.

"Kelly" wrote in message
...
Thanks! Worked perfectly :)

"Andy" wrote:

Hi

Try something like:
=SUMPRODUCT(--(A2:A50="Black")*(C2:C500),(B2:B50))

Hope this helps - or is a guide, at least!
Andy.

"Kelly" wrote in message
...
Hi,
I am trying to add cells from a column based on two conditions.
For example:
the chart below is on one worksheet and on another I am consolidating
the
info.
What I want to see if how many types of Black there are with a forecast
0.
Answer should be 3, it should count the 4 without $ owned.
So the two conditions are "Black" and "0", then add the cells together
that
meet those two conditions from the 2nd column.

Types $ owned
Black 3 1500
Black 4 0

Can anyone help?
Kelly








All times are GMT +1. The time now is 06:13 AM.

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