Indirect for autofill

GedSalter

Board Regular
Joined
Apr 24, 2019
Messages
80
Hi Guys

i have the following formula which I need to autofill down to 3800 rows

A1 ON PORTAL SHEET has a code which referes to a tab sheet name
A2 refer to the cell from that particular sheet I wish to retrieve the data.

the cell the first formula is in is X1, there the formula will autofill down.


=INDIRECT("'" & A$1&"'!"&"A2")

the following rows should read
=INDIRECT("'" & A$1&"'!"&"A3")
=INDIRECT("'" & A$1&"'!"&"A4")
=INDIRECT("'" & A$1&"'!"&"A5") etc..

I have looked at many solutions but none work. Something that I thought was so simple is not working.

Thank you in advance to any solution.


regards

Ged
 
Last edited:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
What cells are these INDIRECT formulas in? That is, what cell has the formula that refers to A2?

As an example, if the formula is in row 2, then you can do this, and you can copy it down.
Excel Formula:
=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))
 
Upvote 0
Solution
What cells are these INDIRECT formulas in? That is, what cell has the formula that refers to A2?

As an example, if the formula is in row 2, then you can do this, and you can copy it down.
Excel Formula:
=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))
the start cell is X2
 
Upvote 0
What cells are these INDIRECT formulas in? That is, what cell has the formula that refers to A2?

As an example, if the formula is in row 2, then you can do this, and you can copy it down.
Excel Formula:
=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))
cell X2
 
Upvote 0
What cells are these INDIRECT formulas in? That is, what cell has the formula that refers to A2?

As an example, if the formula is in row 2, then you can do this, and you can copy it down.
Excel Formula:
=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))
my excel version is Office 2017
 
Upvote 0
What cells are these INDIRECT formulas in? That is, what cell has the formula that refers to A2?

As an example, if the formula is in row 2, then you can do this, and you can copy it down.
Excel Formula:
=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))
wow. that worked a treat. Now I understand how that works.
 
Upvote 0
That formula may well suit you fine. To me though it isn't as robust as it might be. For example, if you later decide to insert one or more new rows at the top of the sheet that the formula is in, the results will not longer point at rows 2, 3, 4 etc of the referenced sheet.

Here is my example of the 'other' sheet.

GedSalter.xlsm
A
1
2zzz
3yyy
4www
5
abc


Here is my 'PORTAL' sheet with the previously suggested formula in column Y and an alternative suggestion in column X.
Both formulas return the same results.

GedSalter.xlsm
AXY
1abc
2zzzzzz
3yyyyyy
4wwwwww
PORTAL
Cell Formulas
RangeFormula
X2:X4X2=INDIRECT("'" & A$1&"'!A"&ROWS(X$2:X2)+1)
Y2:Y4Y2=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))


If a new row is inserted at the top of this sheet though, the results vary with one automatically adjusting and still points at the original cells and one not so.
Just something to consider with your own possible circumstances. :)

GedSalter.xlsm
AXY
1
2abc
3zzzyyy
4yyywww
5www0
PORTAL
Cell Formulas
RangeFormula
X3:X5X3=INDIRECT("'" & A$2&"'!A"&ROWS(X$3:X3)+1)
Y3:Y5Y3=INDIRECT("'" & A$2&"'!"&ADDRESS(ROW(),1))
 
Upvote 0
That formula may well suit you fine. To me though it isn't as robust as it might be. For example, if you later decide to insert one or more new rows at the top of the sheet that the formula is in, the results will not longer point at rows 2, 3, 4 etc of the referenced sheet.

Here is my example of the 'other' sheet.

GedSalter.xlsm
A
1
2zzz
3yyy
4www
5
abc


Here is my 'PORTAL' sheet with the previously suggested formula in column Y and an alternative suggestion in column X.
Both formulas return the same results.

GedSalter.xlsm
AXY
1abc
2zzzzzz
3yyyyyy
4wwwwww
PORTAL
Cell Formulas
RangeFormula
X2:X4X2=INDIRECT("'" & A$1&"'!A"&ROWS(X$2:X2)+1)
Y2:Y4Y2=INDIRECT("'" & A$1&"'!"&ADDRESS(ROW(),1))


If a new row is inserted at the top of this sheet though, the results vary with one automatically adjusting and still points at the original cells and one not so.
Just something to consider with your own possible circumstances. :)

GedSalter.xlsm
AXY
1
2abc
3zzzyyy
4yyywww
5www0
PORTAL
Cell Formulas
RangeFormula
X3:X5X3=INDIRECT("'" & A$2&"'!A"&ROWS(X$3:X3)+1)
Y3:Y5Y3=INDIRECT("'" & A$2&"'!"&ADDRESS(ROW(),1))
[
Cell Formulas
RangeFormula
 
Upvote 0
Hi Peter this looks good But I wish to start the column from say AQ ie AQ41 then fill down with the reference to every tenth column value ie BA41,BK41,BU41 etc. is that possible?
 
Last edited by a moderator:
Upvote 0
I wish to start the column from say AQ ie AQ41
Is that the formula cell or the cell on the other sheet?

.. reference to every tenth column value ie BA41,BK41,BU41
:confused: That does not seem to match the original description

1694404286721.png
 
Upvote 0

Forum statistics

Threads
1,223,877
Messages
6,175,139
Members
452,615
Latest member
bogeys2birdies

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