I've stumbled upon a feature of Excel which I do not understand. In the table below I've tried to strip down my issue to its bare essence:
X
COUNTIF(A1,A3:A4) evaluates to: 0
F9: {1,0} evaluates to: 1
INDEX(COUNTIF(A1,A3:A4),1,1) evaluates to: 1
COUNTIF(A1,A3:A4) evaluates to: 0...