Array compare?

roscoe

Well-known Member
Joined
Jun 4, 2002
Messages
1,046
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a project (proprietary, can't go into details, sorry) where I read in data from a server and convert it to a user friendly graphical form. It get's repeated over time and sometimes the source data will slightly change from what was previoulsy imported. My users have asked for me to do a comparison and pop up a message box with significant changes.

So far I've read the old data into an array, and imported to updated data. Now I'm stuck as to the best way to do the compare. Given that some items in the orignal import may go away over time, and new items may be added, I can't do a straight row by row compare (if something as been added in the new import, there will be an offset bewtween the two arrays)

Looking for a clever way to identify adds, deletetions, and value changes (two of the array values are start and stop time of the event, another is a value associated with that event that could change, etc...)

Again, I'd love to show an example but corporate policy doesn't allow it (the computer is on a standalone network, couldn't even copy the code over if I wanted)

Thanks in advance!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
(please disregard the spelling errors in my OP...I think my spell checker was taking a break :)

Let's see if I can make up "concrete" examples to describe what I want.

On Monday, I import a calendar for next Monday and get the following:
Joe, 10:00 AM Monday, 1 hr
Mary, 11:00 AM Monday, 1 hr
Fred, 1:00 PM Monday, 30 min
Joe, 1:30 PM Monday, 1 hr

On Friday, I reimport the same calendar and I get the following (with the changes in []):
Joe, 9:30 AM Monday, 30 min [earlier and shorter]
Dean, 10:00 AM Monday, 30 min [New appt, same time as Joe's original appt]
Mary, 11:00 AM Monday, 1 hr [No Change]
[Fred canceled]
Joe, 1:30 PM Monday, 1.5 hr [Longer]

What I'm looking for is to automate identifying adds, subtracts, changes, with the subtlety that there may be repeated events (ex: Joe above has two appts the same day).

If it helps with the looping logic, both arrays are in chronological order...My arrays will be on the order of 200-2000 "rows" line

Thanks...this this is really kicking my you-know-what with all of the possible "compares".
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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