Highest high & lowest low

cranmax

New Member
Joined
Jul 25, 2016
Messages
16
Hello everybody,

The excel must obtain the max value of a list of values, the range of values where it looks change depending on a constant.

Exercise: a list of 30 random values in column A; on C1 a "constant" like 3, 5, 10, 15. On column B the MAX value of 3 (A1:A3), 5 (A1:A5), 10 (A1:A10) and 15 (A1:A15) previous values. So theoretically the "constant" 3 (looks from A3 to A1) must start at B3 but I prefer to start since the first value at A1.
The MIN, I suppose is the same but changing a little bit the formula.
Ask me any questions.

Thanks.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hello everybody,

The excel must obtain the max value of a list of values, the range of values where it looks change depending on a constant.

Exercise: a list of 30 random values in column A; on C1 a "constant" like 3, 5, 10, 15. On column B the MAX value of 3 (A1:A3), 5 (A1:A5), 10 (A1:A10) and 15 (A1:A15) previous values. So theoretically the "constant" 3 (looks from A3 to A1) must start at B3 but I prefer to start since the first value at A1.
The MIN, I suppose is the same but changing a little bit the formula.
Ask me any questions.

Thanks.

I've done this using an additional column that evaluates whether the number is to be included, then using the max min functions on that column. So if the random values are in column A, in column B it would either show or hide the value in A depending on whether it meets the criteria of the constant.
 
Upvote 0
=MAX(INDEX(A:A,1):INDEX(A:A,C1))

which gives the maximum of the computet range in column A. C1 tells the end of the range starting from the first cell.
 
Upvote 0
=MAX(INDEX(A:A,1):INDEX(A:A,C1))

which gives the maximum of the computet range in column A. C1 tells the end of the range starting from the first cell.

Well, say C1 or "constant" is 5 then the formula outputs at B1 is looking forward, it looks for the five first values from A1:A5, I want that it looks just backwards so it have to start at A5 or to calculate the maximum of constant 1 at B1, 2,3,4 and 5 and then use just constant 5. So at B6 the formula with constant 5 looks A2:A6, at B7 looks A3:A7and gives the maximum, and compute the formula until the last value.
Hope this could clarify, thanks.
 
Upvote 0
Well, say C1 or "constant" is 5 then the formula outputs at B1 is looking forward, it looks for the five first values from A1:A5, I want that it looks just backwards so it have to start at A5 or to calculate the maximum of constant 1 at B1, 2,3,4 and 5 and then use just constant 5. So at B6 the formula with constant 5 looks A2:A6, at B7 looks A3:A7and gives the maximum, and compute the formula until the last value.
Hope this could clarify, thanks.

Would you care to post a small sample along with the desired results? Attachments lists a few methods for posting sample exhibits which do not require retyping and the add-in https://app.box.com/s/soezox25h3w0q5s4rcyl is also a method for posting an exhibit (Note that an image or a link to a storage site like dropbox or onedrive etc. does not provide a permanent record. Mind you a forum without a permanent record is not of much value.).
 
Upvote 0
Would you care to post a small sample along with the desired results? Attachments lists a few methods for posting sample exhibits which do not require retyping and the add-in https://app.box.com/s/soezox25h3w0q5s4rcyl is also a method for posting an exhibit (Note that an image or a link to a storage site like dropbox or onedrive etc. does not provide a permanent record. Mind you a forum without a permanent record is not of much value.).

