Compare three columns between two spreadsheets and display differences in a third spreadsheet

pencil pusher

New Member
Joined
Feb 24, 2016
Messages
11
Hi everyone!

I am working on a workbook where I want to create a macro to compare the differences between two spreadsheets that have three columns of 1000's of data. That's three columns of data in one spreadsheet and three in the other.

I may not be explaining the best way to do this, but basically, I have data from inventory I took about a month ago and I want to determine the differences (additions and removals, and if there is no change) from that report to another report I generated about a year ago; so I can clearly see the changes (additions and removals, and if there is no change)

The data will not necessarily match in number of rows and will not be in order so it cannot be compared side-by-side. I would like the results to be displayed in a 3rd spreadsheet on the same workbook that will show the results of the matching three columns and then in a fourth column display whether it was added (something added to the inventory since a year ago) or removed (something removed from inventory since a year ago) or if there was no change. So I can easily spot and sort the deltas on the third spreadsheet.

Thanks for your help in advance!

here is an example of what the columns might look like

sheet 1 Report from a year ago
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Grape[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]

Sheet 2 Report Recently pulled (In my example I put the changes in bold red so you can see what I changed/Added)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]002
[/TD]
[TD]Apple
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]003[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]005
[/TD]
[TD]Watermelon
[/TD]
[TD]2
[/TD]
[/TR]
</tbody>[/TABLE]

sheet 3 Delta Results (additions/removals and if there was no changes on sheet 2 when compared to sheet 1)
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]Order#[/TD]
[TD]Name[/TD]
[TD]QTY[/TD]
[TD]Delta[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]5[/TD]
[TD]No Change[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Apple[/TD]
[TD]5[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Grape[/TD]
[TD]5[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]1[/TD]
[TD]Removed[/TD]
[/TR]
[TR]
[TD]003[/TD]
[TD]Banana[/TD]
[TD]4[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Orange[/TD]
[TD]8[/TD]
[TD]Added[/TD]
[/TR]
[TR]
[TD]005[/TD]
[TD]Watermelon[/TD]
[TD]2[/TD]
[TD]Added[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I meant to say to compare between 2 tabs... and post in another tab... not spreadsheet ... sorry about that. the data is in the same spreadsheet/workbook ... but in different tabs and I want the put the results in the third tab.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
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