Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Hi I recently purchased Numbers in order to create a trading journal. I'm getting away from pen and paper. I need help to create a formula. One column Buy/Sell determines if entry price column is subtracted from exit price column or exit subtracted

Hi I recently purchased Numbers in order to create a trading journal. I'm getting away from pen and paper. I need help to create a formula. One column Buy/Sell; determines if the entry price column is subtracted from the exit price column (Buy) or exit subtracted from the entry (Sell). Thank you for your help

MacBook Pro, OS X El Capitan (10.11.4)

Posted on Apr 27, 2016 7:33 PM

Reply
Question marked as Best reply

Posted on Apr 28, 2016 6:10 PM

Hi B',


Buy/Sell in column B

Entry price in column C

Exit price in column D

Formula (and result) in column E


If column B will always contain either "Buy" or "Sell", this will work. It defaults to a 'sell' calculation if neither Buy or Sell has been specified.

E2: =IF(B="Buy",D-C,C-D)


If you want to delay calculation until amounts have been entered in both C and D, use this version:

E2: =IF(OR(LEN(C)<1,LEN(D)<1),"",IF(B="Buy",D-C,C-D))


If you want to delay calculation until all three ducks are in a row (B contains Buy or Sell, C and D both contain data), use this version:

E2: =IF(OR(LEN(C)<1,LEN(D)<1),"",IF(B="Buy",D-C,IF(B="Sell",C-D,"")))


Third version used in this table.

User uploaded file

Regards,

Barry

1 reply
Question marked as Best reply

Apr 28, 2016 6:10 PM in response to Bubbamoto

Hi B',


Buy/Sell in column B

Entry price in column C

Exit price in column D

Formula (and result) in column E


If column B will always contain either "Buy" or "Sell", this will work. It defaults to a 'sell' calculation if neither Buy or Sell has been specified.

E2: =IF(B="Buy",D-C,C-D)


If you want to delay calculation until amounts have been entered in both C and D, use this version:

E2: =IF(OR(LEN(C)<1,LEN(D)<1),"",IF(B="Buy",D-C,C-D))


If you want to delay calculation until all three ducks are in a row (B contains Buy or Sell, C and D both contain data), use this version:

E2: =IF(OR(LEN(C)<1,LEN(D)<1),"",IF(B="Buy",D-C,IF(B="Sell",C-D,"")))


Third version used in this table.

User uploaded file

Regards,

Barry

Hi I recently purchased Numbers in order to create a trading journal. I'm getting away from pen and paper. I need help to create a formula. One column Buy/Sell determines if entry price column is subtracted from exit price column or exit subtracted

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.