I need to compare 2 ranges of cells and highlight whatever cells that match in red
- User
I need to compare 2 ranges of cells and highlight whatever cells that match in red
Assistant
To compare and highlight cells that match in red, you can use the
MATCHandCOUNTIFfunctions in Excel. Here's an example formula that you can use:- Enter the formula in a cell, such as cell A1:
vbnet=COUNTIF($A$1:$A$10,A1)- Copy the formula down to cell B1, to include the remaining cells in your range.
- Select the range of cells that you want to highlight.
- Click on the "Conditional Formatting" button in the "Styles" group on the Home tab.
- Click on "Highlight Cell Rules" and select "Top/Bottom borders".
- Select the "Use a formula to determine which cells to format" option.
- In the "Format values where this formula is true" box, enter the following formula:
vbnet=MATCH(A1,B1:B10,0)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.