ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formula question (https://www.excelbanter.com/excel-discussion-misc-queries/11535-formula-question.html)

Cachod1

Formula question
 
Am trying to set up a tracking sheet for equity trades. Have 4 possible
scenarios:
Long position with profit / Long position with loss
Short position with profit / Short position with loss
Need a formula in my "Profit/Loss" column to reflect these four possibilities.
No idea how to do this, but logic is something like this:
(short position with loss):
If A1="short", and sum of (g1 - d1) is a positive number, then end result
in my "Profit/Loss" will be a Loss and so calculation needs to show up as a
negative number.
(short position with profit):
If A1="short", and sum of (g1-d1) is a negative number, then end result in
"Profit/Loss" column with be a Profit and so needs to show up as a positive
number.
(long position with profit):
If A1="long", and sum of (g1-d1) is a positive number, then end result is
profit/positive number
(long position with loss):
If A1="long", and sum of (g1-d1) is a negative number, then end result is
loss/negative number.

Would greatly appreciate any help!

JE McGimpsey

One way:

=(G1-D1)*IF(A1="long",1,-1)

In article ,
"Cachod1" wrote:

Am trying to set up a tracking sheet for equity trades. Have 4 possible
scenarios:
Long position with profit / Long position with loss
Short position with profit / Short position with loss
Need a formula in my "Profit/Loss" column to reflect these four possibilities.
No idea how to do this, but logic is something like this:
(short position with loss):
If A1="short", and sum of (g1 - d1) is a positive number, then end result
in my "Profit/Loss" will be a Loss and so calculation needs to show up as a
negative number.
(short position with profit):
If A1="short", and sum of (g1-d1) is a negative number, then end result in
"Profit/Loss" column with be a Profit and so needs to show up as a positive
number.
(long position with profit):
If A1="long", and sum of (g1-d1) is a positive number, then end result is
profit/positive number
(long position with loss):
If A1="long", and sum of (g1-d1) is a negative number, then end result is
loss/negative number.

Would greatly appreciate any help!



All times are GMT +1. The time now is 06:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com