We make local and import purchases.

We sell the items to domestic and overseas customers.

using FIFO method we want to find out the Receipt no. of purchase against each export.

for eg:

01-01-12 local purchase MRN 101A 200 nos.
01-02-12 import purchase MRN 102 A 300 Nos.

03-02-12 Export Sales MON 103A 250 Nos. (MRN 101 A - 200 nos. and MRN 102A -50 Nos.)

how to find out the code (MRN) of purchase against each sale using excel formulas?

pls help