Google Sheets – Formula to List All Sheet Names

google sheets

I have a Google drive spreadsheet with 20 sheets.

Is it possible to list all the sheet names, in an index sheet?

Best Answer

There is a widely used script for this:

function sheetnames() {
  var out = new Array()
  var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
  for (var i=0 ; i<sheets.length ; i++) out.push( [ sheets[i].getName() ] )
  return out 
}

Following that, you refer to it by placing =sheetnames() in a cell.

PS: It is a very useful way when you make a range out of it and use it in formulas.