Excel’s INDIRECT Function has many applications and perhaps its simplest is to fix a range of cells you want to reference.
For example a standard SUM function looks like this:
If you insert a row within this range the formula dynamically updates and becomes:
It will dynamically update even if you absolute the reference like this:
To stop the reference dynamically updating when you insert rows or columns use the INDIRECT function like this:
In most cases you’d want your formulas to dynamically update when you insert new rows or columns but there are some instances when this is a nuisance and that’s when INDIRECT is your ally.
How Does The INDIRECT Function Work?
Excel’s INDIRECT function returns a reference specified by a text string.
The text string can be obtained by:
- referencing another cell, or
- you can enter it in double quotes, or
- you can generate it by nesting other functions
And you can also use the ampersand (&) symbol to concatenate text and build your text string that way. More on using the ampersand in a moment.
Notice how the range specified in this INDIRECT function below is surrounded by double quotes, thus making it a text string.
INDIRECT Function Syntax
The syntax is:
ref_text – is the text string (like in the example above "$B$16:$B$24") or the cell you’re referring to containing the text string.
a1 – this is asking you if your reference uses the A1 reference style or R1C1 style. To use the A1 style* simply omit this argument, but if you want to use R1C1 enter ‘FALSE’.
*A1 reference style is what you’re probably familiar with and it is where the columns have letters and the rows have numbers. The R1C1 style uses the R to specify a row and then the number of that row, and the C to specify a column and then the number of that column.
In the example below the INDIRECT function in cell A4 is evaluating the contents in cell C4. I could have also typed this formula like this:
=INDIRECT("C4") and my result would again be ‘This text’.
Ok, that’s enough theory.
Other Uses for INDIRECT
1. Generate a Reference on the Fly
By nesting it with other functions we can generate references like this one:
In this example we’ve used the ROW function which returns the row number of the selected cell, in this example it’s 35. Our formula above evaluates to:
Well why didn’t I just type in =SUM(B27:B35) I hear you say. And fair enough too.
The point of this example was to give you a taste of how you can nest other functions in the INDIRECT function to derive cell references. If it ‘tastes’ good I recommend you try nesting other referencing functions like COLUMN, ADDRESS, and CELL.
Referencing Other Worksheets and Workbooks
You can reference other worksheets and workbooks with the INDIRECT function too.
References to other workbooks must be formatted like this:
References to other worksheets must be formatted like this:
Note 1: spaces between double quotes and apostrophe (“ '[your) are so you can clearly see all of the components. You don’t actually put a space in your formula.
Note 2: you can reference other worksheets and workbooks but if you reference another workbook it must be open otherwise you will get a #REF! error.
2. Use INDIRECT with a Named Range
This is probably the second most useful application for the INDIRECT function.
Let’s say you’ve got 4 named ranges of data; North, South, East, West.
You’ve got a drop down list (data validation list or combo box) that allows you to choose from the 4 different regions (with names that are exactly the same as the named ranges you’ve set up for your regions).
When you make your choice the report automatically updates with the relevant figures without the need for any IF Functions or other jiggery pokery.
You can basically use the INDIRECT function in any formula that requires a reference to a cell or range of cells.
Download the workbook and look at the examples in more detail.
Want More Excel Formulas
Why not visit our list of Excel formulas. You'll find a huge range all explained in plain English, plus PivotTables and other Excel tools and tricks. Enjoy 🙂