Formula Errors

Find Minimum and Maximum Values Between Dynamic Markers in Excel

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

Find the minimum and maximum values across columns A:E for each group identified by consecutive markers in column G.

Find Minimum and Maximum Values Between Dynamic Markers in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains numeric values in columns A:E and group markers in column G. Results are needed for each group as markers are added or moved.
Observed behavior
Each marker after the first should display the minimum and maximum for the range from the preceding marker row through the current marker row.
Before you start

Confirm that column G contains nonblank group markers and that columns H and I are available for results. The formulas below include both marker rows in each group's range.

Solution 1Recommended

Calculate group minimums and maximums using marker rows

Use LOOKUP to find the preceding marker and INDEX to build a range that changes with each group.

1
Enter the minimum formula

In H2, enter =IF($G2="","",IFERROR(MIN(INDEX($A:$A,LOOKUP(2,1/($G$1:G1<>""),ROW($G$1:G1))):INDEX($E:$E,ROW())),""))

2
Enter the maximum formula

In I2, enter =IF($G2="","",IFERROR(MAX(INDEX($A:$A,LOOKUP(2,1/($G$1:G1<>""),ROW($G$1:G1))):INDEX($E:$E,ROW())),""))

3
Fill the formulas down

Select H2:I2 and drag the fill handle down alongside the data. Results appear on marker rows that have a preceding marker.

Calculate group minimums and maximums using marker rows
Range and empty-group behavior: The first marker has no preceding marker, so its result is blank. MIN and MAX ignore text and return 0 if the selected range contains no numeric values.
Calculate groups in WPS Spreadsheets

Find group minimums and maximums in WPS Spreadsheets

Use LOOKUP, INDEX, MIN, and MAX in WPS Spreadsheets to calculate values between consecutive marker rows.

  1. 1. Open the workbook: Open WPS Spreadsheets and select Open to load your Excel workbook.
  2. 2. Enter the minimum formula: Select H2 and enter =IF($G2="","",IFERROR(MIN(INDEX($A:$A,LOOKUP(2,1/($G$1:G1<>""),ROW($G$1:G1))):INDEX($E:$E,ROW())),""))
  3. 3. Enter the maximum formula: Select I2 and enter =IF($G2="","",IFERROR(MAX(INDEX($A:$A,LOOKUP(2,1/($G$1:G1<>""),ROW($G$1:G1))):INDEX($E:$E,ROW())),""))
  4. 4. Fill down and save: Select H2:I2, drag the fill handle down through the marker rows, and use File > Save to save the workbook.
Calculate minimums and maximums across dynamic group rangesOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and fill handles
microsoft office alternative - wps office

Frequently Asked Questions

Why is the result blank at the first marker?

The formulas need an earlier nonblank cell in column G to define the start of a group. The first marker has no preceding marker, so the result is blank.

Are the marker rows included in each calculation?

Yes. Each formula includes columns A:E from the preceding marker row through the current marker row. A marker row therefore belongs to both adjacent groups.

Why does a group return zero when it has no numbers?

MIN and MAX ignore text and return 0 when the selected range contains no numeric values. Check the group's cells in columns A:E for numbers stored as text or empty cells.

Can I use a different marker or data column?

Yes. Replace the column G references with your marker column, and change the INDEX references to the first and last data columns. Put the formulas in empty result columns.