Changing Cell Refrerence when copying an Indirect Formula

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have the following Indirect formula in Cell B2

Code:
=SUBTOTAL(9,INDIRECT("'"&$A2&"'!G6:G50000"))

When I copy this formula into C2 , D2 etc , i need the last celll references to change i.e. G6:G50000 to change to H6:H50000 when copied to C2, I6:I50000 when copied to D2 etc

It would be appreciated if someone could assist me in amending my formula in order for this to change when copied to to next cell
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Assuming Z is the last column of interest (adjust) try in B2 and copy down
=SUBTOTAL(9,INDEX(INDIRECT("'"&$A2&"'!G$6:Z$50000"),0,ROWS(B$2:B2)))

Hope this helps

M.
 
Last edited:
Upvote 0
Thanks Marcelo.

when I Copy this formula which is in Cell B2 to C2 , it gives me the same value as in B2

I want to copy the formula to the right


Kindly amend your formula to accomodate the above
 
Upvote 0
Oops ... I didn't read your question carefully ... :oops:
To copy to the right, try (adjust Z)
B2
=SUBTOTAL(9,INDEX(INDIRECT("'"&$A2&"'!G$6:Z$50000"),0,COLUMNS($B2:B2)))

M.
 
Upvote 0
Many thanks Marcelo. Formula works perfectly
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,553
Members
449,038
Latest member
Guest1337

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