+ Reply to Thread
Results 1 to 3 of 3

persistant value in the cell

  1. #1
    Registered User
    Join Date
    01-02-2024
    Location
    USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    23

    persistant value in the cell

    Hello,

    I want to monitor the buying and selling activity of a stock using Excel.

    1. If the current stock price falls below a specified buy price, I want a column (let's call it "Bought") to display "Y." This "Y" should persist unless someone manually removes it.

    2. If the current stock price rises above a specified sell price, I want another column (let's call it "Sold") to display "Y." Like "Bought," this "Y" should persist unless manually deleted.

    Stock formula.png

    Column G reflects changes as the current stock price fluctuates.

    What's working:
    The attached formula functions correctly when the current stock price falls below the buy price. In this case, the "Bought" column (J) displays "Y."

    What's not working:

    1. If the stock price surpasses the buy price, the "Bought" column (J) shows null, even though a purchase was made.
    2. Similarly, when the stock price exceeds the selling price, the "Sold" column (K) displays null due to the scenario where "Bought" is null.

    Table displaying expected behavior

    Here is a table illustrating the anticipated behavior of the "Bought" and "Sold" columns in response to changes in the stock price:

    Stock Table.png

    The "Bought" column is set to "Y" as soon as the current stock price falls below the buy price, and it remains as "Y."
    The "Sold" column is marked as "Y" when the current stock price exceeds the sale price, and "Bought" is also marked as "Y."

    I appreciate your guidance. Thank you in advance.

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: persistant value in the cell

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

    Administrative Note:

    Is your forum profile showing the Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    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.

  3. #3
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: persistant value in the cell

    I think you will need a macro for that since a function will look of the current price in G5 and not in past values.

+ 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. [SOLVED] When one cell equals value of another cell, then third cell displays text of fourth cell?
    By spookymyo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2021, 02:12 PM
  2. Persistant variable from an input box
    By jm594 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2019, 10:59 AM
  3. [SOLVED] cell a function doing math on previous sheet, cell b - cell c result in cell d...
    By dad812 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-08-2018, 08:20 AM
  4. Persistant Menu from Uninstalled Add-In
    By pixeldrdoid in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-08-2017, 03:45 PM
  5. [SOLVED] How to create/run "cell A equals Cell B put Cell C info in Cell D
    By abmb161 in forum Excel General
    Replies: 7
    Last Post: 02-05-2014, 02:20 AM
  6. [SOLVED] Zoom to selction-Persistant?
    By exarranum in forum Excel General
    Replies: 7
    Last Post: 04-30-2013, 03:13 AM
  7. Replies: 1
    Last Post: 11-03-2012, 09:05 PM

Tags for this Thread

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