INDIRECT
Converts text into a reference and returns the referenced value or range.
INDIRECT lets formulas build references dynamically from strings such as "A1" or
"Sheet2!B3:C5".
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=INDIRECT(ref_text, [a1])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
ref_text | text | Required | — |
a1 | logical or number | Optional | true |
Return type
Can return a reference when evaluated in a reference context.
Remarks
a1_styledefaults toTRUE(A1 style parsing).- The function is volatile because target references can change without direct dependency links.
Differences from Excel
R1C1 cell and range references selected with a1_style=FALSE return #N/IMPL! in Formualizer.
Error cases
- Invalid or unresolved references return
#REF!.
Examples
Resolve an A1-style address provided as text.
Formula =INDIRECT("A1")
| A | |
|---|---|
| 1 | 99 |
Expected result 99
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Resolve an absolute A1-style reference and explicitly select A1 notation.
Formula =INDIRECT("$B$2",TRUE)
| B | |
|---|---|
| 2 | 42 |
Expected result 42
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Resolve the reference to an empty cell.
Formula =INDIRECT("B1")
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A string that cannot be resolved to a reference returns an error.
Formula =INDIRECT("not a reference")
Expected result #REF!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Resolve a range and aggregate it
Formula =SUM(INDIRECT("A1:A3"))
| A | |
|---|---|
| 1 | 5 |
| 2 | 7 |
| 3 | 9 |
Expected result 21
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
What happens if a1_style is FALSE?
R1C1 cell and range references are unsupported. Defined names and table references can still resolve with either flag.
How are bad reference strings reported?
If the text cannot be parsed or resolved to a valid reference, INDIRECT returns #REF!.