Forum Discussion
william palmer
Jun 05, 2021Copper Contributor
FORMULA TO MATCH SHORT OR LONG STOCK PURCH PRICE TO CURRENT PRICE -GAIN/LOSS
TRYING TO DEVELOP FORMULA THAT WILL TELL WHETHER I HAVE A GAIN OR LOSS ON A TRANSACTION IN EACH ROW AND IT WILL POSSIBLY VARY BET SEQUENTIAL ROWS as to short " S" and long "L"AND IF IT IS A SHORT P...
SergeiBaklan
Jun 06, 2021Diamond Contributor
Sorry, I skipped major past of the post, it's practically impossible to read the text in All Caps. As I understood the question is in this errors
returned by
=IF(AND(I19="S",G19>F19),
F19-G19,
F19-G19),
IF(AND(I19="L",F19>G19),
F19-G19,
F19-G19
)
Formula itself is incorrect, perhaps you mean
=IF(AND(I19="S",G19>F19),
G19-F19,
IF(AND(I19="L",F19>G19),
F19-G19, ""
))- william palmerJun 07, 2021Copper ContributorSir - thank You for your effort in trying to decipher my problem presented all in caps.
-I feel ill at ease in operating and presenting in this environment, never having done so
-This testing that I am trying to accomplish, involves whether there is a short position, "S"For a long position, "L" in the column entitled "L/S". Unfortunately, the "S" did not show in the blanks cell To the right of the point where your red marker stopped. The pricing computation for a profit or loss in a short position is inapposite that the pricing computation for profit in a long position. When I use the 1st half of the formula with an =IF(AND) for the short position "S" and there is an "S" for that test in the "L/S" column the computation is accurate. I do not know how familiar you are with the computation for profit in a long position versus a short position. In a short position if the opening price is $3 and the current price is $4 . There is a loss and I have to subtract the $4 from the $3 to get the $1 negative (loss). On the other hand, if the current price is $2. I have a $1 gain by again subtracting the $2 from $3. This protocol works satisfactorily until I try to add the "IF(AND For a long position ("L") and when I do that I get an error in the "NOW$$DIFF" column. In a long position the computations for profit and loss are exactly opposite a short position. I cannot understand where my coating is bad when I try and join the 2 concepts, each performing 3 separate tests for profit and loss. If you have some wisdom I would greatly appreciate it because I am totally stumped-thanks Bill Palmer