Skip to content

Lesson 59 of 92 · Free Excel Course

Excel · Excel function reference

Excel INDIRECT Function: Syntax, Examples and Common Errors

How the Excel INDIRECT function turns text into a reference: other sheets by name, dependent drop-downs, fixed ranges, R1C1 and #REF! fixes. Free practice file.

The INDIRECT function takes a piece of text that looks like a cell address, such as "B5" or "North!B5", and turns it into a real reference. Excel then returns whatever is in that cell or range. So if A2 contains the text B2, =INDIRECT(A2) gives you the value in B2, not the letters "B2". That lets a formula point somewhere different without you editing it: change the text, and the formula follows. INDIRECT is available in Excel for Microsoft 365 (Windows, Mac and the web), Excel 2024, Excel 2021, Excel 2019 and Excel 2016, including the Mac versions of 2024 and 2021.

Syntax

=INDIRECT(ref_text, [a1])
  • ref_text (required): the text to turn into a reference. It can be an A1-style address ("B5", "B2:B9"), an R1C1-style address ("R5C2"), a defined name ("Sales"), or a cell that holds any of these. If the text isn't a valid reference, INDIRECT returns #REF!. It also returns #REF! if the text points to a workbook that isn't open, or past the last row (1,048,576) or last column (16,384, column XFD).
  • a1 (optional): TRUE or left out means ref_text is in A1 style. FALSE means it's in R1C1 style. This only tells Excel how to read the text; it doesn't change the result.

INDIRECT returns a reference, so you can use it anywhere a range goes: inside SUM, AVERAGE, COUNTIF or a drop-down list's Source box.

Examples

Microsoft's example: text that names a cell

This is the example from Microsoft's INDIRECT page. Column A holds text; column C reads the cell that text describes.

C5=INDIRECT("B"&A5)
ABC
1DataDataResult
2B21.3331.333
3B34545
4George1010
556262
C2 is =INDIRECT(A2), C3 is =INDIRECT(A3), C4 is =INDIRECT(A4), and C5 joins "B" to 5 to make B5.

C2 and C3 work because A2 and A3 contain the text B2 and B3. Row 4 only works if B4 has been given the name George (click B4, type George in the Name Box left of the formula bar, press Enter). Row 5 is the most useful pattern: "B"&A5 builds the text B5, so changing A5 to 3 would make it read B3 instead.

Pull the same cell from a sheet named in a cell

Say each region has its own sheet with the total in B5. On a Summary sheet, type the sheet names in column A and let INDIRECT build each address.

B4=INDIRECT("'"&A4&"'!B5")
AB
1Sheet nameTotal (B5)
2North355
3South255
4East Coast345
SummaryNorthSouthEast Coast
One formula copied down reads B5 from each sheet. The single quotes let East Coast, which has a space, work.

The formula builds the text 'East Coast'!B5, the same thing you would type by hand. Without the quotes, =INDIRECT(A4&"!B5") works for North and South but gives #REF! for East Coast. Add a new region by adding a sheet and typing its name in column A; no formula changes.

Dependent drop-down lists

A second drop-down that only shows items for the category picked in the first is the classic INDIRECT job. The drop-down lists lesson builds a full order form this way; here is the short version with grocery lists.

ABC
1FruitVegetableDairy
2AppleCarrotMilk
3BananaLeekButter
4CherryPeaYogurt
OrderLists
Create from Selection turns each heading into a name: Fruit is A2:A4, Vegetable is B2:B4, Dairy is C2:C4.
  1. On the Lists sheet, select A1:C4.
  2. On the Formulas tab, click Create from Selection, tick Top row only and click OK.
  3. On the Order sheet, give A2 a List rule (Data > Data Validation > List) with Source =Lists!$A$1:$C$1.
  4. Select B2 and add a List rule with Source =INDIRECT(A2).

Pick Vegetable in A2 and the B2 arrow offers Carrot, Leek and Pea. A name can't contain a space, so Create from Selection turns a heading like "Frozen Food" into the name Frozen_Food. Either type Frozen_Food in the first list too, or use =INDIRECT(SUBSTITUTE(A2," ","_")) as the Source.

