ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sumif based on value in cell (https://www.excelbanter.com/excel-worksheet-functions/228586-sumif-based-value-cell.html)

Jane

Sumif based on value in cell
 
I am trying to add values in one column, if the second column matches the
criteria. This is what I have written and I know this is wrong. Can anyone
please help.

SUMIF(B:B,"<=AC10 and =AD10",C:C)

Thank you

Fred Smith[_4_]

Sumif based on value in cell
 
Your problem is you are checking for two conditions, not one. Sumif can
handle only one condition.

If you have Excel 2007, you can use:
=sumifs(c:c,b:b,"<="&ac10,b:b,"="&ad10)

If not, you can use Sumproduct, but you can't use an entire column.
Something like:
=sumproduct(--(b2:b1000<=ac10),--(b2:b1000=ad10),c2:c1000)

Regards,
Fred.

"Jane" wrote in message
...
I am trying to add values in one column, if the second column matches the
criteria. This is what I have written and I know this is wrong. Can anyone
please help.

SUMIF(B:B,"<=AC10 and =AD10",C:C)

Thank you



Jane

Sumif based on value in cell
 
Thank you Fred.

This is what I have and the result I get is 0, which is not correct. Do you
know what I am doing wrong.


SUMPRODUCT((B8:B152<=AD10),(B8:B152=AC10),C8:C152 )


Thanks again


"Fred Smith" wrote:

Your problem is you are checking for two conditions, not one. Sumif can
handle only one condition.

If you have Excel 2007, you can use:
=sumifs(c:c,b:b,"<="&ac10,b:b,"="&ad10)

If not, you can use Sumproduct, but you can't use an entire column.
Something like:
=sumproduct(--(b2:b1000<=ac10),--(b2:b1000=ad10),c2:c1000)

Regards,
Fred.

"Jane" wrote in message
...
I am trying to add values in one column, if the second column matches the
criteria. This is what I have written and I know this is wrong. Can anyone
please help.

SUMIF(B:B,"<=AC10 and =AD10",C:C)

Thank you




Jane

Sumif based on value in cell
 
Fred,

From Mike's post above, I figured the error... Thanks.

Jane




"Jane" wrote:

Thank you Fred.

This is what I have and the result I get is 0, which is not correct. Do you
know what I am doing wrong.


SUMPRODUCT((B8:B152<=AD10),(B8:B152=AC10),C8:C152 )


Thanks again


"Fred Smith" wrote:

Your problem is you are checking for two conditions, not one. Sumif can
handle only one condition.

If you have Excel 2007, you can use:
=sumifs(c:c,b:b,"<="&ac10,b:b,"="&ad10)

If not, you can use Sumproduct, but you can't use an entire column.
Something like:
=sumproduct(--(b2:b1000<=ac10),--(b2:b1000=ad10),c2:c1000)

Regards,
Fred.

"Jane" wrote in message
...
I am trying to add values in one column, if the second column matches the
criteria. This is what I have written and I know this is wrong. Can anyone
please help.

SUMIF(B:B,"<=AC10 and =AD10",C:C)

Thank you




Fred Smith[_4_]

Sumif based on value in cell
 
I don't see Mike's post, but from mine you'll notice dashes (--) in my
formula which aren't in yours. It's a simple matter of not copying the
formula properly.

Regards,
Fred.

"Jane" wrote in message
...
Fred,

From Mike's post above, I figured the error... Thanks.

Jane




"Jane" wrote:

Thank you Fred.

This is what I have and the result I get is 0, which is not correct. Do
you
know what I am doing wrong.


SUMPRODUCT((B8:B152<=AD10),(B8:B152=AC10),C8:C152 )


Thanks again


"Fred Smith" wrote:

Your problem is you are checking for two conditions, not one. Sumif can
handle only one condition.

If you have Excel 2007, you can use:
=sumifs(c:c,b:b,"<="&ac10,b:b,"="&ad10)

If not, you can use Sumproduct, but you can't use an entire column.
Something like:
=sumproduct(--(b2:b1000<=ac10),--(b2:b1000=ad10),c2:c1000)

Regards,
Fred.

"Jane" wrote in message
...
I am trying to add values in one column, if the second column matches
the
criteria. This is what I have written and I know this is wrong. Can
anyone
please help.

SUMIF(B:B,"<=AC10 and =AD10",C:C)

Thank you





All times are GMT +1. The time now is 05:20 PM.

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