Hello Excel masters,

I have a question that might be stupid but i cant find an easy solution.
To present the problem i will help myself with this table:
23 2 13
34 2 12
12 2 11
12 2 14
13 2 15
15 2 16
16 2
14 2
22 2
13 2

is there any way to do equation in one cell which would sum all the values in column 2 where values from column 4 (last) (whole column - the array) are equal to values in column 1. In this upper case the sum would be 14. one way is to transpose the column 4 then it would work but i dont want to solve it this way :D

thanx for help