Sorry but I'm posting this from Internet mobile,I can't access to Internet now. I have explained it on the photo.

 
Upvote 0
[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E​
[/TD]
[TD]
F​
[/TD]
[TD]
G​
[/TD]
[TD]
H​
[/TD]
[TD]
I​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD]RANDOM VALUES[/TD]
[TD]MAX[/TD]
[TD]CONSTANT[/TD]
[TD][/TD]
[TD]RANDOM VALUES[/TD]
[TD]MAX[/TD]
[TD]CONSTANT[/TD]
[TD][/TD]
[TD]THIS ARE 2 EXAMPLES; WHAT I WANT IS A FORMULA TO PUT ON COLUMN "MAX" THAT COMPUTES[/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
5​
[/TD]
[TD][/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
10​
[/TD]
[TD][/TD]
[TD]THE MAX OF THE N PREVIOUS VALUES, WHERE N IS THE CONSTANT.[/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]
6​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
6​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]SO WHEN I CHANGE THE VALUE OF THE CONSTANT, IT USES OTHER RANGE OF VALUES.[/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]
0​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
0​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD]
4​
[/TD]
[TD]
=MAX(A2:A6)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
4​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD]
2​
[/TD]
[TD]
=MAX(A3:A7)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
2​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD]
9​
[/TD]
[TD]
=MAX(A4:A8)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD]
8​
[/TD]
[TD]
=MAX(A5:A9)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD]
9​
[/TD]
[TD]
=MAX(A6:A10)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
9​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11​
[/TD]
[TD]
10​
[/TD]
[TD]
=MAX(A7:A11)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
10​
[/TD]
[TD]
=MAX(E2:E11)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
12​
[/TD]
[TD]
8​
[/TD]
[TD]
=MAX(A8:A12)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
=MAX(E3:E12)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
13​
[/TD]
[TD]
0​
[/TD]
[TD]
=MAX(A9:A13)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
0​
[/TD]
[TD]
=MAX(E4:E13)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
14​
[/TD]
[TD]
7​
[/TD]
[TD]
=MAX(A10:A14)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
7​
[/TD]
[TD]
=MAX(E5:E14)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
15​
[/TD]
[TD]
1​
[/TD]
[TD]
=MAX(A11:A15)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
1​
[/TD]
[TD]
=MAX(E6:E15)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
16​
[/TD]
[TD]
8​
[/TD]
[TD]
=MAX(A12:A16)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
=MAX(E7:E16)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
17​
[/TD]
[TD]
3​
[/TD]
[TD]
=MAX(A13:A17)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
3​
[/TD]
[TD]
=MAX(E8:E17)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
18​
[/TD]
[TD]
4​
[/TD]
[TD]
=MAX(A14:A18)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
4​
[/TD]
[TD]
=MAX(E9:E18)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
19​
[/TD]
[TD]
6​
[/TD]
[TD]
=MAX(A15:A19)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
6​
[/TD]
[TD]
=MAX(E10:E19)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
20​
[/TD]
[TD]
1​
[/TD]
[TD]
=MAX(A16:A20)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
1​
[/TD]
[TD]
=MAX(E11:E20)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
21​
[/TD]
[TD]
2​
[/TD]
[TD]
=MAX(A17:A21)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
2​
[/TD]
[TD]
=MAX(E12:E21)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
22​
[/TD]
[TD]
3​
[/TD]
[TD]
=MAX(A18:A22)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
3​
[/TD]
[TD]
=MAX(E13:E22)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
23​
[/TD]
[TD]
5​
[/TD]
[TD]
=MAX(A19:A23)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
5​
[/TD]
[TD]
=MAX(E14:E23)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
24​
[/TD]
[TD]
8​
[/TD]
[TD]
=MAX(A20:A24)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
=MAX(E15:E24)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
25​
[/TD]
[TD]
8​
[/TD]
[TD]
=MAX(A21:A25)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
8​
[/TD]
[TD]
=MAX(E16:E25)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
26​
[/TD]
[TD]
10​
[/TD]
[TD]
=MAX(A22:A26)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
10​
[/TD]
[TD]
=MAX(E17:E26)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
27​
[/TD]
[TD]
4​
[/TD]
[TD]
=MAX(A23:A27)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
4​
[/TD]
[TD]
=MAX(E18:E27)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
28​
[/TD]
[TD]
3​
[/TD]
[TD]
=MAX(A24:A28)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
3​
[/TD]
[TD]
=MAX(E19:E28)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
29​
[/TD]
[TD]
6​
[/TD]
[TD]
=MAX(A25:A29)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
6​
[/TD]
[TD]
=MAX(E20:E29)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
30​
[/TD]
[TD]
1​
[/TD]
[TD]
=MAX(A26:A30)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
1​
[/TD]
[TD]
=MAX(E21:E30)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
31​
[/TD]
[TD]
1​
[/TD]
[TD]
=MAX(A27:A31)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
1​
[/TD]
[TD]
=MAX(E22:E31)​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

This also seems to be an image but the idea is on there.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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