Excel.Tips.Net ExcelTips (Menu Interface)

Comparing Workbooks

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Comparing Workbooks.

Krishna asked if there was a way to compare the contents of two Excel workbooks. Unfortunately, there is no built-in comparison feature, as there is in Word to compare two documents. There are third-party programs available that can help you out, and a quick search of the Web can help to locate such programs.

Depending on your needs, there can be an easier way. If the worksheets in each workbook are laid out the same, and you just want to find differences between values in the cells of each worksheet, then you can use formulas to compare worksheets. Try the following steps:

  1. Create a new workbook called Compare.xls.
  2. In cell A1 of the first worksheet in Compare.xls, enter the following formula:
  • Copy the formula from A1 into all the other cells that represent the range you want to compare. For instance, if you want to compare A1:G12 in both worksheets, then you would copy the formula from A1 into the full range of A1:G12.
  • These steps assume that the worksheets you want to compare are both named Sheet1, and they are in WB1.xls and WB2.xls, respectively. If you have other sheets in WB1.xls and WB2.xls to compare, you can use similar formulas in other sheets of Compare.xls.

    When done, any cell that has the word "Different" in it represents a cell that is different in the ranges being compared. Thus, if C7 had "Different" in it, then there is a difference between the cell C7 of Sheet1 in WB1.xls and cell C7 of Sheet1 in WB2.xls.

    If you are comparing only numeric values between the two worksheets, you could use a different formula in step 2, above:


    The result is a worksheet that subtracts the values in one workbook from the other, which results in the numeric differences.

    ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2006) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Comparing Workbooks.

    Related Tips:

    Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!


    Leave your own comment:

      Notify me about new comments ONLY FOR THIS TIP
    Notify me about new comments ANYWHERE ON THIS SITE
    Hide my email address
    *What is 4+5 (To prevent automated submissions and spam.)
              Commenting Terms

    Comments for this tip:

    Kumarapush    07 Aug 2015, 04:20
    Extending the above code which compares the values from 2 cells, the code in the below article compares all the data between 2 Excel Files and presents the results with a summary + Highlighted mismatched cells.

    officetricks. com /how-to-compare-two-excel-files/

    Hope this helps.
    sim    28 Feb 2013, 22:32
    You could use the excel function EXACT which compares values and strings.
    And there is something called Spreadsheet Compare in Microsoft Office Professional Plus 2013
    Joakim    29 Nov 2012, 09:40
    Thanks for the tip! Halfway with my sheet now! Only thing I would need is that instead of writing "Different" I would like to have the actual value. Now I have to go back and check both sheets to see what was different


    Our Company

    Sharon Parq Associates, Inc.

    About Tips.Net

    Contact Us


    Advertise with Us

    Our Privacy Policy

    Our Sites


    Beauty and Style




    DriveTips (Google Drive)

    ExcelTips (Excel 97–2003)

    ExcelTips (Excel 2007–2016)



    Home Improvement

    Money and Finances


    Pests and Bugs

    Pets and Animals

    WindowsTips (Microsoft Windows)

    WordTips (Word 97–2003)

    WordTips (Word 2007–2016)

    Our Products

    Helpful E-books

    Newsletter Archives


    Excel Products

    Word Products

    Our Authors

    Author Index

    Write for Tips.Net

    Copyright © 2015 Sharon Parq Associates, Inc.