Prompt Detail:
To get the name of the current Google Sheets workbook, you can use the following formula:
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)
This formula will extract the name of the current workbook from the full file path of the Google Sheet.
Alternatively, you can use the following custom function:
javascriptfunction getCurrentWorkbookName() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
return spreadsheet.getName();
}
To use this custom function:
- Open your Google Sheet.
- Go to the "Tools" menu and select "Script editor".
- In the Script Editor, paste the above code.
- Save the script (File > Save).
- Go back to your Google Sheet.
- In any cell, enter the following formula:
=getCurrentWorkbookName()
This will call the custom function and return the name of the current workbook.