Hi.
I've been debating on how to do this but so far couldn't find a way.
I have 3 columns, A, B and C.
Column A show my buy and sell orders.
Column B show how many products I bought and sold
Column C show the price at which I bought and sold
My goal is to sort columns A, B and C and transfer that sorted data into Column D and E.
My reading at this is as follow, if A2 = Buy or Sell then copy C2 to D2 or E2. 1 product sold, nothing more to do.
Now the problem comes in B2 where I have 2 products sold. I need to have 2 times the price which I sold that product into the list.
Also, the orders need to be aligned, meaning, first order was a buy then go to the first row on Buy column. Second order was a sell then goes to first row of Sell column.
How to do all this?
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]BUY[/TD]
[TD]SELL[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]1[/TD]
[TD]2803[/TD]
[TD]2803[/TD]
[TD]2803.25[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]2[/TD]
[TD]2803.25[/TD]
[TD]2803[/TD]
[TD]2803.25[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]3[/TD]
[TD]2804.5[/TD]
[TD]2803[/TD]
[TD]2804.50[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]3[/TD]
[TD]2804.25[/TD]
[TD]2803.25[/TD]
[TD]2804.50[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]2[/TD]
[TD]2803[/TD]
[TD]2803.25[/TD]
[TD]2804.50[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]5[/TD]
[TD]2803.25[/TD]
[TD]2803.25[/TD]
[TD]2804.25[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]2[/TD]
[TD]2803.75[/TD]
[TD]2803.25[/TD]
[TD]2804.25[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]2[/TD]
[TD]2805[/TD]
[TD]2803.25[/TD]
[TD]2804.25[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2805[/TD]
[TD]2803.75[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2805[/TD]
[TD]2804.75[/TD]
[/TR]
</tbody>[/TABLE]
Thank you for the help.
Regards
I've been debating on how to do this but so far couldn't find a way.
I have 3 columns, A, B and C.
Column A show my buy and sell orders.
Column B show how many products I bought and sold
Column C show the price at which I bought and sold
My goal is to sort columns A, B and C and transfer that sorted data into Column D and E.
My reading at this is as follow, if A2 = Buy or Sell then copy C2 to D2 or E2. 1 product sold, nothing more to do.
Now the problem comes in B2 where I have 2 products sold. I need to have 2 times the price which I sold that product into the list.
Also, the orders need to be aligned, meaning, first order was a buy then go to the first row on Buy column. Second order was a sell then goes to first row of Sell column.
How to do all this?
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]BUY[/TD]
[TD]SELL[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]1[/TD]
[TD]2803[/TD]
[TD]2803[/TD]
[TD]2803.25[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]2[/TD]
[TD]2803.25[/TD]
[TD]2803[/TD]
[TD]2803.25[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]3[/TD]
[TD]2804.5[/TD]
[TD]2803[/TD]
[TD]2804.50[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]3[/TD]
[TD]2804.25[/TD]
[TD]2803.25[/TD]
[TD]2804.50[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]2[/TD]
[TD]2803[/TD]
[TD]2803.25[/TD]
[TD]2804.50[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]5[/TD]
[TD]2803.25[/TD]
[TD]2803.25[/TD]
[TD]2804.25[/TD]
[/TR]
[TR]
[TD]Sell[/TD]
[TD]2[/TD]
[TD]2803.75[/TD]
[TD]2803.25[/TD]
[TD]2804.25[/TD]
[/TR]
[TR]
[TD]Buy[/TD]
[TD]2[/TD]
[TD]2805[/TD]
[TD]2803.25[/TD]
[TD]2804.25[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2805[/TD]
[TD]2803.75[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2805[/TD]
[TD]2804.75[/TD]
[/TR]
</tbody>[/TABLE]
Thank you for the help.
Regards
Last edited: