The INDIRECT function in Excel is a powerful tool that allows users to convert text strings into cell or range references. This is particularly useful for creating dynamic references that change automatically based on input, making it easier to manage data across multiple sheets or tables.
Syntax
INDIRECT(ref_text, [a1])
- ref_text: A text string that specifies the cell or range reference.
- [a1]: An optional argument that determines the reference style—0 for R1C1 and 1 for A1 notation.
Example #1
=INDIRECT("B2")
Using this function, Excel retrieves the value from cell B2. For instance, if B2 contains “Hello”, the result will be “Hello.”
Example #2
=INDIRECT("Sheet2!A1")
This call fetches the value in cell A1 from a different worksheet, Sheet2. If A1 in Sheet2 has the number 100, the result will be 100.
Example #3
=INDIRECT("R2C1", FALSE)
Here, Excel references the cell in the second row and first column using R1C1 notation. If the cell contains the text “Data”, the output will be “Data.”
Error handling
- REF!: This error occurs if the ref_text refers to an invalid cell reference. Double-check the string for any errors.
- VALUE!: This indicates that the ref_text is not a valid text string. Ensure that the argument is in the correct format.