Search code examples
excelexcel-formulareference

referencing a sheet base on a cell value and its not working


So i need to reference a sheet based on cell value. the sheet name is PIER X4-320 and i need to get the value of E31 of that sheet. The sheet name is registered in the cell A262. so i used the indirect function,

=INDIRECT(A262 & "! $E$31")

but i keep getting #REF! error with this code. What am i doing wrong here?

enter image description here enter image description here enter image description here


Solution

  • As you have space in sheet name, you have to wrap the sheet name into single quote '. Try-

    =INDIRECT("'"&A262 & "'!$E$31")