+ Reply to Thread
Results 1 to 9 of 9

how to find the lowest positive value on a constantly changing cell

  1. #1
    Registered User
    Join Date
    08-16-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    25

    how to find the lowest positive value on a constantly changing cell

    Hello guys,

    Hoping someone can help me with this formula. I have a cell with a number that constantly changes. I need to record and retain the minimum value the cell has ever been on another cell.

    So If A1 (the cell that frequently changes) changes to 10, 9, 8 today. A2 needs to display 8 unless A1 changes to a number lower than 8.

    I am using =MAX(A1,A2) to find the maximum value and it works perfectly. However the MIN formula doesn't. It only works on negative numbers.

    Any ideas would be appreciated.

    Thanks.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: how to find the lowest positive value on a constantly changing cell

    Did you want A2 reset each day?



    Right Click on the sheet name at the bottom of excel and select view code.

    Paste this code into the module that opens and close it.

    Please Login or Register  to view this content.

    With Date reset:-

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 05-15-2017 at 09:43 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    08-16-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: how to find the lowest positive value on a constantly changing cell

    mehmetcik, that works great. Thank you. Is there a way to make it a range or copy the formula down?

    Thank you.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: how to find the lowest positive value on a constantly changing cell

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

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

    Re: how to find the lowest positive value on a constantly changing cell

    If I may suggest an alternative to VBA, I might approach this using circular references with iteration enabled. Your problem sounds similar to this discussion a couple of months ago (https://www.excelforum.com/excel-pro...-possible.html ). Setting up the spreadsheet:

    1) A1 is your changing cell
    2) A2: Enter 1E9 (or other suitably large positive number) (This step is often not needed for MAX() functions -- is that why you say this won't work for MIN() is you forgot to initialize the loop?)
    3) A2: =MIN(A1,A2)

    That should be enough to do what you want to do. As I explain in other threads discussing iterative calculations, I don't like to leave a circular reference without some way to "reset the loop". Your OP implies that A1 will never be negative, so I might edit A2 to something like =IF(A2<0,1E9,MIN(A1,A2)). Think through what to put in the condition argument so that you get the right kind of check there so the function can reset appropriately. You can also expand the idea to include other reset conditions to handle whatever situations you need to include when testing for reset.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    08-16-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: how to find the lowest positive value on a constantly changing cell

    Hello guys, thank you for the help. I tried to upload my excel file but the system wont let me. Please see attached image.

    MrShorty, I did try the formula you suggested before but I couldn't get it to work.

    help.jpg

    Thank you. :D

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

    Re: how to find the lowest positive value on a constantly changing cell

    "Couldn't get it to work" is not a very helpful result (for you or me). What did you try? What is it doing or not doing?

    Your picture shows it returning 0. Off the top of my head, two scenarios yield a 0 result.
    1) You have not yet enabled iteration, so Excel is returning 0 to indicate that it cannot resolve the circular reference.
    2) You neglected step 2, enter 1E9 in I2 before entering the formula. If I2 is blank before entering the formula, the Excel processes the formula:
    2a) Blank is interpreted as 0, so Is 0<0 (FALSE)
    2b) Since 0 is not less than 0, evaluate the value_if_false argument MIN(0,2500), which is 0. If J2 is never less than 0, then the formula will always return 0.

    Solution to 1 is to turn iteration on, go to step 2 to enter a large number in I2, then enter the formula in I2. Solution to 2 is to either initialize the loop by entering a suitable value in I2 before entering the formula, or thinking through the logic of the formula (in particular the "condition to test" argument), and see if there is a better choice for that test condition.

  8. #8
    Registered User
    Join Date
    08-16-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: how to find the lowest positive value on a constantly changing cell

    I did follow your instructions and changed the code to: =IF(H2=0,1000000000,MIN(I2,H2))
    The equal sign instead of the less than did the trick.

    Thank you for your help guys. I appreciate it.

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

    Re: how to find the lowest positive value on a constantly changing cell

    Glad that worked. I recommend before you declare this finished that you think through that some more, maybe test it with the full range of possible inputs. If a negative number is ever inadvertently entered into I2 (if it is even possible for I2 to receive a negative value), for example, that value will be the minimum value, and will get stuck there until you do something to it. Be sure to think through the full range of possible scenarios and make sure you know what will happen in those scenarios.

+ 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. Freezing a cell Value (constantly changing) after Condition is met
    By desiredoom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2016, 03:27 AM
  2. Variable that is constantly changing
    By coys1717 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-12-2014, 11:39 AM
  3. [SOLVED] Trying to SUM a constantly changing schedule.
    By josebaptista in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-17-2013, 06:49 AM
  4. Find the max value of one constantly changing cell
    By Consty1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2012, 10:50 AM
  5. Replies: 1
    Last Post: 04-15-2011, 11:38 AM
  6. Web Query Help:changing constantly.
    By Rubbadub in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-25-2008, 02:48 PM
  7. [SOLVED] get lowest positive number
    By Tommy in forum Excel General
    Replies: 12
    Last Post: 05-17-2005, 01:06 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