Is there a Google Sheets Function that holds the reference to another Sheet when I change the sheet name?

Viewed 41

I have a worksheet with more than two tabs (sheets). I have some data linked between them. Often I need to replace the name of one of the tabs (ie.: "MyTab").

The problem is, when I change the name of the tab (ie.: "MyTab2"), the reference changes the name too. I want that it holds the old name.

=COUNTIF('MyTab'!$H:$H,"TRIAGEM ELETRÔNICA" , MyTab!$B:$B , ">="&DATE(2000,1,1) , MyTab!$B:$B    ,  "<="&DATE(2016,12,31) )

There is some command like $ that holds the " 'MyTab'!$H:$H " link when I change the "MyTab" name?

1 Answers

put your sheet name into INDIRECT that way it won't change:

=COUNTIFS(INDIRECT("MyTab!H:H"), "TRIAGEM ELETRÔNICA", 
          INDIRECT("MyTab!B:B"), ">="&DATE(2000, 1, 1), 
          INDIRECT("MyTab!B:B"), "<="&DATE(2016, 12, 31))
Related