Hi all. I've 2 columns (see below)

1 20
3 35
2 10
5 20
4 25
2 30
1 30


I need to get the total for each number on the lefts corrosponding value on
the right.

ie. Total of 1=50
2=40
etc

I tried

=IF(D15:D21="1", SUM(F15:F21))

but no joy, can anyone shed some light?
thanks and regards
gR