+ Reply to Thread
Results 1 to 13 of 13

Highest and Lowest Value

  1. #1
    Registered User
    Join Date
    08-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Highest and Lowest Value

    Hi

    I've got a sheet linked to some live data that is constantly updating. I'd like to record the highest / lowest value in a single cell without it being written over i.e record the highest value and if there is another value lower it wont overwrite it.

    I've tried using the =max or =min but whenever a newer value appears in the cell it just follows that without keeping the higher value?

    Thanks

    Kingo

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Highest and Lowest Value

    You could use iteration to permit circular references, in Excel Options turn on Iteration with Max Iteration set to 1... if we assume update is in cell A1, MAX to be held in B1, MIN in C1 then:

    B1: =MAX(A1,B1)

    C1: =MIN(A1,C1)

    NOTE: If the value in A1 never drops below 1 you need to alter the approach for C1 as it will initially populate with 0, say:

    C1: =MIN(A1,IF(C1,C1,A1))

  3. #3
    Registered User
    Join Date
    08-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Wink Re: Highest and Lowest Value

    Thank you, that seems to work fine but when I close the file down and reopen it I get #N/A in all those columns?

    Quote Originally Posted by DonkeyOte View Post
    You could use iteration to permit circular references, in Excel Options turn on Iteration with Max Iteration set to 1... if we assume update is in cell A1, MAX to be held in B1, MIN in C1 then:

    B1: =MAX(A1,B1)

    C1: =MIN(A1,C1)

    NOTE: If the value in A1 never drops below 1 you need to alter the approach for C1 as it will initially populate with 0, say:

    C1: =MIN(A1,IF(C1,C1,A1))

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highest and Lowest Value

    untried on live data but this may work
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    08-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Highest and Lowest Value

    Sorry Martin, is this a solution for the original question or will this solve the #N/A - if yes how/where do I enter this?

    Many thanks



    Quote Originally Posted by martindwilson View Post
    untried on live data but this may work
    Please Login or Register  to view this content.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highest and Lowest Value

    er had a problem with that code when i tried to add min to it workbook crashed!!!!

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Highest and Lowest Value

    Kingo, it might be an idea if you could elaborate regards your actual setup... into which cells are the updates occurring ? into which cells do you intend to store MAX/MIN values - ie is each row a separate quote and thus each row has it's own MIN/MAX etc...

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highest and Lowest Value

    yep i was about to ask the same thing if its only one cell then its a tad easier!
    trouble with min is 0

  9. #9
    Registered User
    Join Date
    08-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Highest and Lowest Value

    Ok the first JPG shows the active price area and the arrows show where the min and max values are being recorded, that seems to work ok.

    The 2nd image shows the sheet once's its reopened and that it hasnt updated

    Let me know if you need anything further, thanks.
    Attached Images Attached Images

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highest and Lowest Value

    oh well not at all how i envisaged it! a workbook is worth a 1000 words! back to donkeyote for the iterations then

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Highest and Lowest Value

    out of curiosity - what happens if you alter the formulae such that:

    A27: =MIN(IF(ISNUMBER(E27),E27),IF(A27,A27,IF(ISNUMBER(E27),E27)))
    B27: =MAX(IF(ISNUMBER(E27),E27),B27)

    Does the same issue persist ?

  12. #12
    Registered User
    Join Date
    08-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Highest and Lowest Value

    Will try later in the week, in meetings till then, thanks.

    Quote Originally Posted by DonkeyOte View Post
    out of curiosity - what happens if you alter the formulae such that:

    A27: =MIN(IF(ISNUMBER(E27),E27),IF(A27,A27,IF(ISNUMBER(E27),E27)))
    B27: =MAX(IF(ISNUMBER(E27),E27),B27)

    Does the same issue persist ?

  13. #13
    Registered User
    Join Date
    08-04-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Highest and Lowest Value

    Not sure that formula made the values stick as previously. I've found if I open two copies of the same file - the first one does'nt link through but the second one always does...weird but it seems to do the trick...

    Quote Originally Posted by DonkeyOte View Post
    out of curiosity - what happens if you alter the formulae such that:

    A27: =MIN(IF(ISNUMBER(E27),E27),IF(A27,A27,IF(ISNUMBER(E27),E27)))
    B27: =MAX(IF(ISNUMBER(E27),E27),B27)

    Does the same issue persist ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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