Table of Contents
Quick Links
What Does the INDIRECT Function Do?
The INDIRECT Syntax
Things to Bear in Mind Before Using the INDIRECT Function
How to Use the INDIRECT Function
Basic Examples
Real-world Example 2
Home Software Tutorial Office Software How to Use the INDIRECT Function in Excel

How to Use the INDIRECT Function in Excel

Feb 06, 2025 pm 06:04 PM

  • What Does the INDIRECT Function Do?
  • The INDIRECT Syntax
  • Things to Bear in Mind Before Using the INDIRECT Function
  • How to Use the INDIRECT Function

You may be well-accustomed to using cell references in Excel, but did you know you could go one step further and create your own cell references? This is where the INDIRECT function comes in handy.

What Does the INDIRECT Function Do?

Excel's INDIRECT function turns a text string into a reference. This function has several practical benefits:

  • It allows you to create dynamic references. For example, you can change a reference to a cell within a formula without changing the formula itself.
  • The INDIRECT function is a great way to create links between worksheets within a workbook.
  • You can use information you already have in your spreadsheet to create a reference.
  • The reference created using the INDIRECT function will stay the same, even if your sheet's structure changes.

The INDIRECT Syntax

By default, references in Excel use the A1 reference style, which means that it refers to the column first, and then the row number. However, the INDIRECT function enables you to switch these around.

This inverted order is known as the R1C1 reference style, where the "R" refers to a row, and the "C" refers to a column. For this reason, the INDIRECT function contains two arguments. Here is the syntax:

=INDIRECT(<em>x</em>,<em>y</em>)
Copy after login
Copy after login
Copy after login
Copy after login

where x is the reference text, and y (optional) is the reference style.

More specifically, x (the reference text) can be an A1-style reference, an R1C1-style reference, a predefined name, or a cell reference. If x refers to another workbook, that second workbook must be open. It's also worth noting that you cannot reference another workbook if you're using Excel for the web.

y (the reference style) is an optional argument. If you choose not to include this argument, Excel will automatically use the default A1-style reference, though you can also type TRUE here to force Excel to use this reference style. Typing FALSE will tell Excel to use the R1C1 reference style.

In this article, I will use A1-style references to show you how the INDIRECT function works. Once you've grasped its concepts, you can experiment using R1C1-style references.

The outcome of the INDIRECT function is a reference.

Things to Bear in Mind Before Using the INDIRECT Function

There are a few things you should know before you start working with INDIRECT in your spreadsheet:

  1. This is a volatile function, meaning it's constantly trying to update. Using this function in a large spreadsheet could result in it being sluggish or even dysfunctional.
  2. To make full use of the INDIRECT function, you would benefit from first knowing how to create named references in Excel.
  3. The ampersand (&) operator is a great way to create a text string that can be used as a reference.

How to Use the INDIRECT Function

So that you can get your head around how you can use INDIRECT in practise, let's see how it works in its most basic form.

Basic Examples

In this example, typing

=INDIRECT(A1)
Copy after login
Copy after login
Copy after login

into cell B2 turns cell A1 into a reference to cell D1. This is why the result is 5.

How to Use the INDIRECT Function in Excel

In this example, typing

=INDIRECT(<em>x</em>,<em>y</em>)
Copy after login
Copy after login
Copy after login
Copy after login

into cell B2 first turns A2 into a cell reference, and then sums the cells in that reference. This is because the INDIRECT function is embedded within the SUM function.

How to Use the INDIRECT Function in Excel

Now, let's look at using the INDIRECT function to reference a cell in another sheet. Cell A1 of Sheet2 contains the number 100, and we want to create an INDIRECT reference to that cell in the current sheet. First, we need to type Sheet2!A1 into cell A3, and then we need to turn this into a reference using the INDIRECT function by typing

=INDIRECT(A1)
Copy after login
Copy after login
Copy after login

into cell B3.

How to Use the INDIRECT Function in Excel

