Frustrating Formula, Need Help!

scliollio

New Member
Joined
Feb 22, 2017
Messages
6
Hey there,

Basically I have a tedious routine process that I think can be simplified by having excel do it for me in a formula. Only issue is that I'm not too great with these.

Any help would be greatly appreciated!!

The process is as follows:
  • I receive a spreadsheet everyday with many columns of data (~20), but I'm only concerned with a few of them
  • Everyday I must compare the "new" report with the "old" report
  • There is a unique field called "KEY ID" , a value field called "GSV", and another field called "Tank"
  • I manually go through and look for new KEY ID's (ones that appear on the new but not the old), if there is a new one, then it must be inserted directly below the previous KEY ID
  • Also if any of the GSV's have changed, then I must copy all of the "New" data (the ~20 fields) and paste it over the "Old" data (basically replace the line of data)
  • You cannot simply copy and paste all of the new data over the old data because they are sorted by tanks and it must remain in the order of the "old" (with the exception of new IDs being inserted)

Surely there is a formula(s) which can do this!

Essentially I need the formula to do the following

  1. Compare Line 1 "KEY ID" OLD with Line 1 "KEY ID" NEW
  2. If KEY ID's are different, insert new KEY ID and all associated data from NEW doc below Line 1
  3. If KEY ID's are the same, compare GSV values, if GSV value's differ, replace OLD docs line 1, with NEW docs line 1
  4. Repeat steps 1-3 for next line (continue to repeat until finished)


Attempting to type an example:[TABLE="width: 594"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 3"]OLD
[/TD]
[TD][/TD]
[TD="colspan: 3"]NEW
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Tank
[/TD]
[TD]Key ID
[/TD]
[TD]GSV
[/TD]
[TD][/TD]
[TD]Tank
[/TD]
[TD]Key ID
[/TD]
[TD]GSV
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1001
[/TD]
[TD]566
[/TD]
[TD] 11,514.60
[/TD]
[TD][/TD]
[TD]1001
[/TD]
[TD]566
[/TD]
[TD] 11,684.20
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1002
[/TD]
[TD]532
[/TD]
[TD] 19,549.80
[/TD]
[TD][/TD]
[TD]1002
[/TD]
[TD]532
[/TD]
[TD] 19,549.80
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1003
[/TD]
[TD]544
[/TD]
[TD] 8,557.40
[/TD]
[TD][/TD]
[TD]1003
[/TD]
[TD]544
[/TD]
[TD] 8,557.40
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1004
[/TD]
[TD]589
[/TD]
[TD] 14,522.40
[/TD]
[TD][/TD]
[TD]1003
[/TD]
[TD]545
[/TD]
[TD] 9,025.10
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1004
[/TD]
[TD]566
[/TD]
[TD] 21,901.50
[/TD]
[TD][/TD]
[TD]1004
[/TD]
[TD]589
[/TD]
[TD] 14,522.40
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1006
[/TD]
[TD]502
[/TD]
[TD] 12,156.80
[/TD]
[TD][/TD]
[TD]1004
[/TD]
[TD]566
[/TD]
[TD] 21,901.50
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1006
[/TD]
[TD]502
[/TD]
[TD] 12,036.70
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1006
[/TD]
[TD]503
[/TD]
[TD] 14,177.60
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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