I would like to conditionally highlight cells in a row. When the items in column B are duplicates then cells in columns B and C should be highlighted.

The value 7264 in column B has duplicates so items ABC, DEF, GHI in column C would be highlighted and values 7264 in column B too. Similar way items MNOP and PWE in column C and values 8765 in column B would be highlighted.

A     B      C
1   7264    ABC
2   7264    DEF
3   7264    GHI
4   8112    JKL
5   8765    MNOP
6   8765    PWE
7   9287    UIY
  • Please let us know if you are solving this problem in Microsoft Excel or a similar application. – pabouk Oct 10 '13 at 2:44

In Excel, this can be achieved with Conditional Formatting using a formula to determine which cells to format. You can achieve the result by selecting the relevant cells in columns B and C and applying the following rule:


This counts all the cells in column B that match the current row's cell in column B, and returns TRUE if the count goes above 1 (implying duplicates). The output and menu look like this:

Conditional Formatting Setup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.