A range that doesn't shift when rows are inserted

A normal reference moves when you insert rows above it. Text inside INDIRECT doesn't, because it isn't a reference until the formula runs. Here both formulas started as sums of B2:B5 (1550), then a row was inserted at row 2 and 999 typed into it.

E4=SUM(INDIRECT("B2:B5"))
ABCDE
1MonthSalesSumResult
2Extra999
3Jan400Normal: =SUM(B3:B6)1550
4Feb350INDIRECT2169
5Mar420
6Apr380
The normal SUM followed the data down to B3:B6. The INDIRECT sum still reads B2:B5: 999 + 400 + 350 + 420 = 2169.

That's handy when a report must always read "the top four rows", for example new entries are inserted at the top. It's also the danger: INDIRECT never adjusts, so inserting or deleting rows can make it silently read the wrong cells. $ signs don't give you this behavior either: $B$2 still moves to $B$3 when a row is inserted above it, because $ only stops a reference changing when you copy the formula (see absolute and relative references).

R1C1-style text

With a1 set to FALSE, the text is read as row and column numbers. =INDIRECT("R3C2",FALSE) returns the value in B3 (row 3, column 2). This is useful when you've calculated both numbers: =INDIRECT("R"&E1&"C"&E2,FALSE) reads the cell at row E1, column E2. The ADDRESS function builds the same kind of text, in either style.

Common errors

  • #REF! because the text isn't a real address. A typo ("B 5"), a stray space, an empty cell (empty text isn't a reference) or a name that doesn't exist all give #REF!. Check what you're feeding it: put the text part alone in a cell, for example ="'"&A4&"'!B5", and read it.
  • #REF! with a sheet name. The name is misspelled, or it has a space and no single quotes. Use "'"&A2&"'!B5" every time.
  • #REF! after renaming a sheet. Normal references update when you rename a sheet; text inside INDIRECT doesn't. Update the names in your list too.
  • #REF! with another workbook. The other file is closed. INDIRECT only reads open workbooks, and Microsoft's INDIRECT page notes that external references aren't supported in Excel for the web.
  • #REF! with R1C1 text. You passed "R3C2" without FALSE as the second argument, so Excel tried to read it as an A1 address.
  • A slow workbook. INDIRECT is volatile: Microsoft says Excel re-evaluates volatile cells and all their dependents every time it recalculates. If you have thousands, switch to one of the alternatives below.
  • The dependent drop-down is empty or shows the wrong list. The category text doesn't match a name exactly (a list is empty), or the rule says =INDIRECT($A$2) so every row follows A2 (wrong list). Use =INDIRECT(A2) with the first cell active.

Related functions

INDIRECT is flexible but volatile, and it breaks when sheets are renamed, so first check whether one of these does the job:

Try it yourself

Download the practice workbook. The Practice sheet has yellow cells for Microsoft's example, three region sheets (one with a space in its name), a range that stays put when you insert a row, a dependent drop-down check and R1C1 text. The Your task sheet walks you through naming the lists and adding the second drop-down, and the Answers sheet has every finished formula.

Frequently asked questions

Why use INDIRECT instead of a normal cell reference?

Use it only when the address has to come from text: a sheet name typed in a cell, a category picked in a drop-down, or a range you build with &. If the cell never changes, a normal reference like =B5 is simpler, faster and updates itself when you insert rows or rename sheets.

How do I use INDIRECT to refer to another sheet?

Join the sheet name, an exclamation mark and the cell: =INDIRECT("'"&A2&"'!B5"). The single quotes around the name are only required when it has spaces or special characters, but adding them every time does no harm and saves a #REF! later.

Is INDIRECT volatile, and does it slow Excel down?

Yes. Microsoft lists INDIRECT as a volatile function, so it recalculates every time Excel recalculates, along with every cell that depends on it. A few dozen are fine; thousands can make a large workbook sluggish. INDEX, CHOOSE or XLOOKUP can often do the same job without being volatile.

Does INDIRECT work with a closed workbook?

No. If the text points to another workbook, that workbook must be open, or INDIRECT returns #REF!. Microsoft also notes that external references aren't supported in Excel for the web.