How to Use Cell Values as Dynamic Row References in SUMIFS
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.

- 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.
Ensure your dynamic start and end row values are formatted as numbers and represent valid row limits within your current dataset.
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.
Define your start row in a cell (e.g., A1) and your end row in another cell (e.g., A2).
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).
Similarly, use INDEX to reference your criteria column (e.g., Column B): INDEX(SheetA!B:B, A1):INDEX(SheetA!B:B, A2).
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.

Create Dynamic Ranges Using the INDIRECT Function
You can concatenate text strings with your cell references, then use the INDIRECT function to convert them into a valid calculation range.
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. Open WPS Spreadsheet: Launch WPS Office and open your data file in WPS Spreadsheet.
- 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. 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.

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.




