+ Reply to Thread
Results 1 to 9 of 9

How to save highest value in a continually changing cell

  1. #1
    Registered User
    Join Date
    09-07-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    How to save highest value in a continually changing cell

    I have a worksheet that includes DDE links that display the latest price of some currencies in column K. Column K is continually changing.

    I want to add another column that displays the highest value that column M gets to but whatever I try doesn't work or I get a circular reference error.

    How do I do this please? Sample worksheet attached.

    Bob
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,892

    Re: How to save highest value in a continually changing cell

    Can you allow iteration, or are you forbidden from using circular references for this? I suggested a circular reference kind of solution for this kind of problem in other cases:
    https://www.excelforum.com/excel-pro...-possible.html
    https://www.excelforum.com/excel-for...ging-cell.html
    https://www.excelforum.com/excel-gen...amic-cell.html
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    09-07-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: How to save highest value in a continually changing cell

    Thanks for the reply MrShorty, much appreciated.

    I have set Maximum Iterations to 1 and Maximum Change to .01

    I changed cell M3 from
    =IF(K3>50,L3*100,L3*10000) to =MAX(M3,IF(K3>50,L3*100,L3*10000))

    This works exactly as I wanted but there are 2 problems.

    1. When I copy M3 down to the other cells in the column, it shows the M3 value if the other cells are less that M3. If the value in the other cells is greater than M3 the copy is ok. You will see in the pic below that cell M4 is ok but the rest are incorrect.

    2. If I add the Max function to a formula in M column that has a negative value it shows the maximum value as zero. I need it to show that -1.123 is greater than -1.135 for example.

    3099ca640091f62f2b79feaf77ce5b66.png

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,892

    Re: How to save highest value in a continually changing cell

    In at least one of those threads, I talked about adding "reset criteria" to the function so that you can reset a MAX() function to a very small value before beginning/resuming tracking the maximum. Did you have any luck implementing some kind of reset in these functions?

  5. #5
    Registered User
    Join Date
    09-07-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: How to save highest value in a continually changing cell

    I did briefly read that but didn't really understand it. I will have another read.

  6. #6
    Registered User
    Join Date
    09-07-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: How to save highest value in a continually changing cell

    I certainly don't fully understand reset criteria but I have changed M3 to =IF(M3=0,-5000,MAX(M3,IF(K3>50,L3*100,L3*10000)))

    If I copy that to the rest of of the rows I get the same result as previous.

    I should mention that the only time I need to reset is when I first add a new row. The processing in that row will continue for a day up to a few months. When I see the result I am looking for (good or bad) I will clear the DDE link for that row.

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,892

    Re: How to save highest value in a continually changing cell

    Here's what I did to add a manual reset:

    0) I wasn't sure what to put in column K to simulate your data feed, so I just entered =RAND() into K3:K11. This was just for me so I could have a changing value to test with.
    1) Enter TRUE or 1 or something in M1.
    2) Nest the formula from post #6 inside of another IF() function =IF(M$1,-1e9,current IF()) in M3. -1E9 is an arbitrary very small number that I assume is smaller than any number you will ever see. Adjust as needed.
    3) Copy into M11 -- all should read -1E9 as long as M1 is true.
    4) Delete M1 or enter FALSE or 0 into M1. All entries should start to track the largest value (unless it is somehow possible for the value one of them is tracking to be less than -1E9).
    5) Anytime you want to reset, enter something other than FALSE/0 into M1. If you want to reset each row separately, simply have a reset cell in each row and reference that.

    Is that something you can work with?

  8. #8
    Registered User
    Join Date
    09-07-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: How to save highest value in a continually changing cell

    Yes that seems to do the trick and I do need a reset for each row. I'll set it all up and try it for a day or so and let you know the result.

  9. #9
    Registered User
    Join Date
    09-07-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: How to save highest value in a continually changing cell

    Thanks for your help MrShorty, much appreciated.

    It's doing exactly what I wanted. It ran overnight and all results look exactly as expected.

    Cheers
    Bob

+ 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. how to continually rename tab from cell in another sheet
    By cvmelkus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2015, 03:11 PM
  2. Continuous changing cell values - record highest and lowest values in seperate cells
    By attienel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2013, 05:12 PM
  3. Changing Cell Value on Save
    By kasperblue in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2013, 09:06 AM
  4. Changing a cell value when Save
    By Gavin Ling in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2012, 10:31 AM
  5. Replies: 1
    Last Post: 01-10-2009, 08:38 AM
  6. Replies: 14
    Last Post: 06-25-2008, 09:34 AM
  7. How do I change a cell's background color randomly, continually?
    By Jim Jones in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2005, 09:08 PM

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