Recently I got asked by a colleague to help her identify compare two lists of providers in Excel. In one list there was a list of providers available in May. In the other she had a list of providers available in January. She wanted to identify what providers were in one list but not in the other. So there was a bit of a lost/found issue
In order to do that, I set up a file using the following
- Vlookup function combined with the iferror function.
- Conditional formatting to highlight the missing ones
- Finally, filtering to just show the ones that were missing.
Step 1- Make it easy to see both sheets
Open the file which you can download here:
and set up the two sheets so you can see them side by side.
- View | New Window (click on this once). Note that you will now see 2 after the file name.
- View | Arrange All. Choose Tiled and make sure you tick the box that says “Window of Active workbook” (otherwise all the files you have opened will appear on the screen.
- Click on each sheet so that you see May 2015 on one side and January 2015 on the other.
Step 2 – Use Vlookup to identify what is missing
Create a vlookup to compare the entries using the Provider_Code. Where there is a match, we will see the provider code, where there is no match we will see the infamous N/A.
- Click in cell B2 in the May 2015 sheet
- Click on Formulas | Lookup and Reference | Vlookup
- Click in the Lookup Value box, then click on cell A2. Note that what appears in the box is [@[PROVIDER_CODE]]
- Click in Table Array. Then highlight columns A and B in the January 2015 sheet.
- In the Col_index_num box enter 1 (this is for column 1)
- In the Range Lookup box, enter False.
- Click OK.
- The formula will copy down. Note that for most of the entries you see a provider code. However for some of them there is N/A – that means they are a missing entry.
Step 3 – Using Iferror() to highlight the missing entries
- Click in the May 2015 sheet, click in cell B2
- In the formula bar, click between “=” and the V
- Type in iferr
- Iferror appears in blue underneath the function. Double click on it. =iferror( will now appear to the left of the Vlookup function)
- Navigate to the end of the vlookup function
- Enter a comma (,) .
- Type in “No Match” (include the quotation marks)
- Type in )
- Press Enter
- Note the formula copies down and you will now see No Match instead of N/A
Step 4 – To apply conditional formatting
- Click in the May 2015 sheet, Highlight column B
- Click on Home | Conditional Formatting | Highlight Cells Rules | Text that contains…
- Type No Match into the box.
- Click OK. Note that all the No Match entries appear in red.
- Click on the filter icon beside the heading at the top of column C and filter for No Match. If you are not sure how to filter, check out this tutorial here.
If you do the same thing in the January sheet, you should end up with 7 No Matches.
You can view a copy of the completed file here.