Formula Errors

Use Cell Values to Control a Dynamic Formula Range in Excel

John WilsonJohn Wilson Nov 27, 2026 870 views

Question details

Calculate a minimum or maximum over a range whose starting and ending row numbers are specified in cells.

Use Cell Values to Control a Dynamic Formula Range in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the row numbers

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.

2
Enter the minimum formula

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.

3
Calculate a maximum instead

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.

Create a dynamic range with OFFSET
Check formula separators: If Excel does not accept commas as argument separators, use semicolons instead, according to your regional settings.
Dynamic ranges in WPS Spreadsheets

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. 1. Open your spreadsheet: Open WPS Spreadsheets and use Menu > Open to select your workbook.
  2. 2. Enter the range limits: Enter the starting row number in F2 and the ending row number in F3.
  3. 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. 4. Adjust the range: Change the values in F2 or F3 to calculate over a different set of rows in column A.
Update the calculation range by changing the row numbers in F2 and F3.Use familiar spreadsheet functions such as MIN, MAX, and OFFSET.Open and save Microsoft Excel XLSX files.Work in a familiar spreadsheet interface.
microsoft office alternative - wps office

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.