# Capture Highest & Lowest Value

#### hsandeep

##### Well-known Member
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?

#### jasonb75

##### Well-known Member
If I understand what you want correctly then this should do what you need.

First go to options in the excel File menu, on the Formulas tab check the box that says 'Enable iterative calculation' and click OK.

In B4, =IF(B3=1,IF(B4=0,B2,MIN(B4,B2)),0)
In B5, =IF(B3=1,IF(B4=0,B2,MAX(B4,B2)),0)

#### hsandeep

##### Well-known Member
Code be given to work out the solution

#### jasonb75

##### Well-known Member
Don't think that the iterations will work correctly with vba.

#### hsandeep

##### Well-known Member
I want precision & not going to make my Excel adjust with iteration

#### jasonb75

##### Well-known Member
Have you tried it?

Using code (if it works) will not be any more precise.

#### hsandeep

##### Well-known Member
I tried but couldn't find the correct answer so approached this site

#### jasonb75

##### Well-known Member
I meant have you tried what I suggested?

That is more likely to work correctly than vba!

#### hsandeep

##### Well-known Member
Someone can use helpful columns or rows to achieve the result. Note the flaf remains for 30 minutes sharp when started

#### hsandeep

##### Well-known Member
Can someone give me code I can 'Put a cap' on the Max Value at 1000 & Minimum Value at 1

1,082,360
Messages
5,364,927
Members
400,815
Latest member
Joaquin Phoenix

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...