
Then we can select Format to choose a different color. The only change we will make to the rule is to add “ >1” to the end of the rule. Once the rule is duplicated, select one of them and hit Edit Rule. We're going to select the rule we've already made and then hit Duplicate Rule. Start by reopening the Conditional Formatting Rules Manager ( Home tab → Conditional Formatting → Manage Rules). If you'd like to highlight in a different color the entries that have more than one duplicate in the other sheet, you can simply add a new rule. Different Formatting for Multiple Duplicates When you hit OK, and OK again, your formatting will be applied.Īny cell that returns a value larger than zero will have the new formatting applied. Change the font, border, number type, or fill with color so that your duplicates will stand out. Next, select the Format… button and that will open the Format Cells window, where you can select any type of formatting you wish. That will open a field where you can write or paste the formula that we talked about above. In the New Formatting Rule window, select the option that says Use a formula to determine which cells to format. On the Home tab of the ribbon, choose the Conditional Formatting drop-down menu and select New Rule. In our case it is all of the phone numbers on the “Current” worksheet. Now that we've looked at how the formula works, let's see how the conditional formatting is applied.įirst select the entire range of cells that you want the formatting applied to. That's because when we apply the conditional formatting to our entire table, Excel will examine each cell individually to see if the criteria apply, but only if it's expressed as a relative reference (no dollar symbols in the reference). It's important that the B2 used for the criteria argument is expressed as a relative reference, not an absolute reference. With conditional formatting, we use those numbers to highlight the entries that are duplicates.įor our example, the formula looks like this: =COUNTIF(Historical!$B$2:$F$1001,B2) If it is NOT found on that sheet, it will return a zero. If the value that is found in cell B2 is also found in our designated range on the Historical tab, the COUNTIF function will return a number greater than zero. The criteria argument is simply the value that we are looking for. In my video tutorial, my range is from B2 to F1001 on the “Historical” sheet. Range is the group of cells that you want to look in to find a specific value. The first is range and the second is criteria. For this process we are using the COUNTIF function.ĬOUNTIF has two arguments. If so, it will return a value of the number of times that data is found. The formula we'll write is going to examine a cell to see if its contents can be found in another range that we specify.
Compare two columns in excel different sheets how to#
Click to enlargeįirst let's look at how to write the formula and then we will see how to apply the conditional formatting. You can do so using a formula and conditional formatting. Let's say you have two Excel worksheets that have overlapping data and you want to call attention to any cells that have duplicate entries. There are probably also other methods to compare two lists, but these steps should be comparatively Highlighting Duplicates Between Worksheets If you need assistance with the COUNTIFS function, please refer to this article.

Do it the same way in column H for the second list. In our example, the formula in cell G4 would be “=COUNTIFS($B$4:$B$6,$F4)”. As the last step, we count how often each item occurs in each list.Therefore, select the whole list and go to Data and click on Remove Duplicates.

Excel provides a (very useful) function, called “Remove Duplicates”.

The first column will later on contain the whole list.

This might as well be an additional worksheet. Let’s take a look at an easier example: You have two lists and want to know which items are in both lists, and which item is only available in one of the lists. Method B1: See differences of two simple lists
