30 Advanced Excel Tips for 2026

Excel Champs / Excel Formulas List / How to use INDIRECT with SUM in Excel (Formula)
By Puneet Gogia (Microsoft MVP)

How to use INDIRECT with SUM in Excel (Formula)

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

INDIRECT turns text into a real reference, so wrapping it in SUM lets the range come from a cell instead of being written into the formula: put A2:A7 as text in B1, then =SUM(INDIRECT(B1)) totals that range, and changing B1 changes what gets summed with no formula edit.

For a range on another sheet, build the reference from two cells — the sheet name and the range — joined with an exclamation mark: =SUM(INDIRECT("'"&A1&"'!"&B1)). Keep the single quotes around the sheet name, or any sheet with a space in its name fails.

To total the same range across several sheets listed in a column, use =SUMPRODUCT(SUMIF(INDIRECT("'"&A2:A4&"'!"&B2),">0")) — INDIRECT builds one reference per sheet name, SUMIF returns a total for each, and SUMPRODUCT adds them up. Three things to know.

If a sheet name doesn’t exactly match a real tab you get #REF! with no clue which one is wrong. INDIRECT can’t read a closed workbook at all. And it’s volatile, so it recalculates on every change in the file.

When you combine INDIRECT with the SUM function, you can create a dynamic sum formula. And this formula allows you to refer to a cell where you have the range (as a text) that you want the sum for. That means you don’t need to change the reference from the formula itself again and again.

use-indirect-with-sum

INDIRECT allows you to create a cell or range reference by entering the text into it.

Combine INDIRECT with SUM

You can use the below steps:

  • First, in a cell, enter the range that you want to refer to (like A2:A7).
  • After that, in a different cell, enter the SUM function.
  • Next, enter the INDIRECT function, and in the first argument of INDIRECT, refer to the cell with the range address.
  • Now, close both functions and hit Enter to get the result.
combine-indirect-and-sum

The moment you hit Enter, it returns the sum of the values from the range A2:A7.

For example, if the text A2:A7 is in cell C1, the formula is the following. Change the text in C1 to A2:A5, and the formula sums only those cells:

=SUM(INDIRECT(C1))
sum-of-values

Use INDIRECT to Refer to Another Sheet to SUM

Let’s say you have a range that is in a different sheet. In this case, you can also use INDIRECT and SUM.

indirect-to-refer-another-sheet-to-sum

In the above example, we have entered the formula in “Sheet2” and referred to the range from the sheet “Data”. And in the formula, there are two different cells with values to refer to. In the first cell, you have the sheet’s name, and in the second cell, the range itself.

=SUM(INDIRECT(A1&"!"&B1))

This works as long as the sheet name has no spaces or special characters. For a name like “Sales Data”, the formula returns #REF!, as Excel needs the name in single quotes. So, it’s safer to add the quotes around the sheet name every time:

=SUM(INDIRECT("'"&A1&"'!"&B1))

Use INDIRECT to SUM with Multiple Sheets

If you have multiple sheets and you want to sum values from a range of all those sheets, you need to use a formula like below:

indirect-to-sum-multiple-sheets
=SUMPRODUCT(SUMIF(INDIRECT("'"&A2:A4&"'!"&B2),">0"))

In this formula, we have used SUMPRODUCT and SUMIF instead of SUM. In the INDIRECT, there is a reference to the name of the sheets and the range. This creates three references, one for the A2:A7 range in each of the three sheets (Data1, Data2, and Data3), which works like a 3D-Range. SUM can’t add up a list of references like this, which is why the formula uses SUMIF and SUMPRODUCT.

combined-sumproduct-sumif

After that, SUMIF uses that range and returns individual sums from all three ranges.

sumif-uses-the-range

In the end, SUMPRODUCT uses those values and returns a single sum value in the cell.

sumproduct-returns-a-single-sum

You can learn more about using SUMPRODUCT IF here and get better clarity on its usage.

There’s one catch in this formula: the “>0” criteria in SUMIF only adds the values greater than zero, so negative numbers are left out. If your data can have negative values, use “<>” as the criteria, which adds all the cells that aren’t empty:

=SUMPRODUCT(SUMIF(INDIRECT("'"&A2:A4&"'!"&B2),"<>"))

And if the sheets are next to each other and their names don’t need to come from cells, a normal 3D reference is simpler, and it isn’t volatile:

=SUM(Data1:Data3!A2:A7)

Things to Know Before Using INDIRECT with SUM

  • It’s volatile: INDIRECT recalculates every time anything changes in the workbook, so many of these formulas can slow down a big file.
  • References don’t adjust: as the range is text, it doesn’t change when you insert or delete rows, or when you rename a sheet. You need to update the text yourself.
  • Closed workbooks: INDIRECT can’t refer to a workbook that is closed; the formula returns #REF! until you open it.
  • A non-volatile option: to sum a variable number of rows, INDEX can do the same job without being volatile, where C2 has the number of rows to sum (formula below this list).
=SUM(A2:INDEX(A2:A100,C2))

Frequently Asked Questions

Why does my INDIRECT SUM formula return #REF!?

The text in the cell isn’t a valid reference: the range address has a typo, the sheet name is misspelled or needs single quotes, or the workbook it refers to is closed.

Can I use a named range with INDIRECT?

Yes. If cell C1 has the name of a named range (like Sales), INDIRECT(C1) refers to that range, so you can switch between ranges by changing the name in C1.

Does INDIRECT work in Google Sheets?

Yes, the INDIRECT and SUM combination works the same way in Google Sheets, including references to other sheets.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

Leave a Comment