lowest value in range over n rows

artz

Well-known Member
Joined
Aug 11, 2002
Messages
830
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have a data set of variable length in column G. The first used data row is G8, G7 is a header. I want to find the lowest value in column G over the last n rows where n can be a variable value placed in cell Q2. For example, if the value in cell Q2 were 20, and the last data were in cell G521, we would use the formula: =low(G502:G521). (inclusive of the current cell, i.e., G521.

Could anyone in the Forum help with a cell formula that can return the lowest value over the range of n cells back, with a variable number of rows in column G?

Thanks,

Art
 
Hi Aladin,

You nailed it, thanks. The first of the two formulas worked perfectly. I did have trouble with the second. I'll look at it later.

Also, I modified your formula to start at cell J8 and also to check for blanks in column F. The mods that I made are:

Code:
=IF(F8<>"",IF(ROWS($J$8:J8)>=$Q$2,MAX(LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,LOOKUP(9.99999999999999E+307,$J$7:J7))),MIN(OFFSET(F8,0,0,-$Q$2))),""),"")

Thanks again,

Art
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi Aladin,

You nailed it, thanks. The first of the two formulas worked perfectly.

Great. Thanks for the feedback.

I did have trouble with the second. I'll look at it later.

The same thing. It just introduces a named constant.

Also, I modified your formula to start at cell J8 and also to check for blanks in column F. The mods that I made are:

Code:
=IF(F8<>"",IF(ROWS($J$8:J8)>=$Q$2,
    MAX(LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,
      LOOKUP(9.99999999999999E+307,$J$7:J7))),
        MIN(OFFSET(F8,0,0,-$Q$2))),""),"")

Yep...

Thanks again,

Art

You are welcome.
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,691
Members
452,938
Latest member
babeneker

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