You should use the COUNTIF
function:
=COUNTIF(C5:N5,"<>" & B5)
This function will return the number of cells in C5:N5
that does not equal the value in cell B5
.
質問
I am trying to count the number of times that a range does not match a cell.
For example: B5 can be "Yes" or "No" based on the selection from a Data Validation Table. I want the formula to count the number of times that C5:N5 do NOT match B5. So if B5 is "Yes", how many times in C5:N5 was "No" selected. And if B5 is "No", how many times in C5:N5 was "Yes" selected.
解決
You should use the COUNTIF
function:
=COUNTIF(C5:N5,"<>" & B5)
This function will return the number of cells in C5:N5
that does not equal the value in cell B5
.