Use Cell Values to Control a Dynamic Formula Range in Excel
Question details
Calculate a minimum or maximum over a range whose starting and ending row numbers are specified in cells.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet stores the starting row in F2 and the ending row in F3, and a formula needs to evaluate the corresponding cells in column A.
- Observed behavior
- The formula should update its calculation range when the row numbers in F2 or F3 change.
Enter positive whole-number row references in F2 and F3, with F2 less than or equal to F3 and both within the worksheet's row limit. Make sure column A contains numeric values in the rows you want to calculate.
Create a dynamic range with OFFSET
Use OFFSET when you want MIN or MAX to calculate over rows specified in F2 and F3.
OFFSET starts at A1, moves down to the row in F2, and returns a one-column range through the row in F3.
In Excel, enter the starting row number in F2 and the ending row number in F3. For example, enter 2 in F2 and 10 in F3.
Select an empty cell and enter =MIN(OFFSET(A1,F2-1,0,F3-F2+1,1)). With the example row numbers, this calculates the minimum in A2:A10.
To find the maximum, replace MIN with MAX: =MAX(OFFSET(A1,F2-1,0,F3-F2+1,1)). Change F2 or F3 to update the range.

Build the range reference with INDIRECT
Use INDIRECT as an alternative when you prefer to construct the range reference as text.
Calculate a dynamic minimum or maximum in WPS Spreadsheets
Use OFFSET in WPS Spreadsheets to calculate a minimum or maximum over rows controlled by worksheet cells.
- 1. Open your spreadsheet: Open WPS Spreadsheets and use Menu > Open to select your workbook.
- 2. Enter the range limits: Enter the starting row number in F2 and the ending row number in F3.
- 3. Calculate the result: Select an empty cell and enter =MIN(OFFSET(A1,F2-1,0,F3-F2+1,1)). Replace MIN with MAX to find the largest value.
- 4. Adjust the range: Change the values in F2 or F3 to calculate over a different set of rows in column A.

Frequently Asked Questions
How do I find the maximum instead of the minimum?
Replace MIN with MAX in the formula: =MAX(OFFSET(A1,F2-1,0,F3-F2+1,1)).
What happens when I change F2 or F3?
The formula recalculates using the new starting or ending row. For example, changing F3 from 10 to 15 extends the range from A2:A10 to A2:A15 when F2 is 2.
How can I calculate over a different column?
Change A1 to the first cell of the desired column in the OFFSET formula. For column B, use =MIN(OFFSET(B1,F2-1,0,F3-F2+1,1)).
Why does the OFFSET formula return an error?
Check that F2 and F3 contain valid row numbers and that F2 is not greater than F3. Also check whether your spreadsheet requires semicolons instead of commas as formula separators.




