How to Use the INDIRECT Function in Excel – 12 Examples

This is an overview:

indirect function in excel overview

 


The INDIRECT Function

indirect function syntax in excel

  • Function Objective:

Storing data from the reference specified by a text string.

  • Syntax:

=INDIRECT(ref_text, [a1])

  • Arguments Explanation:
Argument Compulsory/Optional Explanation
ref_text Compulsory Reference of a cell with A1 or R1C1 format.
[a1] Optional Format of the cell to select- A1 or R1C1 
  • Return Parameter:

The function returns the value(s) present in the stored reference.


Example 1 – Using the INDIRECT Function to Convert a Text String into Cell Reference

  • To find the value of B5, enter the formula in B8:
=INDIRECT("B5")

text to cell reference with indirect function in excel


Example 2 – Using the Ampersand to Define the Row and Column Index with the INDIRECT Function

  • To find the value of C8, enter the formula in E7:
=INDIRECT("C"&8)

defining cell reference by using ampersand with indirect function in excel


Example 3 – Using the ROW Function inside the INDIRECT Function to Define a Cell Reference

  • Enter the formula in F7:
=INDIRECT("C"&ROW())

indirect with row function in excel


Example 4 – Calculations with Cell References Defined by the INDIRECT Function

  • Enter the formula in D9:
=SUM(INDIRECT("B5:B15"))

calculation with indirect function in excel


Method 5 – Locking Cell References with the INDIRECT Function in Excel

  • To see the output in D5, enter the formula to lock a cell reference in C5:
=B5*INDIRECT("C5")
  • Press Enter and drag down the Fill Handle to autofill the rest of the cells.

locking cell reference with indirect function in excel


Example 6 – Using a Cell Reference from Another Worksheet with the INDIRECT Function

A chart containing the names of donors and the donation amounts on day 1 is present in Sheet 1.

cell reference from another worksheet with indirect function in excel

Sheet 2 represents the chart for day 2.

cell reference from another worksheet with indirect function in excel

  • Enter the formula in D5.
=MAX(INDIRECT(C5&"!C5:C9"))
  • Press Enter.

You’ll get the value for the first day. Apply the formula to the next output cell to see the maximum amount on the second day.

cell reference from another worksheet with indirect function in excel

Read More: How to Use the INDIRECT Function to Get Values from Different Sheet in Excel


Example 7 – Using a Cell Reference from Another Workbook with the INDIRECT Function

To extract the value of C7 to another workbook:

using cell reference from another workbook with indirect function in excel

Step 1:

  • Open a new workbook.
  • In B4, enter ‘=’ and click C7 in the Donation Data workbook.

using cell reference from another workbook with indirect function in excel

 Step 2:

  • Press Enter. ($1200 is displayed)
  • To keep B4 in text format, remove the Equal(=) symbol.

In C6 and C7, enter the names of the Excel workbook and the spreadsheet from which data will be extracted.

using cell reference from another workbook with indirect function in excel

Step 3:

  • In C9, use:
=INDIRECT("'["&C6&".xlsx]"&C7&"'!$C$7")
  • Press Enter to see the extracted data.

using cell reference from another workbook with indirect function in excel


Example 8 – Using the INDIRECT Function to Refer an Array in the VLOOKUP Function

Extract prices to another chart based on the shops.

refer to an array with indirect and vlookup in excel

Define fish names and prices in the two different shops. Here, B6:C9 as Shop_1 and B13:C16 as Shop_2.

The syntax of the VLOOKUP function is:

=VLOOKUP(lookup_value, table_array, col_index_number, [range_lookup])

  • Enter the formula in G9:
=VLOOKUP(E9,INDIRECT("Shop_"&F9),2,FALSE)
  • Press Enter and auto-fill the rest of the cells.

refer to an array with indirect and vlookup in excel


Example 9 – Using the INDIRECT Function to Refer Another Cell Reference from a Specific Cell

  • To display the number of B11 in the output cell F10, enter the following formula:
