ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   adding summed cells in a conditional sumif (https://www.excelbanter.com/excel-worksheet-functions/30267-adding-summed-cells-conditional-sumif.html)

Tat

adding summed cells in a conditional sumif
 
I would like the sumif statment to add the values in cells that are generated
by the sum formula.
I am using the following conditional if statement:
=SUM(IF($A$27:$A$38=P27,$L$27:$L$38,0)

Cells in column L add up other cells in column K to come up with a value.
However, the sumif statement does not give me the correct answer. It gives me
the total of that column instead of adding the corresponding values in the
cell that match cell P27.

P L Value of cell L column A28 is
2003
2003 =sum(k1:k5) 50
2003 =sum(k8:k17) 80
2004 =sum(k18:k22) 20

Instead of giving me an answer of 130 I get 150.

Tat

It works now. I forgot the cntrl+shift+enter when I edited the formula. Duh!

Sorry.

"Tat" wrote:

I would like the sumif statment to add the values in cells that are generated
by the sum formula.
I am using the following conditional if statement:
=SUM(IF($A$27:$A$38=P27,$L$27:$L$38,0)

Cells in column L add up other cells in column K to come up with a value.
However, the sumif statement does not give me the correct answer. It gives me
the total of that column instead of adding the corresponding values in the
cell that match cell P27.

P L Value of cell L column A28 is
2003
2003 =sum(k1:k5) 50
2003 =sum(k8:k17) 80
2004 =sum(k18:k22) 20

Instead of giving me an answer of 130 I get 150.


Peo Sjoblom

It's nothing wrong with the formula per se although it is probably better to
use

=SUMPRODUCT(--($A$27:$A$38=P27),$L$27:$L$38)

which you can enter normally, regardless it must be something wrong with
your criteria
your table makes no sense. what is in A27:A38?

--
Regards,

Peo Sjoblom

(No private emails please)


"Tat" wrote in message
...
I would like the sumif statment to add the values in cells that are
generated
by the sum formula.
I am using the following conditional if statement:
=SUM(IF($A$27:$A$38=P27,$L$27:$L$38,0)

Cells in column L add up other cells in column K to come up with a value.
However, the sumif statement does not give me the correct answer. It gives
me
the total of that column instead of adding the corresponding values in the
cell that match cell P27.

P L Value of cell L column A28
is
2003
2003 =sum(k1:k5) 50
2003 =sum(k8:k17) 80
2004 =sum(k18:k22) 20

Instead of giving me an answer of 130 I get 150.



Dave Peterson

And how about just plain old =sumif()

=SUMIF($A$27:$A$38,P27,$L$27:$L$38)



Tat wrote:

I would like the sumif statment to add the values in cells that are generated
by the sum formula.
I am using the following conditional if statement:
=SUM(IF($A$27:$A$38=P27,$L$27:$L$38,0)

Cells in column L add up other cells in column K to come up with a value.
However, the sumif statement does not give me the correct answer. It gives me
the total of that column instead of adding the corresponding values in the
cell that match cell P27.

P L Value of cell L column A28 is
2003
2003 =sum(k1:k5) 50
2003 =sum(k8:k17) 80
2004 =sum(k18:k22) 20

Instead of giving me an answer of 130 I get 150.


--

Dave Peterson

Tat

Column A includes years that the critiria in P has to match.
Thanks for your answer.

"Peo Sjoblom" wrote:

It's nothing wrong with the formula per se although it is probably better to
use

=SUMPRODUCT(--($A$27:$A$38=P27),$L$27:$L$38)

which you can enter normally, regardless it must be something wrong with
your criteria
your table makes no sense. what is in A27:A38?

--
Regards,

Peo Sjoblom

(No private emails please)


"Tat" wrote in message
...
I would like the sumif statment to add the values in cells that are
generated
by the sum formula.
I am using the following conditional if statement:
=SUM(IF($A$27:$A$38=P27,$L$27:$L$38,0)

Cells in column L add up other cells in column K to come up with a value.
However, the sumif statement does not give me the correct answer. It gives
me
the total of that column instead of adding the corresponding values in the
cell that match cell P27.

P L Value of cell L column A28
is
2003
2003 =sum(k1:k5) 50
2003 =sum(k8:k17) 80
2004 =sum(k18:k22) 20

Instead of giving me an answer of 130 I get 150.




Tat

That works fine too. Thanks

"Dave Peterson" wrote:

And how about just plain old =sumif()

=SUMIF($A$27:$A$38,P27,$L$27:$L$38)



Tat wrote:

I would like the sumif statment to add the values in cells that are generated
by the sum formula.
I am using the following conditional if statement:
=SUM(IF($A$27:$A$38=P27,$L$27:$L$38,0)

Cells in column L add up other cells in column K to come up with a value.
However, the sumif statement does not give me the correct answer. It gives me
the total of that column instead of adding the corresponding values in the
cell that match cell P27.

P L Value of cell L column A28 is
2003
2003 =sum(k1:k5) 50
2003 =sum(k8:k17) 80
2004 =sum(k18:k22) 20

Instead of giving me an answer of 130 I get 150.


--

Dave Peterson



All times are GMT +1. The time now is 10:26 PM.

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