You are the boss of ACME Inc. And one day, both of your accountants Sara and James come to you with two versions of the customer payment data. How do you compare these two Excel sheets and reconcile the data? We can use VLOOKUP to do just that. In this article, let me explain the step-by-step process.
Step 1: Set up data in two Excel sheets
Copy both sets of data to two sheets in an Excel file. For example, here I have two sheets – one with Sara’s data and another with James’ data. Both datasets have identical columns, but the data is not same.

Step 2: Start with the first sheet and write the VLOOKUP formula
Go to the first sheet. Here, we are going to use VLOOKUP (or XLOOKUP, if you have Excel 365) to get the matching value from second sheet.
For the purpose of this exercise, you need a unique identifier column like Customer ID or invoice number.
In the adjacent column we are going to write the VLOOKUP function to get the corresponding values for the customer ID’s from second sheet. The set up should look like this:

Step 3: The LOOKUP formula
Write the VLOOKUP formula like this:
=VLOOKUP(B3,'James Sheet'!$B$3:$C$32,2,FALSE)
VLOOKUP Formula Explanation:
- VLOOKUP formula finds matching value from a range. For example, here we can use it to search for the customer ID and get their payment details.
- B3: refers to the cell with customer ID
- ‘James Sheet’!$B$3:$C$32: is the range of data in second Excel sheet which we are trying to match
- 2: is the column number of the “Amount paid” column in second sheet.
- FALSE: ensures that VLOOKUP will look for an exact match in the second sheet.
- Learn more about VLOOKUP function.
Or if you prefer to use XLOOKUP formula, use this:
=XLOOKUP(B3,'James Sheet'!$B$3:$B$32,'James Sheet'!$C$3:$C$32, "ID missing")

Fill this formula down so you can see the matching values from second sheet.
At the end of this step, your first sheet should look like this:
If you have any missing IDs, those cells should have #N/A.

Step 4: Reconcile the values
Now that you have the matching value from second Excel sheet, let’s reconcile both to see which values matched and which values are different.
For this, we can use IF formula. Here is the formula:
=IF(ISERROR(D3),"ID Missing", IF(D3<>C3,"Not matching", "Matching"))

This formula compares the first sheet value with the second sheet value and tells us if they are same or different. It also checks for the #N/A error and flags those records as “Missing ID”.
Fill the formula down and you will have reconciliation information for your data.

Now you can use FILTERS in Excel to see all matching or not matching records easily.
Step 5: Conditional format the non-matching records

This optional step helps us quickly spot all the non-matching and missing ID values quickly.
To do this,
- Select the entire range of data (for example: B3:E32)
- Go to Home ribbon > Conditional Formatting and click on “new rule”
- Select the rule type as “Use a formula to determine the…”
- Type the rule as =$E3 = “Not matching” (refer to the below image)
- Set the formatting to highlight the non-matching records
- Click OK to add the rule.
- Add one more rule for “ID missing” highlight and repeat steps 3 to 6

When you finish, your data will highlight all the non-matching and missing ID values in different color so you can easily identify them.
Related: Learn more about Excel conditional formatting feature.
FREE Comparison & Reconciliation Template
If you need a quick template to compare two Excel sheets and reconcile the data, download my sample file here.
Other techniques to reconcile and compare two Excel sheets:
While using VLOOKUP is a quick and elegant way to compare two spreadsheets, Excel also offers few more options. These are:
- Power Query: We can use Power Query to compare two sheets or two workbooks of data and reconcile the differences between values. Power Query also makes it easy to compare when you have multiple ID columns (for example: Customer ID & Date as the criteria for comparison). Refer to my Power Query tutorial page for more information on how to combine data with it.
- Using XLOOKUP instead of VLOOKUP: As demoed above, we can use the new XLOOKUP function in Excel to perform the comparison. This allows for built-in error handling so we can see “Missing IDs” easily. Read more about XLOOKUP function here.
- Using Conditional formatting: Excel’s conditional formatting also offers a powerful and simple way to compare two lists of values. See this page for details.
- Using formulas vs. Power Query: I discuss the approaches for comparing two Excel sheets with formulas and PQ in my YouTube video here.
- Using Pivot Tables: Excel Pivot tables can link two tables of data on a key column (like customer ID) so you can easily compare values from both in one view. This feature is called relationships. Learn more about Table Relationships in Excel here.
In conclusion…
Comparing two Excel sheets is an easy task once you know how to use the VLOOKUP (or XLOOKUP) function in Excel. I have used this exact approach countless times when dealing with multiple versions of files or different versions of truth. The process is easy, and the results are actionable.
8 Responses to “Pivot Tables from large data-sets – 5 examples”
Do you have links to any sites that can provide free, large, test data sets. Both large in diversity and large in total number of rows.
Good question Ron. I suggest checking out kaggle.com, data.world or create your own with randbetween(). You can also get a complex business data-set from Microsoft Power BI website. It is contoso retail data.
Hi Chandoo,
I work with large data sets all the time (80-200MB files with 100Ks of rows and 20-40 columns) and I've taken a few steps to reduce the size (20-60MB) so they can better shared and work more quickly. These steps include: creating custom calculations in the pivot instead of having additional data columns, deleting the data tab and saving as an xlsb. I've even tried indexmatch instead of vlookup--although I'm not sure that saved much. Are there any other tricks to further reduce the file size? thanks, Steve
Hi Steve,
Good tips on how to reduce the file size and / or process time. Another thing I would definitely try is to use Data Model to load the data rather than keep it in the file. You would be,
1. connect to source data file thru Power Query
2. filter away any columns / rows that are not needed
3. load the data to model
4. make pivots from it
This would reduce the file size while providing all the answers you need.
Give it a try. See this video for some help - https://www.youtube.com/watch?v=5u7bpysO3FQ
Normally when Excel processes data it utilizes all four cores on a processor. Is it true that Excel reduces to only using two cores When calculating tables? Same issue if there were two cores present, it would reduce to one in a table?
I ask because, I have personally noticed when i use tables the data is much slower than if I would have filtered it. I like tables for obvious reasons when working with datasets. Is this true.
John:
I don't know if it is true that Excel Table processing only uses 2 threads/cores, but it is entirely possible. The program has to be enabled to handle multiple parallel threads. Excel Lists/Tables were added long ago, at a time when 2 processes was a reasonable upper limit. And, it could be that there simply is no way to program table processing to use more than 2 threads at a time...
When I've got a large data set, I will set my Excel priority to High thru Task Manager to allow it to use more available processing. Never use RealTime priority or you're completely locked up until Excel finishes.
That is a good tip Jen...