I have the data below
A B
1 3 3
2 2 5
3 1 2
4 3
5 3
I want to take the average of column B and if column A contains a value of 3 that is unmatched in its corresponding row in column B, include it in the average calculation. So the value of 3 from row 1 would be excluded because it is matched in column B, but the value of 3 from row 4 and 5 would be included to make it the average of 3(B1),5(B2),2(B3),3(A4),3(A5). What I have is below, but it adds a value of 0 to the average if the COUNTIFS statement comes out to be 0, which skews the average down.
AVERAGE(B1:B5, 3*COUNTIFS(A1,3,B1, "<>3"), 3*COUNTIFS(A2,3,B2, "<>3"),3*COUNTIFS(A3,3,B3, "<>3"),3*COUNTIFS(A4,3,B4, "<>3"),3*COUNTIFS(A5,3,B5, "<>3"),)