+ Reply to Thread
Results 1 to 6 of 6

If Then Statement with Profit / Loss

  1. #1
    Registered User
    Join Date
    11-11-2019
    Location
    Scottsdale, AZ
    MS-Off Ver
    Office 365
    Posts
    19

    If Then Statement with Profit / Loss

    With daily trading, we have a moving average following the trades. If the profit was positive on Monday and higher than the moving average, we want to reduce Tuesday's P/L by 25%. If the profit was negative on a Monday and lower than the moving average, we want to increase Tuesday's P/L by 75%. This is assuming we are trading at 50% to start with.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-26-2020
    Location
    Hong Kong
    MS-Off Ver
    Office 19
    Posts
    3

    Re: If Then Statement with Profit / Loss

    You could make two columns: a column for raw data and a column for processed data which you will apply your IF statement.
    To do it, you can have a Nested IF statement, i.e. another IF in your [value_if_false], so that the spreadsheet will proceed to the second condition once your first condition failed. Then on your statement, you could clearly show out "reduce 25% or 75%".
    To find out more, you can search "Excel for Marketers #11 How to use IF function to do Quick Analysis" on youtube.
    Enjoy!

  3. #3
    Registered User
    Join Date
    11-11-2019
    Location
    Scottsdale, AZ
    MS-Off Ver
    Office 365
    Posts
    19

    Re: If Then Statement with Profit / Loss

    =IF(D5="","",IF(D4="",D5,IF(D4>E4,D5*$A$3,D5)))
    =IF(D5="","",IF(D4="",D5,IF(D4<E4,D5*$B$3,D5)))

    How would I combine these two formulas?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: If Then Statement with Profit / Loss

    Maybe something like this?
    =IF(D5="","",D5*if(d4="",1,IF(D4>E4,$A$3,$B$3)))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    11-11-2019
    Location
    Scottsdale, AZ
    MS-Off Ver
    Office 365
    Posts
    19

    Re: If Then Statement with Profit / Loss

    That didn't work.... thank you though.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,420

    Re: If Then Statement with Profit / Loss

    There seems to be a contradiction with the formulas in post #3 which would make it hard to combine them.
    The first one indicates that if the value in D4 is equal to or less than the value in E4 then the formula should yield the value in D5.
    The second states that if the value in D4 is less than the value in E4 then the formula should yield the the product of D5 and B3.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot table profit and loss by month - calculate gross profit and gross profit %
    By parkviewfinance in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-26-2020, 02:34 AM
  2. Help with win loss and tie column & adding profit based on win or loss.
    By schroeder641 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-25-2016, 03:41 PM
  3. 1. consecutive days of profit and of losses 2. biggest profit loss since date
    By xbohemianx in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-14-2013, 12:57 PM
  4. Profit/loss targets
    By calhawk01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-11-2013, 04:03 PM
  5. Profit and Loss
    By marcolanni in forum Excel General
    Replies: 5
    Last Post: 07-05-2010, 08:39 AM
  6. Profit & loss
    By casio in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2009, 08:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1