how do I insert a filename into a formula from another cell?

  • Thread starter Thread starter dlevy
  • Start date Start date
D

dlevy

I have a spreadsheet with a filename in a cell.

I would like to reference that filename in a formula. I can't seem to get
it to work. "+cell number" doesn't work.

Any suggestions?
 
You would normally use INDIRECT to do this, along the lines of:

=INDIRECT("["&A1&"]Sheet1!C2")

where A1 contains your filename (with the .xls extension) and you are
trying to return data from C2 on Sheet1 of that file. However,
INDIRECT will only work with files that are open, so you would have to
have the file open for this to work.

Hope this helps.

Pete
 
Thanks Pete.

Pete_UK said:
You would normally use INDIRECT to do this, along the lines of:

=INDIRECT("["&A1&"]Sheet1!C2")

where A1 contains your filename (with the .xls extension) and you are
trying to return data from C2 on Sheet1 of that file. However,
INDIRECT will only work with files that are open, so you would have to
have the file open for this to work.

Hope this helps.

Pete

I have a spreadsheet with a filename in a cell.

I would like to reference that filename in a formula. I can't seem to
get
it to work. "+cell number" doesn't work.

Any suggestions?
 
Back
Top