adding summed cells in a conditional sumif

T

Tat

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.
 
P

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top