Find the differences between 2 Excel worksheets?

后端 未结 19 1283
小鲜肉
小鲜肉 2020-12-08 03:38

I have two excel files with the same structure: they both have 1 column with data. One has 800 records and the other has 805 records, but I am not sure which of the 5 in t

相关标签:
19条回答
  • 2020-12-08 04:20

    COUNTIF works well for quick difference-checking. And it's easier to remember and simpler to work with than VLOOKUP.

    =COUNTIF([Book1]Sheet1!$A:$A, A1) 
    

    will give you a column showing 1 if there's match and zero if there's no match (with the bonus of showing >1 for duplicates within the list itself).

    0 讨论(0)
  • 2020-12-08 04:21

    I used Excel Compare. It is payware, but they do have a 15 day trial. It will report amended rows, added rows, and deleted rows. It will match based on the worksheet name (as an option):

    http://www.formulasoft.com/excel-compare.html

    0 讨论(0)
  • 2020-12-08 04:24

    It might seem like a hack, but I personally prefer copying the cells as text (or exporting as a CSV) into Winmerge or any other diff tool. Assuming the two sheets contain mostly identical data, Winmerge will show the differences immediately.

    0 讨论(0)
  • 2020-12-08 04:24

    I found this command line utility that doesn't show the GUI output but gave me what I needed: https://github.com/na-ka-na/ExcelCompare

    Sample output (taken from the project's readme file):

    > excel_cmp xxx.xlsx yyy.xlsx
    DIFF  Cell at     Sheet1!A1 => 'a' v/s 'aa'
    EXTRA Cell in WB1 Sheet1!B1 => 'cc'
    DIFF  Cell at     Sheet1!D4 => '4.0' v/s '14.0'
    EXTRA Cell in WB2 Sheet1!J10 => 'j'
    EXTRA Cell in WB1 Sheet1!K11 => 'k'
    EXTRA Cell in WB1 Sheet2!A1 => 'abc'
    EXTRA Cell in WB2 Sheet3!A1 => 'haha'
    ----------------- DIFF -------------------
    Sheets: [Sheet1]
    Rows: [1, 4]
    Cols: [A, D]
    ----------------- EXTRA WB1 -------------------
    Sheets: [Sheet1, Sheet2]
    Rows: [1, 11]
    Cols: [B, K, A]
    ----------------- EXTRA WB2 -------------------
    Sheets: [Sheet1, Sheet3]
    Rows: [10, 1]
    Cols: [J, A]
    -----------------------------------------
    Excel files xxx.xlsx and yyy.xlsx differ
    
    0 讨论(0)
  • 2020-12-08 04:25

    vlookup is your friend!

    Position your column, one value per row, in column A of each spreadsheet. in column B of the larger sheet, type

    =VLOOKUP(A1,'[Book2.xlsb]SheetName'!$A:$A,1,FALSE)
    

    Then copy the formula down as far as your column of data runs.

    Where the result of the formula is FALSE, that data is not in the other worksheet.

    0 讨论(0)
  • 2020-12-08 04:27

    Easy way: Use a 3rd sheet to check.

    Say you want to find differences between Sheet 1 and Sheet 2.

    1. Go to Sheet 3, cell A1, enter =IF(Sheet2!A1<>Sheet1!A1,"difference","").
    2. Then select all cells of sheet 3, fill down, fill right.
    3. The cells that are different between Sheet 1 and Sheet 2 will now say "difference" in Sheet 3.

    You could adjust the formula to show the actual values that were different.

    0 讨论(0)
提交回复
热议问题