How to Use the INDIRECT Function in Excel
Welcome to this detailed guide on using the INDIRECT function in both Microsoft Excel and Google Sheets. The INDIRECT function is extremely useful for referring indirectly to cells in a spreadsheet. It is especially helpful when dealing with cell or cell range references defined by text strings.
Basic Syntax
The syntax for the INDIRECT function is as follows:
=INDIRECT(ref_text, [a1])
ref_text
: This mandatory argument specifies the cell reference as a text string, which can either be a straightforward cell address like “A1” or a named range.[a1]
: This optional argument determines the style of the reference. If set toTRUE
or omitted, the A1 reference style is used, where columns are labeled with letters and rows with numbers. IfFALSE
, it uses R1C1 reference style, where both columns and rows are labeled numerically.
Dynamic Referencing
One prevalent use of the INDIRECT function is dynamic cell referencing. Suppose you have a dropdown menu listing column headers and you need to fetch data from a selected column dynamically. The INDIRECT function facilitates this seamlessly.
A | B | C |
---|---|---|
Header 1 | Header 2 | Header 3 |
100 | 200 | 300 |
Example: If cell E1
contains the letter “B”, you can utilize the following formula to fetch the value from cell B2
:
=INDIRECT(E1 & "2")
This formula indirectly references cell B2
and displays the value 200
.
Sum of a Range
The INDIRECT function also proves effective in calculating the sum of a range based on user input or certain conditions.
A | B | C |
---|---|---|
10 | 20 | 30 |
Example: If cell E1
contains the text “A:C”, you can use the following formula to calculate the sum of the range A1:C1
:
=SUM(INDIRECT(E1))
This formula will indirectly reference the range A1:C1
and return the total 60
.
These examples illustrate just a fraction of the potential applications for the INDIRECT function in enhancing the dynamics and flexibility of formulas in your Excel and Google Sheets documents. Explore various scenarios to fully exploit the capabilities of this function!
More information: https://support.microsoft.com/en-us/office/indirect-function-474b3a3a-8a26-4f44-b491-92b6306fa261