However, we can make this much easier by using a named reference. For example, if we were to rename cell A1 of Sheet2 TOTAL, we could use this within our INDIRECT reference. This is particularly handy if you're creating a reference to another sheet, as it helps you avoid having to remember the exclamation point in the syntax. Also, if your sheet name changes, the INDIRECT reference will not adapt to this change, so using a named reference is a more secure and permanent alternative.

How to Use the INDIRECT Function in Excel

Real-world Example 1

Now that we understand how INDIRECT works, let's explore how we can use it to make our worksheets tick in the real world.

As is often the case in Excel, there is more than one way to achieve the same outcome. For example, you could include the TAKE function to make the following process even more dynamic. However, our aim here is to exemplify the use of the INDIRECT function, so that you can then go ahead and use it in your own way.

Here, we're tracking the number of goals a football team scores in each game, and we want to work out the average for the previous three games.

How to Use the INDIRECT Function in Excel

First, we will use the COUNT function to work out how many games the team has played so far. Typing

=INDIRECT(<em>x</em>,<em>y</em>)
Copy after login
Copy after login
Copy after login
Copy after login

into cell E1 will count the total number of cells in column B containing numbers, thus telling us how many games have been played.

If you want to count text as well as numbers, use the COUNTA function instead.

How to Use the INDIRECT Function in Excel

Now, we're ready to use the INDIRECT function to turn the data in cell E1 into a reference. At this point, our aim is to find the average of the values in cells B6 to B8. Here's how the INDIRECT function will help us to do this. Start by typing

=INDIRECT(A1)
Copy after login
Copy after login
Copy after login

in cell E2, because we're telling Excel that we ultimately want to find an average, and we're also using the INDIRECT function to tell Excel where to look to calculate this average.

The first cell we will reference in our AVERAGE calculation is B8, so we will add

=SUM(INDIRECT(A2))
Copy after login

to our formula. Notice how we've used quotes around the column reference, as we're using that text to create a cell reference.

The next cell we will reference in our AVERAGE calculation is B7, which is one cell upwards from B8. So, adding

=INDIRECT(A3)
Copy after login

to our formula means that Excel will create a cell reference that starts in column B, and then minuses 1 from the value in E1.

Finally, we want to reference cell B6, which is two cells upwards from B8 in our AVERAGE calculation, and then add the closing parenthesis:

=COUNT(B:B)
Copy after login

This correctly calculates the average of 3, 1, and 1, which is the total number of goals scored in the last three games.

How to Use the INDIRECT Function in Excel

Now, when we add more data into column B, the value in cell E1 will increase, as the COUNT function recognizes that there are more values in column B, and the INDIRECT references will update accordingly to always capture the last three values in our AVERAGE formula. All this happens without having to change the formula we typed into cell E2.

How to Use the INDIRECT Function in Excel

Real-world Example 2

Let's look at one more example. This time, we will use named references so that we can use INDIRECT with Excel's VLOOKUP function.

We want Excel to tell us how much money each of the four individuals made in either week 1 or week 2, with the option to change that week number if needed.

How to Use the INDIRECT Function in Excel

To begin, we need to name cells B1 to C5 as "week_1," and cells B7 to B11 as "week_2." Then, in cell G2, we will type

=INDIRECT(<em>x</em>,<em>y</em>)
Copy after login
Copy after login
Copy after login
Copy after login

because we want Excel to look up Tom's value in the range we named "week_1," and return the corresponding value in the second column of that range as an exact match.

How to Use the INDIRECT Function in Excel

We can then use the fill handle to complete the data for the other three individuals, knowing that the references we created are both relative to their respective rows and also secure due to our use of named references.

How to Use the INDIRECT Function in Excel

Then, any changes to the values in columns C or F would automatically apply to the formula we have just written.


To complete the process of making your spreadsheet fully dynamic and tidy, you could add drop-down menus using Excel's Data Validation tool. In the example above, you could have the individuals' names accessible through a drop-down menu, so that the lookup table takes up only a single row.

