Excel INDIRECT Function, with Examples:
—————————————————————————————————————————–
Excel INDIRECT Function:
The INDIRECT function returns the result of a specified reference.
Syntax: INDIRECT(text_reference, reference_type)
1. text_reference is a reference to a cell and that cell can contain: (i) an A1-style reference; (ii) an R1C1-style reference; (iii) a named range; or (iv) a text string which provides reference to a cell.
2. If reference is to another workbook, that workbook should be open else the function will return a #REF! error.
3. reference_type specifies the type of reference: text_reference is a reference to a cell and that cell is considered to contain an R1C1 style reference if reference_type is FALSE, else it will be considered to contain an A1 style reference if reference_type is omitted or TRUE.
An INDIRECT function within a formula can change a cell reference without changing the formula itself, because the INDIRECT function creates a cell reference from text in another cell. Consider the formula =IF(INDIRECT(A2)>10,”Y”,”N”) and if cell A2 contains the text B3, then the content of cell B3 is evaluated. Now without changing the formula, text contained in cell A2 can be changed to B4 and then the content of cell B4 will get evaluated with the same formula.
A reference to a cell within a formula gets updated if the cell is moved by cut or delete commands or by inserting rows or columns. By using the INDIRECT function, the cell reference will remain unchanged. Consider the formula =IF(B5>10,”Y”,”N”) and if a row is inserted above B5, then the formula will change to =IF(B6>10,”Y”,”N”). However, if the formula is =IF(INDIRECT(“B5”)>10, “Y”, “N”), then the formula will always evaluate contents of cell B5.
Example 1 – Reference from a Cell Value:
1.333 -> =INDIRECT(A2) [Formula]
Formula uses indirect function for reference from a cell value, and returns 1.333 (Refer Table 1).
Formula returns value of the reference in cell A2.
Cell A2 contains the text: “B2”.
Cell B2 contains the value: 1.333. The INDIRECT function evaluates the reference as: = B2, which is equal to 1.333.
Changing the text in cell A2 to “B3″ will return 45.
—————————————————————————————————————————-
Example 2 – Reference from a Cell Value and Text:
=INDIRECT(“B”&A5) [Formula]
Formula uses indirect function for reference from a cell value and text, and returns 62 (Refer Table 2).
Formula evaluates value of a reference in cell A5.
=INDIRECT(“B”&A5) evaluates to “=B5”.
Cell B5 contains the value: 62. The INDIRECT function evaluates the reference in cell A5 as 5, and returns value in cell B5 which is 62.
——————————————————————————————————
Example 3 – Reference to a Named Range:
=INDIRECT(A4) [Formula]
Formula uses indirect function for reference to a named range. Cell A4 contains the text: “George”.
Cell B4 (is a named range) has the defined name “George” (refer Table 3b), and the value of the defined name is returned.
Cell B4 contains the value: 10. The INDIRECT function evaluates the reference as: = B4, which is equal to 10 (Table 3a).
——————————————————————————————————-
Example 4 – Reference To a Different Sheet:
=INDIRECT(A6&”!”&”B6″) [Formula]
Formula uses indirect function for reference to a different worksheet, and returns 101 (Refer Table 4).
The Table 4 is a snapshot from the worksheet named “Sheet1”.
Formula evaluates value of a reference in cell A6.
=INDIRECT(A6&”!”&”B6″) evaluates to: =Sheet1!B6.
Cell B6 contains the value 101. The INDIRECT function evaluates the reference in cell A6 as Sheet1, and returns value in cell B6 (in Sheet1 viz. =Sheet1!B6) which is 101.
——————————————————————————————————————————-
Example 5 – Reference To a Different Workbook:
=INDIRECT(“[“&A7&”]” & A6 & “!” & “B7”) [Formula]
Formula uses indirect function for reference to a different workbook, and returns 99 (Refer Table 5).
The INDIRECT function can create linked references to other workbooks, but will return a #REF! error if that workbook is closed.
The table is a snapshot from the workbook named “Workbook1.xls” and worksheet named “Sheet1”.
Formula evaluates values of references in cells A7 and A6.
=INDIRECT(“[“&A7&”]”&A6&”!”&”B7″) evaluates to: =[Workbook1.xls]Sheet1!B7.
Cell B7 contains the value: 99. The INDIRECT function evaluates the reference in cell A7 as: Workbook1.xls, and in cell A6 as: Sheet1, and returns value in cell B7 (viz. =[Workbook1.xls]Sheet1!B7) which is 99.
Excel INDIRECT Function
VBA TUTORIAL LOGIN
Hi ,Logout
Cond Statements in VBA Test
Text Strings in VBA
Custom Number Formats
Excel VBA Built-in Events
ActiveX & Form Controls
Application.OnTime Method
MsgBox & InputBox in VBA
- Ebook of Excel Solutions
- Excel Formulas Ebook
- Ebook of Excel Formulas
- Unique List, Sorted in Ascending Order, Appearing in One Column and Not in Other
- Count Rows containing Multiple specified Values
- SUM AND / OR Criteria for Multiple Columns
- Position of First Number in a String
- Extract Unique sub-strings of 1st 5 Characters from each column cell
- Count Maximum Number of Consecutive Occurrences of a Value
- SUMIF with Date Range, Multiple Month Names / Numbers & Year
- Extract Text After Last Occurrence of a Number in a String
- Extract Values which appear ONLY once, from a Column
- Excel Functions
- Excel Text and String Functions: TRIM & CLEAN
- ASCII Code, Extended ASCII characters (8-bit system) and ANSI Code.
- Excel CODE & CHAR Functions, VBA Asc & Chr Functions
- Excel Text and String Functions: LEFT, RIGHT, MID, LEN, FIND, SEARCH, REPLACE, SUBSTITUTE
- CHOOSE Function in Excel
- Excel IF Function and IF Statements
- Excel VLOOKUP Function
- Excel OFFSET Function
- Excel INDIRECT Function
- Excel SUMPRODUCT Function
- Excel Pivot Tables
- Printing a Pivot Table Report – Excel
- Create a Pivot Chart in Excel – graphical display of a Pivot Table
- Excel Pivot Table Design & Layout, Pivot Table Styles
- Excel Pivot Table Report – Sort Data in Row & Column Labels & in Values Area, use Custom Lists
- Excel Pivot Tables: Filter Data, Items, Values & Dates
- Excel Pivot Tables: Insert Calculated Fields & Calculated Items, Create Formulas
- Excel Pivot Table Report – Summary Functions & Custom Calculations, Insert Calculated Fields or Calculated Items
- Excel Pivot Table Report – Group Items, Group Date and Time Values
- Excel Pivot Table Report – Field Settings, Expand or Collapse Fields & Items, Refresh Data, Change Data Source & Show or Hide options
- Excel Pivot Table Report – Clear All, Remove Filters, Select Mutliple Cells or Items, Move a Pivot Table
- Excel Tips
- Case Sensitive Vlookup in Excel; Finding the 1st, 2nd, nth or last occurrence of the Lookup Value
- Vlookup Multiple Values – Return MULTIPLE corresponding values for ONE Lookup Value
- Excel Date and Time Functions and Formulas
- Find ‘Smallest’, ‘Largest’, ‘K-th Smallest’ and ‘K-th Largest’ Numbers in a Range
- Remove Duplicates in a range, using “Remove duplicates” button in Data Tools
- Remove Duplicates or Create a List of Unique Records using Excel Formula
- Remove Duplicates or Create a List of Unique Records using Advanced Data Filter
- Count Number of Unique Values in a Range (with Excel Functions)
- Shade Alternate Rows – Conditional Formatting
- Left Lookup with Vlookup Excel Function
- Excel VBA
- Excel VBA: ActiveX Controls, Form Controls & AutoShapes on a Worksheet
- ChartFormat object – line, fill & effect formatting for chart elements: FillFormat object, LineFormat object, ShadowFormat object, GlowFormat object, SoftEdgeFormat object, ThreeDFormat object
- Child Objects common for many chart elements: Border Object, ChartFillFormat Object, Interior Object, Font Object
- Chart Elements in Excel VBA (Part 2) – Chart Series, Data Labels, Chart Legend
- Chart Elements in Excel VBA (Part 1) – Chart Title, Chart Area, Plot Area, Chart Axes
- Charts in Excel VBA – Add a Chart, the Chart object & the ChartObject object
- Create Charts in Excel VBA: Embedded Charts – Line with Markers; Clustered Stacked Column Chart; Clustered Stacked Bar Chart displaying Variance; Pie chart; XY Scatter chart & Bubble chart
- Excel VBA Debugging Tools in Visual Basic Editor – Breakpoints & Break Mode, Stepping Through Code, Debugging Views
- Excel VBA Errors & Error Handling, On Error & Resume Satements, Exit Statement, Err Object
- Excel VBA Date & Time Functions; Year, Month, Week & Day Functions
- ExcelAnytime Site
- My Account
- Website Use Policy
- Excel VBA Online Tutorial
- Testimonials GlobaliConnect.com
- About ExcelAnytime.com
- Excel VBA Online Tutorial – learn Excel VBA programming & access examples, illustrations, live codes and downloadable files
- Excel and VBA Services
- Sample Data-Articles
- test
- Getting Started
- Typography
- Article Categories Module
- Search Module
- Joomla!
- Authentication
- Articles Category Module
- Statistics Module
- Parameters
- Fruit Shop SiteGrowersJoomla!
- Parameters
- Editors
- Banner Module
- Professionals
- Editors-xtd
- Custom HTML Module
- Sample Sites
- Search
- Feed Display
- The Joomla! Community
- Users
- News Flash
- Menu Module
- Weblinks
- Related Items Module
- Breadcrumbs Module
- News Feeds
- Login Module
- Typography
- Who’s Online
- Most Read Content
- Wrapper Module
- News Flash
- Menu Module
- Related Items Module
- Breadcrumbs Module
- Login Module
- Who’s Online
- Latest Users Module
- Banner Module
- Most Read Content
- News Flash
- Related Items Module
- Archive Module
- Article Categories Module
- Articles Category Module
- Latest Articles Module
- Phyllopteryx
- Spotted Quoll
- Wobbegone
- Cradle Mountain
- Pinnacles
- Blue Mountain Rain Forest
- Ormiston Pound
- Australian Parks
- First Blog Post
- Second Blog Post
- Cradle Mountain
- Pinnacles
- Blue Mountain Rain Forest
- Ormiston Pound
- Koala
- Phyllopteryx
- Spotted Quoll
- Wobbegone
- VBATutorial - Cond Stmnts