Function Problems

How to Use Cell Values as Dynamic Row References in SUMIFS

Chanuka GeekiyanageChanuka Geekiyanage Nov 10, 2026 869 views

Question details

The user wants to calculate a conditional sum using SUMIFS, where the range's starting and ending rows are dynamically controlled by specific cell values rather than being hardcoded.

How to Use Cell Values as Dynamic Row References in SUMIFS
Product
WPS Spreadsheet
Device & OS
not provided
Scenario
Creating automated dashboards or templates where the dataset range shifts or expands based on user-defined row numbers inputted in specific cells.
Observed behavior
Instead of statically defining ranges like D1:D100, the user aims to use functions like INDIRECT or INDEX to construct the SUMIFS evaluation range by pointing to cell values containing the row indices.
Before you start

Ensure your dynamic start and end row values are formatted as numbers and represent valid row limits within your current dataset.

Solution 1Recommended

Build a Dynamic Range Using the INDEX Function

The INDEX function provides a non-volatile method to create dynamic ranges, ensuring optimal spreadsheet performance during heavy recalculations.

In Spreadsheet formulas, the colon (:) operator can link two INDEX functions to create a valid continuous range. For example, INDEX(D:D, 5):INDEX(D:D, 10) evaluates to D5:D10. This is significantly faster and more stable than text-based concatenation.

1
Set up your row reference cells

Define your start row in a cell (e.g., A1) and your end row in another cell (e.g., A2).

2
Construct the dynamic sum range

Use the INDEX function to reference the sum column (e.g., Column D) based on your start and end rows: INDEX(SheetA!D:D, A1):INDEX(SheetA!D:D, A2).

3
Construct the dynamic criteria range

Similarly, use INDEX to reference your criteria column (e.g., Column B): INDEX(SheetA!B:B, A1):INDEX(SheetA!B:B, A2).

4
Combine into the SUMIFS formula

Select your result cell and enter the full formula combining both dynamic ranges: =SUMIFS(INDEX(SheetA!D:D, A1):INDEX(SheetA!D:D, A2), INDEX(SheetA!B:B, A1):INDEX(SheetA!B:B, A2), "PAY"). Press Enter.

Build a Dynamic Range Using the INDEX Function
Performance Benefit: INDEX is fast and non-volatile. Unlike INDIRECT, it only recalculates when its specific arguments change, preventing lag in large datasets.
Smart Spreadsheet Formulas

Master Dynamic Formulas with WPS Spreadsheet

Build complex data models easily with WPS Spreadsheet. It fully supports both INDIRECT and INDEX functions to help you create dynamic dashboards and automated reports effortlessly.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your data file in WPS Spreadsheet.
  2. 2. Enter the formula: Click on the cell where you want the dynamic sum result, type =SUMIFS(, and use the INDEX method outlined above to reference your dynamic rows.
  3. 3. Auto-update calculations: Press Enter to calculate. Whenever you change the values in your reference cells, the SUMIFS result in WPS Spreadsheet will update instantly.
Fully compatible with Microsoft Excel formulas, functions, and .xlsx file formats.Free to use for daily data analysis and reporting tasks.Lightweight software architecture that processes large data arrays smoothly.Built-in formula error checking and auto-completion.
microsoft office alternative - wps office

Frequently Asked Questions

What does 'volatile' mean when using the INDIRECT function?

A volatile function like INDIRECT recalculates every single time any change is made anywhere in the workbook, even if the change is entirely unrelated to the formula. This can significantly slow down performance in large spreadsheets, which is why the non-volatile INDEX function is often preferred for creating dynamic ranges.

Can I use dynamic column references instead of rows?

Yes. With INDIRECT, you can substitute the column letters dynamically by referencing cells containing text letters. With INDEX, you can use the syntax INDEX(data_area, 0, column_number) to reference entire dynamic columns, where 'column_number' is a cell value.

Why is my dynamic SUMIFS returning a #REF! error?

A #REF! error usually means the concatenated string in your INDIRECT formula does not form a valid cell reference (e.g., missing single quotes around sheet names with spaces), or the row numbers referenced in your INDEX function exceed the maximum row limits of the worksheet.