How to make a reference to a cell of another sheet, when the sheet name is the value of a cell?

mr_georg picture mr_georg · Nov 3, 2008 · Viewed 40.7k times · Source

In excel 2007, I have a formula in a cell like the following:

=COUNTIFS('2008-10-31'!$C:$C;">="&'$A7)

Now I want to make the name of the sheet ('2008-10-31') be dependent on the value of some cell (say A1). Something like:

=COUNTIFS(A1!$C:$C;">="&'$A7) // error

Is there is way to do this? Or do I have to write a VBA-Macro for it?

Answer

dbb picture dbb · Nov 3, 2008

INDIRECT does what you want. Note that if the sheet name has any spaces, you need to put single quotes round it, ie

=COUNTIFS(INDIRECT("'" & A1 & "'!$C:$C"); ">=" & $A7)