I am trying to find out if there is way to write an excel formula that can see if all values from a certain key match each other. I am hoping to do this within one formula in one cell so that it can easily be dragged down for the entire column.
I've looked into different formulas, but I'm finding it difficult as there could a variable amount of lines per key.
An expected result would look like this:
Key | Value | Do all values match for key? |
---|---|---|
1 | 1 | Yes |
2 | 1 | No |
2 | 2 | No |
3 | 3 | Yes |
3 | 3 | Yes |
3 | 3 | Yes |
This would work in Office 365 as well:
=IF(ABS(MMULT((TOROW(A2:A7)=A2:A7)*(TOROW(B2:B7)<>A2:A7),ROW(A2:A7)^0)),"No","Yes")
Or more dynamic:
=LET(range, A2:B7,
a, TAKE(range,,1),
b, DROP(range,,1),
IF(ABS(MMULT((TOROW(a)=a)*(TOROW(b)<>a),SEQUENCE(ROWS(a),,,0))),
"No",
"Yes"))
(likely a duplicate but having a hard time finding a dupe target)
Using IF
and COUNTIFS
:
=IF(COUNTIFS(A:A,A2,B:B,"<>"&B2)>0,"No","Yes")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With