Hi
I need help with a formula.
I want to return a 1 or 0 when True or False for the following condition:
A B C D E F G H
1 Name Abv Name Abv A Matches, Not B B Matches, Not A
2 GRAY WOLF GWF FORCE RECON FRC 1 0
3 GREEN LAMPOST GL GRAY WOLF GRR 0 0
4 BRAVES COUNTRY BCY BRAVES COUNTRY BRY 1 0
5 FORCE RECON FRC GREEN LANTERN GL 0 1
Return 1: When A1 is found in column D (cell unknown) AND A2 does not match its counterpart in column E (cell unknown)
Return 0: When A1 is found in column D (cell unknown) AND A2 does match its counterpart in column E (cell unknown)
I am calculating the values for column E with (it has to be the adjacent cell to where found in column D):
=OFFSET(INDIRECT(ADDRESS(MATCH(A2,$D$2:$D$5,0)+ROW($D$2)-1,COLUMN($D$2),4)),0,1)
In the example above I am getting:
GRR
#N/A
BRY
FRC
This seems correct.
But when I nest this formula into COUNTIFS to get 1 or 0, I get all 0s:
=COUNTIFS($D$2:$D$5,A2,$E$2:$E$5,"<>"&OFFSET(INDIRECT(ADDRESS(MATCH(A2,$D$2:$D$5,0)+ROW($D$2)-1,COLUMN($D$2),4)),0,1)
If I remove the absolutes in ROW() and COLUMN() (i.e. use ROW(D2), COLUMN(D2) instead) and allow the cell references to increment as I copy the formula down, I get false positives mixed in with accurate results.
Bookmarks