Inter Linking Several columns

economicaas

New Member
Joined
Jun 19, 2018
Messages
1
Hello Add

New member here and trying to work with excel. I am sorry if I make mistake the way, I am really new to this.

What I am trying to do is: Inter link two order books ( as in an exchange) of two currency pairs; using price and volume. I have tried several times to work out a formula, but if it works for a particular situation it does not work when I change the volume. ( I am testing out my idea on excel, however, all of this will actually be on an online exchange)

I hope someone good with numbers can help me here:

Here is a preview of the issue I am facing

EFGHJK
CommentCurrency A/C PriceCurrency A/C VolumeCurrency B/C PriceCurrency B/C VolB/A PriceB/A Volume
Sell order 10.0000249211,0000.0000066310,000B
Sell order 20.00002491140,0000.0000066243127A
Market Price
3
0.00002490-0.00000661-
Buy Order
4
0.0000248910,0000.00000661100,000
Buy Order
5
0.0000248750,0000.0000066400,000

<tbody>
</tbody>


Now what I am trying to do is somehow formula these price to B/A. Price at A I calculate using =0.00002491/0.00000661 which comes to 3.7685 B for each A. However, the volume at this price is limited either by the 100,000 volume of B or 140,000 volume of A. So I use the formula =MIN((E2*F2)/G3, H4) giving me answer of 100,000. Meaning only 100,000 of B are available, at this price. Since 100,000 is all out, I need to move automatically to the row beneath containing 400,000 of B. At the same time, I need to calculate how much of 140,000 of currency A has been left for the next price at point B.
At point B, system automatically realized that all 100,000 at H4 has been used. And we have around 113,464 left out of 140,000 (F2) (also calculated with formula). So now next price should be: =E2/G5 and volume here needs to be minimum of H5 or left over of F2 converted in currency B.

I need formulas such changing the the value at H4 to 1,000,000 the system realizes that now limit of volume comes from F2 now and max vol shown in K2 is now limited to currency A volume converted into currency B.


I am sorry if I made it complicated, I will be more than happy to clarify any details if some one is kind enough to help.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

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