I am trying to reconcile 2 input files - (1 is for "buys" and the other one is for "sells"). The idea is for each "buy" to be consumed by one or more "sell", if necessary or vice versa. So if the difference between the buy and the sell is negative (the sell amount is more than the buy amount) then the same "sell" is used by the next "buy" amount.
If the difference is positive (the buy amount is more than the sell amount) then the same "buy" is used by the next "sell" amount.
I looked at "santa's iterative macro" and looks like the way to go but i keep getting stuck due to the fact that i have 2 inputs.
Below is the screenshot of "sample" Input(s) and desired Output. TIA
Hi @Pravesh_G
The FIFO problem is an interesting one and I've built various versions of it in the past.
Attached is one for the example you posted. The key is to reduce all the buy and sell amounts to rows with a quantity of 1.
Have a look through the example and let me know if you have any questions.
Another way of solving it is to use an iterative macro. I can build one of those for you if you'd like, but I quite like this method.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |