Excel - Reference text in a cell inside a formula to specify a sheet name

Asked By navel151 on 19-Feb-10 02:01 PM
I would like to set up a formula that uses the text from an adjacent cell to
determine the sheet and cell location that is used in the formula.  i.e.
instead of =IF(sheet1!P9>0,sheet2!A4,"") I would like the sheet1 part of the
formula to be the text from a cell beside the formula cell.  How do I do tell
the formula to use that text rather than havin gto specify the sheet each
time?

Thx.




T. Valko replied to navel151 on 19-Feb-10 02:13 PM
Try it like this...

A1 = Sheet1

=IF(INDIRECT("'"&A1&"'!P9")>0,Sheet2!A4,"")

--
Biff
Microsoft Excel MVP
David Biddulph replied to navel151 on 19-Feb-10 02:13 PM
The function you need to look up in Excel help is INDIRECT.
--
David Biddulph
Jacob Skaria replied to navel151 on 19-Feb-10 02:23 PM
Try
with sheetname in cell C1

=IF(INDIRECT("'" & C1 & "'!P9")>0,Sheet2!A4,"")

--
Jacob
johncaulfield replied to navel151 on 19-Feb-10 02:43 PM
What about using RAnge Names. In Excel 2003 these are file specific in scope in 2007 you can set them Globablly or by sheet. When entering formulae or referring to any area on the spreadsheet, it is usual to refer to a "range". For
example, B6 is a range reference; B6:B10 is also a range reference. A problem with this sort of reference is
that it is not always easy to remember what cells to reference. It may be necessary to write down the
range, or select it, which often means wasting time scrolling around the spreadsheet. Instead, Excel offers
the chance to name ranges on the spreadsheet, and to use these names to select cells, refer to them in
formulae or use them in Database, Chart or Macro commands.

http://www.mousetraining.co.uk/training-manuals/Excel2007Adv.pdf page 5 begins a secion on Range Names

---
frmsrcurl: http://msgroups.net/microsoft.public.excel.worksheet.functions/Reference-text-in-a-cell-inside-a-formula-to-specify
navel151 replied to navel151 on 20-Feb-10 02:47 AM
TY all - INDIRECT is the function I needed but am having some errors on some
cells so may be looking for more input later.