Capture Highest & Lowest Value

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
B2 gets updated by values due RTD
B3 I have kept a flag which becomes 1 for a certain time period (ONLY ONCE DURING A DAY)
Solution required:
B4=HIGHEST VALUE of B2 when B3=1 else 0
B5= LOWEST VALUE of B2 when B3=1 else 0
How to accomplish?
Thanks in adv
 
Someone from this forum is requested to give me vba code

you can adjust by adding helper columns or rows to achieve the desired result
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
To get the solution I'll Add 1 more constraint that B2 will get updated for a maximum 30000 values when B3=1
 
Upvote 0
I have tried using the below code....but 'not satisfactory' Can someone help further?

At the top of the code window, I used the two drop downs select Worksheet (in order to tell it I want a worksheet event) and then Change (to tell it I want the Worksheet_Change event. It auto created a line with Private Sub Worksheet_Change(ByVal Target as Range) and looked something like this:








Dim rDynamic As Range
Dim rMax As Range
Dim rMin As Range


Set rDynamic = Me.Range("B2")
Set rMax = Me.Range("E2")
Set rMin = Me.Range("F2")


If Not Intersect(Target, rDynamic) Is Nothing Then
If rDynamic.Value < rMin.Value Then rMin.Value = rDynamic.Value
If rDynamic.Value > rMax.Value Then rMax.Value = rDynamic.Value
End If
 
Upvote 0
Can someone look into my code and tell me what mistake I am making
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top