Confused - why would you not just use the Pivot table features to exclude the data you don't want.
You could also simply add a 3rd column, and use something like =IF(A2=B2,A2,B2) if what you want is one of the two values no matter what, OR, if what you are actually looking for is the sum of...