In this article, you will learn comparing two lists using Conditional Formatting. The common cities will get highlighted.
We will use Conditional Formatting using COUNTIF function to get the result.
Let us take an example to understand:
We have two lists of cities that Frank & Larry will visit. We want to figure out the common cities between both; if require they can meet & discuss the business strategies.
Select the second list range B2:B7
- Click on Home tab
- From Styles group, click on Conditional Formatting
- Click on New Rule
- In the New Formatting Rule dialogue box, select “Use a formula to determine which cells to format”
- Enter the formula =COUNTIF($A$2:$A$7,B2)>0
- Click on the Format & set the formatting, then click OK twice.
The formula in conditional formatting will highlight the cells that match with column A
In this way, you can get the list of common cities.