Prefer to watch the video? The video tutorial below will demonstrate all 5 INDIRECT function examples.

Before I delve into these different INDIRECT examples, I should quickly what it is for those of you who may be new to the function.

INDIRECT is one of the lookup functions of Excel. And it’s purpose is to return a reference which is specified by a piece of text (typically some text in the cell of a worksheet).

This become really useful when you concatenate that information together with others to form a reference to a different sheet, particular cell or named range. You will see these in the tutorials.

The INDIRECT function looks like below.

=INDIRECT(ref_text, [A1])

The *ref_text* is a reference to a cell that contains, or partially contains, an address.

The *A1* argument is optional. It determines the type of reference for INDIRECT to use. If you type True then the normal A1 style is used. If you type False then the R1C1 style is used.

Ok, lets get stuck into these tutorials.

A great use for INDIRECT is with named ranges. The concept of naming ranges for simpler referencing has huge benefits, and when you understand INDIRECT those benefits are amplified.

Check out this tutorial if you are new to naming ranges in Excel.

In the example below, cell G4 contains the total for the sales of the region mentioned in F4. In this image it is for Cardiff.

This total was achieved using the formula below.

=SUM(INDIRECT(F4))

Each range of values has been named after the region. For example range D3:D10 is named *Cardiff*, and range B3:B10 is named *Southampton*.

The INDIRECT function returns the value from F4. This value is then converted from text to a reference so that the SUM function can add the values from the named range.

Without INDIRECT the SUM function would not use the value in F4 as a reference to the named range.

In this example, we want to reference a different worksheet within a formula, which is another SUM function. The worksheet we are summing values from is dependent upon the value in a cell. So once again INDIRECT is needed.

The image below shows the summary sheet, and cell B3 contains the name of the sheet that we will be summing from. The beauty of this technique is that if someone changes the value in cell B3, it then sums from that sheet.

The formula below has been used in this example. In each sheet the values to be summed are in range C4:C11.

=SUM(INDIRECT("'"&B3&"'!C4:C11"))

The apostrophes have been used in the formula to enclose the sheet name. If a sheet name contains spaces such as *South Africa*, apostrophes are required.

In this example we will look at using an R1C1 style reference with INDIRECT to return the last value from a row.

In the image below the formula in cell F3 is returning the last value in row 10. This ensures that as new months (columns) are added to the table, it always retrieves the current months value.

The formula below has been used in cell F3. By using an R1C1 reference style instead of the traditional A1 style, we can refer to the column numerically. The COUNTA function has been used here to count the non blank cells of row 10, therefore returning the last column.

=INDIRECT("R10C"&COUNTA(10:10),FALSE)

This is concatenated onto the *R10C* part to complete the reference as row 10 and column 4.

The FALSE part of the INDIRECT formula requests the R1C1 style reference.

It feels necessary to include an example of using INDIRECT with the VLOOKUP function. For this example INDIRECT will be used to create a conditional lookup table.

In the image below a VLOOKUP function has been entered into cell B3 to return the sales value for *Jessica* (B1) and *Cardiff* (B2).

Each table has been named appropriately as *Southampton*, *Liverpool* and *Cardiff*. Just like in the first example of this blog post, INDIRECT has been used to convert the value of cell B2, to a reference to a named range.

The formula below is the VLOOKUP used. The table array is specified by changing the value in cell B2.

=VLOOKUP(B1,INDIRECT(B2),2,FALSE)

Another brilliant use of INDIRECT is to create dependent drop down lists. This is a great technique if you work with large lists.

You can break the large list up into multiple smaller lists and then make them dependent on one another. So the selection from one list would determine what options appear in the next list.

This demonstration also uses named ranges as a clever way of referencing different lists. Check out the video below to see how it is done.

Check out this video on how to create multiple dependent drop down lists.

If any of these INDIRECT examples are not clear, check out the video at the top of this blog post which will show you exactly how each formula is done.

- 4 Amazing Tips for the CONCATENATE Function
- Unleash the Power of the CELL Function of Excel
- Prevent Formulas from Showing in the Formula Bar

]]>

However, if the list is updated often with new records or columns of data, then the named range needs to frequently be updated also. This is an irritating and time consuming role, so this post aims to solve that problem by making the named range grow automatically when new rows and columns are added.

I was reminded of the brilliance of this feature just yesterday when I was asked by a company how they could get their formulas to include any new rows of data automatically. They had various formulas and PivotTables running on a large list of data to perform sales analysis. This data is frequently updated as more sales are made.

I ended up using the method below and had the formulas and PivotTables use the dynamic named range for their data source.

- Click the
**Formulas**tab on the Ribbon - Click the
**Define Name**button from the Defined Names group - Type a name for the named range. The name cannot include spaces or start with a letter

- Click in the
**Refers to:**field and enter the formula below

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNTA(Sheet1!$1:$1))

Change the references to cells, columns and rows in the formula to those required in your spreadsheet.

- Click
**Ok**

The named range is created. It does not appear in the Name Box list, but it can be used by typing its name into the Name Box.

The formula uses the OFFSET function to make the range dynamic. Let’s have a closer look at how this works.

- Sheet1!$A$1 is used as a starting cell for the range. This cell should be the cell in the upper left corner of your range
- The two zeros ensure that the range does not move from its base reference.
- The COUNTA(Sheet1!$A:$A) function makes the height of the range dynamic. It is used to count the number of rows that are not blank. The OFFSET function then uses this for the height of the range. Whenever a new row is added, the COUNTA function recognises it and tells the OFFSET function.

The COUNTA(Sheet1!$1:$1) function is used to find the width of the range. This ensures that new columns are included in the named range.

Create dependent drop down lists in Excel

Format data as a table in Excel