The above is the detailed content of How to Use the INDIRECT Function in Excel. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to Create a Timeline Filter in Excel How to Create a Timeline Filter in Excel Apr 03, 2025 am 03:51 AM

In Excel, using the timeline filter can display data by time period more efficiently, which is more convenient than using the filter button. The Timeline is a dynamic filtering option that allows you to quickly display data for a single date, month, quarter, or year. Step 1: Convert data to pivot table First, convert the original Excel data into a pivot table. Select any cell in the data table (formatted or not) and click PivotTable on the Insert tab of the ribbon. Related: How to Create Pivot Tables in Microsoft Excel Don't be intimidated by the pivot table! We will teach you basic skills that you can master in minutes. Related Articles In the dialog box, make sure the entire data range is selected (

If You Don't Rename Tables in Excel, Today's the Day to Start If You Don't Rename Tables in Excel, Today's the Day to Start Apr 15, 2025 am 12:58 AM

Quick link Why should tables be named in Excel How to name a table in Excel Excel table naming rules and techniques By default, tables in Excel are named Table1, Table2, Table3, and so on. However, you don't have to stick to these tags. In fact, it would be better if you don't! In this quick guide, I will explain why you should always rename tables in Excel and show you how to do this. Why should tables be named in Excel While it may take some time to develop the habit of naming tables in Excel (if you don't usually do this), the following reasons illustrate today

You Need to Know What the Hash Sign Does in Excel Formulas You Need to Know What the Hash Sign Does in Excel Formulas Apr 08, 2025 am 12:55 AM

Excel Overflow Range Operator (#) enables formulas to be automatically adjusted to accommodate changes in overflow range size. This feature is only available for Microsoft 365 Excel for Windows or Mac. Common functions such as UNIQUE, COUNTIF, and SORTBY can be used in conjunction with overflow range operators to generate dynamic sortable lists. The pound sign (#) in the Excel formula is also called the overflow range operator, which instructs the program to consider all results in the overflow range. Therefore, even if the overflow range increases or decreases, the formula containing # will automatically reflect this change. How to list and sort unique values ​​in Microsoft Excel

How to Format a Spilled Array in Excel How to Format a Spilled Array in Excel Apr 10, 2025 pm 12:01 PM

Use formula conditional formatting to handle overflow arrays in Excel Direct formatting of overflow arrays in Excel can cause problems, especially when the data shape or size changes. Formula-based conditional formatting rules allow automatic formatting to be adjusted when data parameters change. Adding a dollar sign ($) before a column reference applies a rule to all rows in the data. In Excel, you can apply direct formatting to the values ​​or background of a cell to make the spreadsheet easier to read. However, when an Excel formula returns a set of values ​​(called overflow arrays), applying direct formatting will cause problems if the size or shape of the data changes. Suppose you have this spreadsheet with overflow results from the PIVOTBY formula,

How to change Excel table styles and remove table formatting How to change Excel table styles and remove table formatting Apr 19, 2025 am 11:45 AM

This tutorial shows you how to quickly apply, modify, and remove Excel table styles while preserving all table functionalities. Want to make your Excel tables look exactly how you want? Read on! After creating an Excel table, the first step is usual

How to Use the PIVOTBY Function in Excel How to Use the PIVOTBY Function in Excel Apr 11, 2025 am 12:56 AM

Quick Links The PIVOTBY Syntax

Excel MATCH function with formula examples Excel MATCH function with formula examples Apr 15, 2025 am 11:21 AM

This tutorial explains how to use MATCH function in Excel with formula examples. It also shows how to improve your lookup formulas by a making dynamic formula with VLOOKUP and MATCH. In Microsoft Excel, there are many different lookup/ref

How to Use Excel's AGGREGATE Function to Refine Calculations How to Use Excel's AGGREGATE Function to Refine Calculations Apr 12, 2025 am 12:54 AM

Quick Links The AGGREGATE Syntax

See all articles