search
HomeSoftware TutorialOffice SoftwareHow to Use the INDIRECT Function in Excel

  • 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>)

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)

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>)

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)

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>)

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)

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))

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)

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)

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>)

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
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
Excel CONCATENATE function to combine strings, cells, columnsExcel CONCATENATE function to combine strings, cells, columnsApr 30, 2025 am 10:23 AM

This article explores various methods for combining text strings, numbers, and dates in Excel using the CONCATENATE function and the "&" operator. We'll cover formulas for joining individual cells, columns, and ranges, offering solutio

Merge and combine cells in Excel without losing dataMerge and combine cells in Excel without losing dataApr 30, 2025 am 09:43 AM

This tutorial explores various methods for efficiently merging cells in Excel, focusing on techniques to retain data when combining cells in Excel 365, 2021, 2019, 2016, 2013, 2010, and earlier versions. Often, Excel users need to consolidate two or

Excel: Compare two columns for matches and differencesExcel: Compare two columns for matches and differencesApr 30, 2025 am 09:22 AM

This tutorial explores various methods for comparing two or more columns in Excel to identify matches and differences. We'll cover row-by-row comparisons, comparing multiple columns for row matches, finding matches and differences across lists, high

Rounding in Excel: ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING functionsRounding in Excel: ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING functionsApr 30, 2025 am 09:18 AM

This tutorial explores Excel's rounding functions: ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING, MROUND, and others. It demonstrates how to round decimal numbers to integers or a specific number of decimal places, extract fractional parts, round to the

Consolidate in Excel: Merge multiple sheets into oneConsolidate in Excel: Merge multiple sheets into oneApr 29, 2025 am 10:04 AM

This tutorial explores various methods for combining Excel sheets, catering to different needs: consolidating data, merging sheets via data copying, or merging spreadsheets based on key columns. Many Excel users face the challenge of merging multipl

Calculate moving average in Excel: formulas and chartsCalculate moving average in Excel: formulas and chartsApr 29, 2025 am 09:47 AM

This tutorial shows you how to quickly calculate simple moving averages in Excel, using functions to determine moving averages over the last N days, weeks, months, or years, and how to add a moving average trendline to your charts. Previous articles

How to calculate average in Excel: formula examplesHow to calculate average in Excel: formula examplesApr 29, 2025 am 09:38 AM

This tutorial demonstrates various methods for calculating averages in Excel, including formula-based and formula-free approaches, with options for rounding results. Microsoft Excel offers several functions for averaging numerical data, and this gui

How to calculate weighted average in Excel (SUM and SUMPRODUCT formulas)How to calculate weighted average in Excel (SUM and SUMPRODUCT formulas)Apr 29, 2025 am 09:32 AM

This tutorial shows you two simple ways to calculate weighted averages in Excel: using the SUM or SUMPRODUCT function. Previous articles covered basic Excel averaging functions. But what if some values are more important than others, impacting the f

See all articles

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

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment