How to test if a sheet exists in Google Sheets by formulas

Viewed 4083

Which is the best way to test if a sheet exists or not in a Google spreadsheet, only using formulas (by a script it is easy, but I need speed!)?

For example, using =error.type('mysheet'!A1) gives error 4, but I am looking for something more specific... (error 4 could mean also something else...)

Many thanks

1 Answers

I'm using =IF(ISREF('Nov 17'!BT39), 'Oct 17'!BT39, "") to determine if a sheet exist. Maybe that will help.

Checks whether a value is a valid cell reference.

My sheet time recording has the cell F5 (="October 2017").

Maybe you need to build your sheet name from a string. If so, use INDIRECT to build the sheet path. =IF(ISREF(INDIRECT("'" & LEFT(F5, 3) & " ''" & Right(F5, 2) & "'" & "!BT39")), TRUE, FALSE)

That gives me that path to Oct '17, my reference sheet, which I want to check if exist or not.

Greetings

Related