Indirect() won't work with a formula entered as Text?

prabha_friend

Board Regular
Joined
Jun 28, 2011
Messages
95
In J14:
='[Alan Beta Strat Bond and GBO 25th February.xlsx]MULTISECTOR Front Sheet'!$B$2 (Formatted as Text)
In A2:
=INDIRECT(FilePath)
Note:
Range("J14") Named as Filepath

Why am I getting #REF!

This is not the right way?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi

2 remarks

1 - When you say formatted as Text you mean it displays the string "='[Alan..."? in that case, Indirect() cannot interpret the "="

2 - remember that Indirect() only works with open workbooks.
 
Upvote 0
Hi pg,
I removed the "=" from the formula. Now my formula is just the following:
'[Alan Beta Strat Bond and GBO 25th February.xlsx]MULTISECTOR Front Sheet'!$B$2

But still I am getting an #REF!

One more thing the file is opened but still. How to make it work?
 
Upvote 0
A Leading ' is a special character that signifies the following characters should be treated as text.
And it is usually ignored by formulas
So the Indirect formula is actually seeing the cell's contents as
[Alan Beta Strat Bond and GBO 25th February.xlsx]MULTISECTOR Front Sheet'!$B$2
Without that leading '

Try doubling that leading ' so the cell's contents looks like
''[Alan Beta Strat Bond and GBO 25th February.xlsx]MULTISECTOR Front Sheet'!$B$2

That's 2 apostraphe's, not a regular quote mark.
 
Upvote 0
Hi,
Open the alan beta etc workbook.
In the cell where you want to reference the alan beta workbook (j14) type =Cell("address", now click on the cell you want in the Alan beta workbook) and press enter.
Now A2 =indirect(j14 or Filepath,1) whichever you prefer. Don't forget the ,1 at the end of the indirect formula.
 
Upvote 0
Thank you very much Jonmo. It's working great. Don't take me annoying. I have one more question over that:

Can we use an hybrid reference? (Some parts of the formula Indirect: (say referring an opened file name) and some other parts Direct: (say sheetname and range))

How to do like this?

A1: (as Text) with two apostraphes's

''[Alan Beta Strat Bond and GBO 25th February.xlsx]"

A2: (As formula)
=Indirect(A1&"MULTISECTOR Front Sheet'!$B$2")

Otherwise I have to duplicate many Indirect cells for every variation of Sheetname and Range.

Thanks in advance :)
 
Upvote 0
Yes, but A1 should only contain the 'leading' apostrophes, there should be none at the end, because that comes after the sheet name which you've put into the formula.
So A1 should be
''[Alan Beta Strat Bond and GBO 25th February.xlsx]
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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