Why indirect function

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Indirect is a great function for calculating multiple sheets with same data sets. This saves you writing a separate formula for each sheet in one table.
 
Upvote 0
sorry what do you mean by: "calculating multiple sheets with same data sets"
 
Upvote 0
Simple example:


Excel 2010
ABC
1
2
3
4
538
Blue



Excel 2010
ABC
1
2
3
4
544
Green



Excel 2010
ABC
1
2
3
4
557
Silver



Excel 2010
ABC
1
2
3
4
563
North



Excel 2010
AB
1Blue38
2Green44
3Silver57
4North63
Sheet2
Cell Formulas
RangeFormula
B1=INDIRECT(A1&"!"&"C5")
 
Upvote 0
Another advantage of indirect is that hard coded references never change, even if you delete rows or sort:


Excel 2010
ABCDEFGHIJKLMN
12220
22373885210127184
3113480190887282
49611689083128092
554133219447594
62143100878881228
7311776787574347
8105281738992776
Sheet3
Cell Formulas
RangeFormula
A1=SUM(G2:N6)


after deleting row 4:


Excel 2010
ABCDEFGHIJKLMN
11688
22373885210127184
3113480190887282
454133219447594
52143100878881228
6311776787574347
7105281738992776
Sheet3
Cell Formulas
RangeFormula
A1=SUM(G2:N5)


But with indirect:


Excel 2010
ABCDEFGHIJKLMN
12220
22373885210127184
3113480190887282
49611689083128092
554133219447594
62143100878881228
7311776787574347
8105281738992776
Sheet3
Cell Formulas
RangeFormula
A1=SUM(INDIRECT("G2:N6"))



Excel 2010
ABCDEFGHIJKLMN
12080
22373885210127184
3113480190887282
454133219447594
52143100878881228
6311776787574347
7105281738992776
Sheet3
Cell Formulas
RangeFormula
A1=SUM(INDIRECT("G2:N6"))
 
Upvote 0
So I have a workbook with multiple sheets where the target values are always in same columns.

On my first sheet I have a table that summarizes data from all sheets against different criteria, rows are Sheet Names and Columns are different categories/criteria;
Code:
=SUMIFS(INDIRECT("'"&$A2&"'"&"!$E$2:$E$1000"),INDIRECT("'"&$A2&"'"&"!$A$2:$A$1000"),TABLE!B$1)

This code saves me doing a separate sum formula for each sheet range & criteria. I'm sure there's other important uses for indirect but that's one of them. As the code copies down it automatically replaces the sheet name into the formula.

Good Excel indirect vid;

https://www.youtube.com/watch?v=GUClkvJ7Gag
 
Upvote 0

Forum statistics

Threads
1,214,878
Messages
6,122,062
Members
449,064
Latest member
scottdog129

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top