I have the following sheet:

A, X, 7
B, Y, 10
C, Z, 8
C, Z, 8
B, Y, 10
B, W, 20
C, Y, 10

I need a formula that will SUM column 3 IF column 1 = B,
That does not sum if a duplicate occurs in column 2

So when entering B formula returns = 30 (first B row + third B row)(ignores second B-Y row)
When C is entered, returns = 18 (3rd column sum of C's ignoring duplicates in second column)

FYI: If 2nd column are =, then 3rd column are equal in my sheet.

I basically want to remove duplicates and then do a sumif, but I want it to do it all in a formula without having to do the remove duplicates manually or have to run a macro. Is it possible?