+ Reply to Thread
Results 1 to 7 of 7

Trying to make a percent change formula

  1. #1
    Registered User
    Join Date
    01-18-2008
    Posts
    48

    Trying to make a percent change formula

    Hi, can someone help me with this formula for the percent change for the daily open vs the daily close for a stock

    For example, using the formula =(B2-D4)/B2 where B2 equals 16 and D4 equals 15.

    Open was $16 (B2) and close was $15 (D4) so this equals -6.25% when using the above formula, which is fine.

    Then if I change B2 to 15 and D4 to 16 and use the formula I get -6.7% when it should be a positive 6.7%. How can I make it so it would show as positive?

    If B2 is greater than D4 than the formula should spit out a negative value (IE 16-15/16 would equal -6.25%)
    If B2 is less than D4 than the formula should spit out a positive value (IE 15-16/15 would equal 6.67%)

    Your help is appreciated. Thanks
    Last edited by AdamW328; 11-03-2021 at 08:27 PM.

  2. #2
    Registered User
    Join Date
    07-25-2019
    Location
    Klaipeda, Lithuania
    MS-Off Ver
    Microsoft Office 2017
    Posts
    51

    Re: Help with simple formula

    One of the solutions is to use this formula: =if(B2>D4,-(B2-D4)/B2,(B2-D4)/B2).
    And if you want to highlight negative values go to Conditional Formatting (on Home Tab) > New Rule. Then select "Format only cells that contain". Then select cell value less then 0 and press "Format" button. Then you can change color of a cell or font for negative numbers

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,626

    Re: Help with simple formula

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,515

    Re: Help with simple formula

    Why not simply "Close" -"Opening" which (to my mind) is the logical relationship.
    Last edited by JohnTopley; 11-03-2021 at 06:14 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    01-18-2008
    Posts
    48

    Re: Help with simple formula

    Ghost12, ty for your response. I made an error on the formula and edited my original post. Can you please take a 2nd look.

    Or anyone else. Thanks and sorry for the confusion.
    Last edited by AdamW328; 11-03-2021 at 08:28 PM.

  6. #6
    Registered User
    Join Date
    07-25-2019
    Location
    Klaipeda, Lithuania
    MS-Off Ver
    Microsoft Office 2017
    Posts
    51

    Re: Trying to make a percent change formula

    That should work:
    =IF(B2>D4,-(B2-D4)/B2,ABS((B2-D4)/B2))

  7. #7
    Valued Forum Contributor
    Join Date
    07-13-2021
    Location
    California, USA
    MS-Off Ver
    2010
    Posts
    513

    Re: Help with simple formula

    Quote Originally Posted by AdamW328 View Post
    For example, using the formula =(B2-D4)/B2 where B2 equals 16 and D4 equals 15.
    Open was $16 (B2) and close was $15 (D4) so this equals -6.25% when using the above formula, which is fine.
    Quote Originally Posted by AdamW328 View Post
    I made an error on the formula and edited my original post.
    I don't know what you changed. But the formula that you have now (above) does not fit the facts in the description.

    In particular, (B2-D4)/B2 = (16-15)/16 = 1/16 = (positive) 6.25%, not -6.25%.

    In any case, the correct formula is simply =(D4-B2)/B2 or equivalently =D4/B2-1, formatted as Percentage.

+ 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. Replies: 1
    Last Post: 07-24-2019, 02:04 PM
  2. help on simple IF formula
    By concepcion.jensen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-10-2018, 02:49 AM
  3. Simple Formula When Input for Formula is null
    By ulala2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-25-2017, 10:27 AM
  4. [SOLVED] Need help with simple IF/THEN formula
    By Curious Dude in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2015, 01:26 PM
  5. Replies: 4
    Last Post: 12-07-2012, 11:49 AM
  6. [SOLVED] Formula--rather simple one
    By WandaSG in forum Excel General
    Replies: 5
    Last Post: 01-19-2006, 12:45 PM
  7. [SOLVED] Help with what should be a simple formula
    By B Millar via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 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