How do you compare two load sheets to tell you exactly what the differences are

ac1223

New Member
Joined
Jan 9, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Currently the way I compare sheets is I make 2 sheets and then on the 3rd sheet I use the following formula =IF(Sheet2!A1<>Sheet1!A1,"difference",""). This makes the word difference appear on the 3rd sheet in every cell that is different between the two sheets. Does anyone know what to replace the word "difference" with in order to get more detailed info? are there any better ways to compare two load sheets and see what is updated?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
depending on what you want to show - you could use
=IF(Sheet2!A1<>Sheet1!A1,"Sheet2 contents = "&Sheet2!A1&" "&"Sheet1 contents = "&Sheet1!A1,"")
to show the actual contents of the difference - if that helps
 
Upvote 0
or macro to highlight each cell if there is difference like below.
ws1
1704834165477.png


ws2
1704834198593.png
 
Upvote 0
here is macro option.

VBA Code:
Sub CompareWorksheets()

For Each cell In Worksheets("WS1").UsedRange
If cell.value <> Worksheets("WS2").Range(cell.Address) Then
cell.Interior.ColorIndex = 3
cell.Font.Bold = True
cell.Font.FontStyle = "Bold Italic"
End If
Next

For Each cell In Worksheets("WS2").UsedRange
If cell.value <> Worksheets("WS1").Range(cell.Address) Then
cell.Interior.ColorIndex = 3
cell.Font.Bold = True
cell.Font.FontStyle = "Bold Italic"
End If
Next


End Sub
 
Upvote 0
Currently the way I compare sheets is I make 2 sheets and then on the 3rd sheet I use the following formula =IF(Sheet2!A1<>Sheet1!A1,"difference",""). This makes the word difference appear on the 3rd sheet in every cell that is different between the two sheets. Does anyone know what to replace the word "difference" with in order to get more detailed info? are there any better ways to compare two load sheets and see what is updated?

depending on what you want to show - you could use
=IF(Sheet2!A1<>Sheet1!A1,"Sheet2 contents = "&Sheet2!A1&" "&"Sheet1 contents = "&Sheet1!A1,"")
to show the actual contents of the difference - if that helps
Right now, this tells me the difference if the two cells are not an exact match, do you know if there is a way to compare two sheets Overall? for example

If I have one sheet that says:
Mark
Tim
Sarah

and then a second sheet that says:

Kevin
Jacob
Mark
Tim
Sarah
Todd

If these were two separate sheets, is there a way for excel to catch every difference if the data is not in a matching cell? (sorry if this doesn't make sense)
 
Upvote 0
Maybe something like this:
Sheet 1
Book2
AB
1List1List 2 not in List 1
2MarkKevin
3TimJacob
4SarahTodd
Sheet1
Cell Formulas
RangeFormula
B2:B4B2=FILTER(Sheet2!A2:A7,COUNTIF(A2:A4,Sheet2!A2:A7)=0,"All Match")
Dynamic array formulas.


Sheet 2
Book2
AB
1List2List 1 not in list 2
2KevinAll Match
3Jacob
4Mark
5Tim
6Sarah
7Todd
Sheet2
Cell Formulas
RangeFormula
B2B2=FILTER(Sheet1!A2:A4,COUNTIF(Sheet2!A2:A7,Sheet1!A2:A4)=0,"All Match")
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top