I have 2 files I need to compare.... a buyer file and a seller file.

BUYER A B C D
1 PRODUCT NUMBER DESC QTY 12MOS
2 123 NUT 25 75
3 456 BOLT 50 100
4 789 SCREW 10 80


SELLER A B
1 PRODUCT NUMBER QTY
2 465 67
3 789 125
4 457 65


Step 1: Compare Product Numbers and look for common products on both files
Step 2: Calculate how many items I should recommend the Buyer to buy. For Example: Product 789 is on both files. The buyer has 10 in stock and sells 80 in a year. So to bring him up to a years worth of inventory, I would recommend he buy 70 from the Seller.

The gotcha is that the Buyer file could have anywhere from 20k - 30k lines of different products. The seller may only have 50-100 different lines. Also.. there could be multiple common part numbers in which case we would want to suggest buys for all the part numbers that match.

Anyone know the easiest way to do this?