=INDIRECT(D11)
  • Press Enter to see the result.

referring to another cell reference from a specific cell with indirect function in excel


Example 10 – Referring to a Named Range with the INDIRECT Function in Excel

Define the name of this entire table.

referring named range with indirect function in excel

Step 1:

  • Select the entire table.
  • In the Name Box, enter the name of the table: Height_data.

referring named range with indirect function in excel

Step 2:

  • In E8, define the name of the table.
  • Select a random blank cell. Here, G4 and enter:
=INDIRECT(E8)
  • Press Enter and the entire table will be displayed.

 

referring named range with indirect function in excel


Example 11 – Transposing a Table with the INDIRECT and the ADDRESS Functions in Excel

The syntax of this function is:

=ADDRESS(row_num, column_num, [abs_num], [a1], [sheet_text])

The dataset below showcases name, height, and age.

To transpose the entire table:

indirect with address function in excel

Step 1:

  • Select the output cell B14 and enter:
=INDIRECT(ADDRESS(COLUMN(B4) - COLUMN($B$4) + ROW($B$4), ROW(B4) - ROW($B$4) + COLUMN($B$4)))
  • Press Enter and the formula will return ‘Name’.

indirect with address function in excel

Step 2:

  • Drag the Fill Handle to the right.

indirect with address function in excel

Step 3:

  • Drag down the Fill Handle.

indirect with address function in excel

This is the output.

indirect with address function in excel

How Does This Formula Work?

The first argument of the ADDRESS function, “COLUMN(B4) – COLUMN($B$4) + ROW($B$4)” defines the row number by converting the column number of B4.

The second argument, “ROW(B4) – ROW($B$4) + COLUMN($B$4)” defines the column number by converting the row number of B4.

Read More: How to Use INDIRECT ADDRESS Functions in Excel 


Example 12 – Using the INDIRECT Function for Data Validation in Excel

The dataset showcases 3 smartphone brands, and model names. To create drop-down lists for all smartphone brands:

Step 1:

  • Select B5:B10 (model names of Apple products).
  • In the Name Box, define the name of this range of cell: Apple.

data validation with indirect function in excel

Step 2:

  • In B12, enter Apple.
  • Select B12.
  • Go to the Data tab and choose Data Validation in Data Tools.

data validation with indirect function in excel

Step 3:

  • In Allow, choose List.
  • In Source, enter:
=INDIRECT(B12)
  •  Press Enter to see the result.

data validation with indirect function in excel

  • Go to Cell B12 and you’ll find the drop-down for all Apple products. Follow the same procedure to create drop-downs for the other brands.

data validation with indirect function in excel


The INDIRECT Function Is Not Working in Excel

1. #REF! Error

#REF! Error may be displayed in 3 cases:

  • Invalid Cell Reference as ref_text: check the arguments of the function to make sure cell reference valid.
  • Exceeding Range Limit: Excel 2007, 2010, and 2013 have a row limit of 1,048,576 and a column limit of 16,384. If you exceed this limit, #REF! Error may occur.
  • Using Closed Worksheets or Workbooks:  Open the worksheets or workbooks before using them in the function.

2. #NAME? Error

This error occurs for misspelled functions.


Things to Keep in Mind

If you don’t use double-quotes(“ “) while referring to a cell or a range of cells as a text string, the function will return a #REF error.

Unless you define the format of the cell reference in the 2nd argument, the default format will be A1 style.


Download Practice Workbook

Download the Excel workbook.


Excel INDIRECT Function: Knowledge Hub


<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nehad Ulfat
Nehad Ulfat

NEHAD ULFAT is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including ABACUS, AutoCAD, Rhinoceros, Maxsurf, and Hydromax. He got his B.Sc in Naval Architecture & Marine Engineering from BUET but switched gears, working as a content developer.  In this role, he creates techy content all about Excel... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo