Compare Excel files for differences

Compare workbooks side by side

The simplest way to compare two Excel worksheets is just by looking at them. If you use standard widescreen monitor there is enough room to display two files side by side.

  1. Open two Excel files you want to compare.
  2. Select the first file.
  3. Use the Windows button + Left arrow to move it to the left side of the window.
  4. Choose the second file from the right side of the screen.

Now, you can compare two files side by side.

Arranging multiple sheets

If you want to arrange multiple sheets in Excel, you have to open these files, navigate to the first one and click View >> Windows >> Arrange All.

Select vertical arrangement and click OK.

You can scroll each of them independently.

Compare workbooks side by side inside Excel

If the previous way of comparing files is not enough for you, you can use the Excel feature called View Side by Side. It’s located under View >> Windows.

When you have two Excel files opened, Excel will automatically display them in the horizontal view. If you have more than two, you will have to choose the file from the list.

Select the file and click OK.

Horizontal view in the wide-screen monitor is not the best choice. Switch it to the vertical position. To do this, click View >> Window >> Arrange All. Choose Vertical and press OK.

At first, it seems that we’ve achieved the same result as before. But now, if you scroll one window, the other one will scroll to the same position. If you want to disable this feature, go to View >> Window and uncheck Synchronous Scrolling.

Now, you can scroll worksheets independently as you did in the first example.

Compare worksheets side by side inside Excel

If the sheets you want to compare are inside a single workbook, click View >> Window >> New Window.

It will open the same Excel file in two windows. If you look at the top of the workbook, you will notice that both of them have the same name, but with different numbers.

By default, both of them have the same worksheet selected. If you change something in one window, it will automatically be displayed inside the other one.

Now, you can switch to the worksheet you want to compare inside another workbook to View Side by Side with Synchronous Scrolling.

Conditional formatting

With the conditional formatting, you can highlight cells that have different values in two sheets. It’s important that you do it exactly as I show you because Excel likes to change a formula you enter. So be careful.

  1. Click inside data area and press Ctrl + A to select all cells inside this range.
  2. Navigate to Home >> Styles >> Conditional Formatting and choose Manage Rules.
  1. Click the New Rule button.
  2. Choose a rule type and insert the following formula: =A1<>Sheet2!A1 into the rule description.
  3. Click the format and choose the color to fill the cells.
  4. If you have all the values set, confirm changes by clicking the OK button.
  1. Click OK.
  2. Normally, you would click OK to execute the rule, but instead, select the rule and click Edit Rule.
  1. As you can see the formula has changed and will give us incorrect results. Enter the correct formula one more time and click OK. Then click OK one more time.
  2. All the cells inside Sheet1 that are different than the same cells inside Sheet2 are highlighted.

Highlight differences with VBA code

This time let’s highlight the cells with a simple click. Let’s write some VBA code.

The following procedure is going to highlight cell differences.

Select cells inside Sheet1 that you want to check and run the following macro.

This procedure loops through each cell inside the selection and compares the value of this cell with the cell in the second worksheet. In our case it’s Sheet2. If cells are different, the cell inside Sheet1 is filled with color.

The result is the same as in the previous example, but this time it’s only one click.