Sub topic 14
Building References from Text with INDIRECT
This chapter assumes you can write formulas that start with =, you know A1 notation, and you are comfortable with relative, absolute, and mixed references, ranges, and references to other sheets. It covers one function, INDIRECT, which turns a piece of text into a live reference.
What INDIRECT does
Every reference you have written so far is typed directly into the formula. In =B2*C2, Sheets reads B2 as a pointer to a cell. INDIRECT works differently. It takes a text string, interprets that string as a reference, and returns whatever the reference points to.
=INDIRECT("B2")This returns the value in B2. The quotes matter: "B2" is text, and INDIRECT converts it into a pointer. If B2 holds 50, the formula shows 50.
The reason to use INDIRECT is that text can be assembled by other formulas. You can join pieces with the & operator, read pieces from other cells, and then hand the result to INDIRECT. The reference then depends on the data in your sheet, not on what you typed.
=INDIRECT("'" & A1 & "'!B2")This is the pattern from the topic plan. If A1 contains Sales Data, the joined text is 'Sales Data'!B2, and INDIRECT returns cell B2 from that sheet. If you change A1 to Costs, the same formula reads B2 from the Costs sheet.
Syntax and the A1 setting
The full form is:
=INDIRECT(cell_reference_as_string, [is_A1_notation])cell_reference_as_stringis the text to interpret. It can name a cell ("B2"), a range ("B2:B10"), a cell on another sheet ("'Sales Data'!B2"), or a named range ("TaxRate").is_A1_notationis optional and defaults toTRUE, meaning the text uses A1 style. Set it toFALSEto use R1C1 style, where"R2C3"means row 2, column 3. R1C1 is useful when you compute row and column numbers with arithmetic.
=INDIRECT("R" & ROW() & "C2", FALSE)This reads column B of the current row. It is the same as a plain B reference on the same row, but it shows how numbers can be spliced into the text.
Worked example 1: one formula, many sheets
Suppose you have a workbook with three monthly sheets named Jan, Feb, and Mar. Each has a total in cell B10. On a summary sheet, you want a list of the totals.
Put the sheet names in A2:A4 on the summary sheet:
| A | B |
|---|---|
| Month | Total |
| Jan | |
| Feb | |
| Mar |
In B2, write:
=INDIRECT(A2 & "!B10")Fill it down to B4. The relative reference A2 becomes A3 and A4, so the text becomes Feb!B10 and Mar!B10. Each row reads from a different sheet, and you wrote the formula once.
If a sheet name contains a space or punctuation, wrap it in single quotes inside the text. This version works for any name:
=INDIRECT("'" & A2 & "'!B10")Quotes around a name that does not need them are harmless, so using this form by default is a good habit.
Worked example 2: choosing a range with a dropdown
INDIRECT also works with ranges. Say B1 holds a data validation dropdown with the choices Q1, Q2, and Q3, and each of those is a named range covering that quarter's sales figures. This formula sums whichever quarter is selected:
=SUM(INDIRECT(B1))When B1 says Q2, INDIRECT returns the range named Q2, and SUM adds it up. Without INDIRECT, SUM(B1) would try to add the text Q2, which gives 0.
You can also build a range from row numbers stored in cells. If D1 holds a start row and D2 holds an end row:
=SUM(INDIRECT("B" & D1 & ":B" & D2))With D1 = 2 and D2 = 10, the text is B2:B10 and the result is the same as =SUM(B2:B10). Changing D1 or D2 changes the range without editing the formula.
Limits and gotchas
INDIRECT is flexible, but it has costs. Know these before you rely on it.
It cannot read other spreadsheet files
INDIRECT only resolves references inside the current spreadsheet. A text string containing a spreadsheet URL or ID does not work. To read from another file, use IMPORTRANGE, covered in the previous chapter. You can still build the arguments to IMPORTRANGE from text, because its arguments are ordinary strings:
=IMPORTRANGE(A1, "Sheet1!A1:C10")Here A1 holds the spreadsheet URL.
It is volatile and can slow a sheet
A normal formula recalculates only when the cells it points at change. Sheets cannot tell what an INDIRECT formula points at until it runs, so it recalculates whenever anything in the spreadsheet changes. A few of these formulas are fine. Thousands of them, especially wrapped around large ranges, can make a sheet noticeably sluggish.
References inside the text do not adjust
This is the most common surprise. When you insert or delete rows, move cells, or rename a sheet, Sheets rewrites normal references so they keep working. It does not rewrite text.
- If you write
=INDIRECT("B2")and then insert a row above row 2, the formula still reads B2, which is now a different record. - If you rename
Sales DatatoSales 2026, a formula with the old name typed in text returns#REF!. A normal reference='Sales Data'!B2would have updated itself.
When the sheet name comes from a cell, as in A1, you must update that cell yourself after a rename.
The text must be a valid reference
If the string does not describe a real reference, INDIRECT returns #REF!. Typical causes:
- A misspelled sheet name, or a missing pair of single quotes around a name with spaces.
- An empty cell used as the sheet name, giving the text
!B2. - A string that is not a reference at all, such as
"hello".
When an INDIRECT formula fails, test the text on its own. Put just the joined string in a cell, for example ="'" & A2 & "'!B10", and read it. You will usually see the typo straight away.
Text is not tracked as a dependency
Because the target is hidden inside a string, tools that trace precedents cannot show where INDIRECT points, and a later reader cannot find the source by clicking on the formula. Document your sheet. A short note beside the formula, or a clearly labeled sheet-name column, helps.
Alternatives to consider
INDIRECT is often the first thing people reach for, but another tool may be safer.
| Need | Better option | Why |
|---|---|---|
| Fixed target that you want to read easily | Named range | Updates when rows are inserted and shows intent |
| Pick one value by position | `INDEX` | Not volatile, and adjusts when cells move |
| Look up a value by key | `VLOOKUP` or `XLOOKUP` | Reads clearly and tracks changes |
| Read a sheet by name chosen at run time | `INDIRECT` | Few other ways to do this |
| Data from another file | `IMPORTRANGE` | INDIRECT cannot do it |
Selecting a sheet by name stored in a cell is the case where INDIRECT is hard to replace, because a normal reference cannot take its sheet name from data.
Checklist for writing an INDIRECT formula
- Write the plain reference you want, such as
'Sales Data'!B2. - Identify which part should change, such as the sheet name.
- Replace that part with a cell reference joined by
&. - Wrap the joined text in quotes carefully, including single quotes around sheet names.
- Test the joined text alone in a spare cell.
- Wrap it in INDIRECT.
- Check the result against the plain reference for at least one case.
Exercise
Cell A1 contains the sheet name Q 1 Report. Write a formula that returns cell C5 from that sheet. Then say what happens if someone renames the sheet to Q1 but does not change A1.
Show answer
Use =INDIRECT("'" & A1 & "'!C5"). The single quotes are needed because the name contains spaces. After the rename, the text still points at Q 1 Report, which no longer exists, so the formula returns #REF!. Text inside INDIRECT is not updated by renames, so A1 must be changed to Q1.
Exercise
B1 holds a row number, and you want the sum of column C from row 2 down to that row. Write the formula, and explain why INDIRECT is needed instead of =SUM(C2:CB1).
Show answer
Use =SUM(INDIRECT("C2:C" & B1)). With B1 = 8, the text is "C2:C8". A reference cannot be assembled from a cell's value by ordinary syntax, so the end row must be built as text and converted by INDIRECT.
Exercise
Why does =INDIRECT("[" & A1 & "]Sheet1!B2") fail even when A1 holds a valid spreadsheet ID, and what should you use?
Show answer
INDIRECT only resolves references inside the current spreadsheet, so it cannot open another file. Use IMPORTRANGE, for example =IMPORTRANGE(A1, "Sheet1!B2"), which accepts the spreadsheet URL or ID as a text argument.