I have a grid with header names in the first row and first column, e.g.:
A | B | C | D | |
---|---|---|---|---|
A | ||||
B | ||||
C | ||||
D |
The cells with the same header name in their row and column represent "valid" value for the given column.
For example, let's say I have this:
A | B | C | D | |
---|---|---|---|---|
A | 1 | |||
B | 3 | |||
C | 1 | |||
D | 4 |
In that case, "valid" value for the second column is "1", "valid" value for the third column is "3", "valid" value for the fourth column is "1", and "valid" value for the fifth column is "4".
Now for each row, I want to count how many valid values it has.
I'm using two conditional formattings that highlight the "valid" value and the values that are equal to it:
- YELLOW cell for "=B$1=$A2"
- GREEN cell for "=AND(NOT(ISBLANK(B2)),INDEX(B$2:B$10,MATCH(B$1,$A$2:$A$10,0))=B2)"
This is what it looks like:
screenshot
What I need is a formula that will count those values. Basically, a formula for that "COUNT" column at the end. On the screenshot, you can see what values it should calculate based on the current grid values.