简体   繁体   中英

Excel check that value in column is always matches the column next to it

I need to run a match but am unsure how to do it this particular way.

I have a sheet with thousands of ID numbers for each employee in column A

I then have a unique UID string in column B.

I need to make sure that every time value x shows up in column A the value next to it in column B is the same.

So if I have

1234 0987
1234 0987
1234 0988

It will flag the 0988 since 1234 is supposed to always have the same value to the right of it

You can do conditional formatting on the second column and make sure that every row below the first is equal to the first.

Eg:

=b2=b$1

[Edited to respond to question from OP]

Sort columns A, B and C (containing exceptions) using column A as the first key and column B as the second key. Then in column D in the second row of data (eg C2) put a formula like:

=IF(C2="Exception", "OK", IF(A2=A1,IF(B2=B1,"OK","BAD"),"OK"))

and fill down to the end of your data.

A more succinct version is:

=IF(C2="Exception", "OK", IF(AND(A2=A1,B2<>B1),"BAD","OK"))

You can then search by values for "BAD". Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM