Actually, your formula =SUMIF(B13:M13:B32:M32:B51:M51,P23, B15:M15:B34:M34:B53:M53)
converts to =SUMIF(B13:M51,P23, B15:M53)
(you can check it for example using "Evaluate formula" tool in the "Formulas" Ribbon or by entering in cell B18
value, euqals to P23
, and another value in B20
- your formula will add value from B20
to the result). And it doesen't calculate propertly, because you have some text values in B16:M33, B35:M52
So, you can use following formula instead:
=SUMPRODUCT((B13:M13=P23)*(B15:M15)+(B32:M32=P23)*(B34:M34)+(B51:M51=P23)*(B53:M53))
Here is result of evaluating your formula (=SUMIF(B13:M13:B32:M32:B51:M51,P23, B15:M15:B34:M34:B53:M53)
):