The formula I wish to write has three rules:
1) count values in $E21:$AJ21
2) that match a value in $E$21:$A$J164
3) except when text in $C$21:$C$164 = $C21
Eg [using range E21:H24 instead of E21:AJ164].
The correct answer here would be 2. From row 21, we can see the value 2 also appears in row 23 (so thats a count of 1), as does the value 4 (so thats a count of 1). They are the only values to appear more than once, so 1+1=2. We can see that every value in row 21 is found again in row 24, but as the text in C21 is the same as C24, we are ignoring that row.
I currently have the below formula, which calculates rules 1 and 2 perfectly, but I don't know how to include rule 3 within it. Any ideas?
=COUNT($E21:$AJ21)-SUMPRODUCT(--(COUNTIF($E$21:$AJ$164,$E21:$AJ21)=1))
All help is much appreciated!
1) count values in $E21:$AJ21
2) that match a value in $E$21:$A$J164
3) except when text in $C$21:$C$164 = $C21
Eg [using range E21:H24 instead of E21:AJ164].
C | E | F | G | H | |
21 | One | 1 | 2 | 3 | 4 |
22 | Two | 1.5 | 2.5 | 3.5 | 4.5 |
23 | Three | 1.8 | 2 | 4 | 4.1 |
24 | One | 1 | 2 | 3 | 4 |
The correct answer here would be 2. From row 21, we can see the value 2 also appears in row 23 (so thats a count of 1), as does the value 4 (so thats a count of 1). They are the only values to appear more than once, so 1+1=2. We can see that every value in row 21 is found again in row 24, but as the text in C21 is the same as C24, we are ignoring that row.
I currently have the below formula, which calculates rules 1 and 2 perfectly, but I don't know how to include rule 3 within it. Any ideas?
=COUNT($E21:$AJ21)-SUMPRODUCT(--(COUNTIF($E$21:$AJ$164,$E21:$AJ21)=1))
All help is much appreciated!