Tuesday 9 April 2013

Excel formula help...?

Posted by Unknown at 03:07

Excel formula help...?

Question by boytorespect: Excel formula help...?
I would like to know if this is even possible and how i can do it. I trade forex for a living and want to create a spreadsheet to do certain calculations... Lets say i have 4 columns right, A1, B1, C1 and D1. In A1, i will type in either buy or sell. In B1 i will put in the opening price, lets say 1 for example. C1 will contain closing price, lets say 2 for example. And D1 will show the difference in open and close price. This is easy and i know how to do it but how do i do it so that it shows a positive or negative number depending on the text in A1. For example, If a1 is buy, b1 is 1, c1 is 2 then d1 will show -1 but in actual fact it was a profit so it should show 1... i dont know if you guys will understand me lol

Best answer:

Answer by Greg G
If column B always contains your buy price, and C will always have the close (price you would get if you sold..) this will work for you:

=IF(A1="buy", C1-B1, B1-C1)

If A1 is blank, then it performs b1-c1. If you prefer the result cell to be blank if A1 is also blank:

=IF(A1="buy", C1-B1, IF(A1="sell", B1-C1,""))

Give your answer to this question below!


Post a Comment


Copyright © 2013 Forex Trading Advice | Web Hosting