# Thread: Calculating Max and Min Value of RTD without capturing them.

1. ## Calculating Max and Min Value of RTD without capturing them.

Hi, I trade in stocks using RTD function in my excel sheet.
Can anyone tell me if there is any way to store the maximum and minmum value of RTD (which are always updating continuously) of a particular time-period without storing them.
To be specific, In my excel sheet, from 10:00 am to 10:05 am I get RTD values. Now I want to know the highest (lowest or average) value within this time, without storing them continuously in excel sheet.

Actually by continuously storing value in excel sheet, the sheet gets pretty big in size.

2. Hello Tuhin Paul,

Welcome!

I noticed you post this same question in another forum earlier today. Most forums have rules about posting the same question in multiple forums, known as cross-posting. Please take the time to read the forum's rules once you have become a member. It will help get your questions answered quickly and correctly.

Question cross-posted Excel Forum

3. With Range("A1")
If .Value = 0 Then
.Value = RTD
Else
.Value = Min(.Value, RTD)
End If
End With

Range("B1") = Max(Range("B1"), RTD)
Range("C1") = Range("C1") + RTD
Range("D1") = RTD_Count
Range("E1") = Range("C1") \ Range("D1") 'Average RTD

4. Originally Posted by Leith Ross
Hello Tuhin Paul,

Welcome!

I noticed you post this same question in another forum earlier today. Most forums have rules about posting the same question in multiple forums, known as cross-posting. Please take the time to read the forum's rules once you have become a member. It will help get your questions answered quickly and correctly.

Question cross-posted Excel Forum
Sorry Leith, I didn't know that I thought I would get quicker and better reply if I post this question at multiple blogs...

5. Thanks SamT, for your contribution. What is .Value function is actually doing here. If the RTD value is in negative (in case of RTD of Spreads) will it work?

6. ```Dim Foo As Range

With Foo
'All below relates to Foo: Because "With."
.Value = Bar   'Value is a Property of a Range
End With   '(Not using Foo now)```
The leading Dot ( .) inside the With... End With relates Properties and Methods to the Object (Foo,) that the With is concerned about.

For example:
```Dim Foo As Collection

With Foo