Excel compare two columns and highlight duplicates

前端 未结 8 937
春和景丽
春和景丽 2021-01-30 02:45

I have an excel file with 10,000 rows in column A some values are the same.

Example:

A1 - P7767

A2 - P3443

A3 - P7767

A4 - P8746

A5 - P9435
         


        
8条回答
  •  遇见更好的自我
    2021-01-30 03:12

    There may be a simpler option, but you can use VLOOKUP to check if a value appears in a list (and VLOOKUP is a powerful formula to get to grips with anyway).

    So for A1, you can set a conditional format using the following formula:

    =NOT(ISNA(VLOOKUP(A1,$B:$B,1,FALSE)))
    

    Copy and Paste Special > Formats to copy that conditional format to the other cells in column A.

    What the above formula is doing:

    • VLOOKUP is looking up the value of Cell A1 (first parameter) against the whole of column B ($B:$B), in the first column (that's the 3rd parameter, redundant here, but typically VLOOKUP looks up a table rather than a column). The last parameter, FALSE, specifies that the match must be exact rather than just the closest match.
    • VLOOKUP will return #ISNA if no match is found, so the NOT(ISNA(...)) returns true for all cells which have a match in column B.

提交回复
热议问题