How To Use Excel Indirect Function Examples

The excel INDIRECT function can convert a text string to a valid reference. For example, INDIRECT(“A1”) will return a reference to cell A1, and INDIRECT(“Scores”) will return a reference to a named range ( suppose Scores is the range object name ). This article will tell you how to use the excel INDIRECT function with examples.

1. How To Use Excel INDIRECT Function.

  1. The excel INDIRECT function contains 2 arguments ref_text and [a1].
    INDIRECT(ref_text, [a1])
  2. The ref_text is a text string, it is the referenced excel object’s name such as “A1” or “Scores”.
  3. The text “A1” is cell A1‘s name, and the text “Scores” is the named range object’s name in this example ( How To Define Named Constant In Excel And Create Excel Named Range ).
  4. The argument a1 is optional, it is a boolean value to indicate the reference type of the ref_text value.
  5. The a1 argument’s default value is True, which means ref_text will use an A1-style reference.
  6. If you set the a1 argument’s value to False, then it will use R1C1-style to return the ref_text referenced object.

2. Why Need Excel INDIRECT Function?

  1. You can get excel object references by combining multiple strings from different cells.
  2. You can use a fixed cell as a variable to store different object names ( such as worksheet names ), and then use the INDIRECT function to reference the different worksheets.
  3. In one word, using the excel INDIRECT function, you can get different excel objects dynamically.

3. How To Use Excel Indirect Function Examples.

3.1 Use Excel Indirect Function To Reference Cells In Different Worksheets.

  1. Below are the data cells in this example, the data cell’s worksheet name is ‘Excel Functions’ which is saved in cell A8.
  2. And the cell name which we want to reference is ‘B2’ in this worksheet which is saved in cell B8.
  3. So we input the formula =INDIRECT(“‘”&A8&”‘”&”!”&B8) in cell C8 and press the enter key, then it will display the text Excel in cell C8.
  4. The text “‘”&A8&”‘”&”!”&B8 will be translated to “‘”&”Excel Functions”&”‘”&”!”&”B2″, and then be translated to “‘Excel Functions’!B2”.
  5. Then the formula =INDIRECT(“‘”&A8&”‘”&”!”&B8) will be translated to =INDIRECT(“‘Excel Functions’!B2”).
  6. Then the above formula will return the reference to cell B2 in the worksheet ‘Excel Functions’.
  7. So that it will insert the cell B2‘s value ( Excel ) located in the worksheet ‘Excel Functions’ into cell C8.
  8. Because the worksheet name contains white space, then we should use 2 single quotes to wrap the worksheet name in the formula.

3.2 Use Excel Indirect Function To Reference Different Cells Dynamically.

  1. Suppose there is a drop-down list in cell A1 (How To Add Drop-Down List In Excel Cell).
  2. The drop-down list contains 3 items B1, B2, and B3.
  3. Cell B1‘s value is Excel, cell B2‘s value is Word, and cell B3‘s value is PPT.
  4. Input the formula =INDIRECT(A1) in cell C1.
  5. Now when you select a different list item from the list in cell A1.
  6. You will find the text in cell C1 is also changed accordingly.
  7. Below is the example worksheet image.
  8. In this example, the formula =INDIRECT(A1) will return=INDIRECT(“B1”), =INDIRECT(“B2”), or=INDIRECT(“B3”).
  9. And the formula =INDIRECT(“B1”) will return =B1 when the user selects B1 from the list in cell A1.
  10. Then cell C1‘s value will be cell B1‘s value which is Excel.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.