#ref error ='INDIRECT("B3")'!J5 using formula for sheetname reference

ooptennoort

Board Regular
Joined
Mar 29, 2021
Messages
66
Office Version
  1. 365
Platform
  1. Windows
J5 on Sheet2 refers to J5 on Sheet1. I want to copy Sheet 2 many times but want the reference to be dynamic (Sheetnamenumber minus 1 ie J5 on Sheet 3 refers to J5 on Sheet2 and ongoing).
I have B3 return sheetname (with =MID(CELL("filename";B1);FIND("]";CELL("filename";B1))+1;32)) and try to refer J5 indirectly to B3 but how... is it at all possible because of the single quotes... how to overcome this???
I tried:
='indirect("b3")'!j5
=indirect("b3")!j5
="'"&indirect("b3")&"'"!j5
but no luck...
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
It should be:

Excel Formula:
=indirect("'"&b3&"'!j5")
 
Upvote 0
Solution
It should be:

Excel Formula:
=indirect("'"&b3&"'!j5")
Thank you!
But now I am struggling getting the Sheetname[n] to substract 1. Why can't I get the substraction working?
I tried:
=INDIRECT("'"&(RIGHT($B$3;1)-1)&"'!J5")
=INDIRECT("'"&RIGHT($B$3;1)-1&"'!J5")
and even
=INDIRECT("'"&"RIGHT($B$3;1)-1"&"'!J5")
(my knowledge of syntax is just so subpar)
 
Upvote 0
Got it: =INDIRECT("'Sheet"&RIGHT($B$3;1)-1&"'!J5") (I forgot the 'Sheet' bit)
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,854
Members
449,051
Latest member
excelquestion515

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