Hi, I'm trying to make a function to count the instances where one cell has a different value to the cell beside it. the columns are effectively pairs so I'm only looking to where count every pair of cells do not match. I tried the following formula, but cant get the syntax right, am not sure if it would even work.
=COUNTIF(MOD(G2:R2,2)=0, (MOD(G2:R2,2)=0) <> (MOD(G2:R2, 2) =1))
I managed to get the required outcome by making a macro,
but I'd rather have it as a formula if at all possible. Any help would be appreciated.
=COUNTIF(MOD(G2:R2,2)=0, (MOD(G2:R2,2)=0) <> (MOD(G2:R2, 2) =1))
I managed to get the required outcome by making a macro,
Code:
For I = Range("G2").Column To Range("R2").Column Step 2
If Cells(2, I).Value <> Cells(2, (I + 1)).Value Then
difTot = difTot + 1
End If
Next I
but I'd rather have it as a formula if at all possible. Any help would be appreciated.