+ Reply to Thread
Results 1 to 14 of 14

Retain Max value of Range in another Cell

  1. #1
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Retain Max value of Range in another Cell

    I hope someone can help me to resolve the following.
    I have a cell that changes its value constantly
    Let us say from 10 to 400,
    ..
    I want to retain the max/min value of the change into other cell whenever it reaches max or min ..( into Two diffrent Cells) With comparison of a mean number let us say Mean number would be 170
    ..
    Meaning if it goes beyond 170 it will be max number if >= 170
    Similarly opposite of it
    if it goes below 170 then it will be min number for example if it is <170
    ....
    so for example if i have as below
    Mean Number cell value set to 170
    Changing number column have 160 (but it was raised once earlier to 195 and gone down to 145) so
    Max number cell at present 195
    Min Number cell at present 145

    At any point of time if number is raised again mroe than 195 then it will remain there even the "Changing number column" changes back to lower value
    Similarly for 145..also in lower side

    Hope I could explain my requirement if not please let me know the required clarifications.
    Thanks a lot for all your help,
    Last edited by excelbaba; 05-10-2010 at 09:26 AM.
    Moeny Baba,
    You can not get everything with Moeny.
    ~~ ~~ ~~ ~~ ~~

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Retain Max value of Range in another Cell

    Not at all sure I understand, but try this in the worksheet module, and adjust A1.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    Hi Dear,
    Thank you for your help, I have solved the issue 30% (Started seeing some result)...
    Yes it retained its value in higher number like if I put 50 in A1
    It is coming into A2
    When I change down number no change in A2 (Good this is what I want) ..
    When I change 51 it is changing and remain there until a new Higher number comes ..
    Yes this is what I want.
    ....
    But the issue is If I put a value 25 in another Cell Let us say A4 as a Mean number.
    Then A2 should get Retain the bigger than the 25 (When ever A1 changes to higher) and
    A3 should retain the lesser than the 25 number (When ever A1 changes to Lower) .
    ...
    Hope you can help me on this.
    Thanks for your help.
    Baba.

  4. #4
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    is there any way we can do this directly on Worksheet instead of the VBA... if possible .. still no issue even for VBA..
    ...
    Thanks again for your help.

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Retain Max value of Range in another Cell

    Let's try to nail what you want first, then see if we can do it with formulae or not.

    In this line
    Then A2 should get Retain the bigger than the 25 (When ever A1 changes to higher)
    when you say
    When ever A1 changes to higher
    do you mean whenever A1 changes to a lower value than before or whenever A1 changes to below 25?

    Perhaps you can come up with some examples of what you want to happen, as I'm not sure I understand.

  6. #6
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    Let me put as an example as you instructed

    A1 -- Frequently Changing Number (Any number)
    A2 -- Retains Higher number from mean number {kept manually in A4 --- This changes every 12 Hours by Manually} whenever A1 Gets highest number
    A3 -- Retains Lower number from mean number in A4 {same as above} whenever A1 Gets Lowest number
    A4 - Manually keyin Mean Number (This will be keyed in every 12 hours a new latest number equal to A1 )

    ---Working Example
    At Process Starting
    Example A1 -- 27 and A4 (Mean Number given Manually) 30
    A2=30
    A3=27
    -- After a while A1 Changed to 35
    ... Then
    A2=35
    A3=27
    -- Again A1 Become 32 (No change in A2 and A3)
    A2 = 35
    A3=27
    -- A1 become 26
    A2=35
    A3=26
    -- A1 Become 32 (No change in A2 and A3)
    A2=35
    A3=26
    --A1 Become 24 (No change in A2 and A3)
    A2=35
    A3=26
    ---A1 Become 39
    A2=39
    A3=26
    ---A1 Become 25 (No change in A2 and A3)
    A2=39
    A3=26
    -- A1 Become 42
    A2=42
    A3=26
    .... So on....

    Hope I was able to feed the example for your kind understanding..
    Again Thanks for your help

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Retain Max value of Range in another Cell

    --A1 Become 24 (No change in A2 and A3)
    A2=35
    A3=26
    Shouldn't A3 become 24?

    Try this:
    Please Login or Register  to view this content.
    I'm not sure this can be done with formulae as it would require a cell to reference itself.

  8. #8
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    A little progress Made with your great help.
    ...
    you are correct it is my mistake in referencing to A3 to be 24 ... You are correct. Apologies
    ...
    Present issue for progressing from here
    is like
    ...
    1) It is not giving Any value in A3 though we change less than the A4 value ..(left with 0 Always)
    If it start A4=100 and A1 =10 it is giving A2=100 (Good and correct)
    2) And then we change the A4 after few testing’s ( Which is Working Good) to Higher value it is working good but where as if we change to lower value then it is not taking as new value for A4.
    ...
    Example:
    Start
    A4= 100
    ---
    Key in
    A1=10
    Then
    A2=100 (Good as Expected)
    A3=0
    ---
    ...... After a While A1=60 (No Change in A4=100)
    A2=100
    A3=0
    ..... A1 = 90 (No Change in A4=100)
    A2-100
    A3=0
    ----- A1=110
    A2=110
    A3=0
    .---- A1=90
    A2=110
    A3=0
    ---- A1=20
    A2=110
    A3=0
    ---- ========---------- Chang A4=50
    ---- A1= 40
    A2=110 Not getting value of A4 to A2 (Suppose to become)
    A3=0
    ----
    Now clear A2 Manually --- expected not to be done manually
    .....Keep A4=50 ( No need to change earlier step set value )
    -- Then A1=40
    .A2=50
    A3=0
    ....

    How ever ultimately now
    ...
    1) We are not getting A3 value changing in any point.
    2) A4 Value changes not taking effect to A2 automatically ...
    ..
    Please help to resolve at your best ...
    Great thanks to you for helping so far.

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Retain Max value of Range in another Cell

    OK, I will come back to this tomorrow. I've probably missed something obvious!

  10. #10
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    Great Help,
    Thanks for your consideration.

  11. #11
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Retain Max value of Range in another Cell

    This is causing me more difficulty than I anticipated, probably because I have a blind spot! I think this is nearer, but still not quite there I think.

    When you start from nothing there is 0 in A2 and 0 in A3. If you type 27 in A1 and 30 in A4 you get 27/30/27/30 which I think is correct. However, if you type 30 in A4 and then 27 in A1 you get 27/30/0/30 which I think is incorrect. Are you ever going to have negative values? If not, could build something in to change the rules when the minimum is zero.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    Hi,
    Thanks a Lot and much appreciated for your help ... thank you thank you.
    You are great you made it, Really ...
    Over exited ... let me check in a while and back to you,,,, probably a little more change requried as so far result seems to be but that is very small to you...
    ...
    Let me breath for the result seen.... will get back to you with thorough result in 30 Mnts .

  13. #13
    Registered User
    Join Date
    05-01-2010
    Location
    Vijayawada, India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retain Max value of Range in another Cell

    Hi,
    The solution is working very well and perfect.
    Great Help given, THANK YOU VERY MUCH.
    ....
    I have tested in every aspect and found perfectly working.
    ...
    No minus will be there at any point of time.
    ...
    I am just not dare enough to ask you If I want to do the same for b1/b2/b3/b4 what I should add in there .. pl advice if you dont mind.
    ..
    I thought to to close this with SOLVED as PREFIX...
    Never mind if you wish to have in a new thread for this 2nd row thing .. I can request you in new thread.
    ..
    Once again and again Thank you very much.

  14. #14
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Retain Max value of Range in another Cell

    My pleasure, glad we got there in the end.

    Please Login or Register  to view this content.

+ 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