The green cells match up to non-unique values in column A and in Column B...

so why are those getting summed?

Are you looking for one formula or separate formulas?

Not to clear.