Can I use a Google Sheets formula to display the sheet name in a cell?

Details

I’m looking for a formula in Google Sheets that can automatically output the name of the current sheet into a specific cell. I need this solution for better organization and easier reference across multiple sheets. The goal is to have the sheet name update dynamically so that any change in the tab name is reflected within the cell. I’m interested in any approaches, functions, or workarounds that can accomplish this task efficiently.

An alternative method that has worked for me is to use a custom function through Google Apps Script. I found that using a script rather than a formula often gives more consistent results, especially when the sheet name changes. You can create a simple script by going to Tools > Script Editor and inserting:

function SHEETNAME() {
return SpreadsheetApp.getActiveSheet().getName();
}

Once saved, you can type =SHEETNAME() in any cell to display the current sheet name. This approach has been very reliable in my experience.

Based on my experience, using the CELL function can sometimes be a bit finicky since it requires a refresh to update when the sheet name changes. I discovered that pairing this with a small script can provide a more dynamic solution while still working within Google Sheets. One method involved having a trigger that recalculates the sheet, ensuring the information remains current even if the name is changed programmatically. Although this isn’t a direct formula solution, it offers a reliable workaround for situations where immediate updates are necessary.

hey, try this: =regexextract(cell(“filename”,A1),“[^]]+$”). works fine in my sheet; just refresh if it doesn’t update immediately. not 100% perfect, but it’s a neat workaround if u wish to avoid scripting

In my experience, using only built‐in functions frequently poses challenges because they don’t auto-refresh when the sheet name changes. A method I recently tried involves using a volatile function along with INDIRECT to prompt recalculation whenever I update data elsewhere in the sheet. Although this doesn’t directly capture the sheet name, it helps in refreshing related cells, indirectly triggering an update. I’ve found that when combined with a custom trigger script, this approach ensures the sheet name reflected is more current without manual intervention.

hey, try this: =MID(CELL(“filename”,A1),FIND(“]”,CELL(“filename”,A1))+1,255). may not be perfect all the time, u might need to refresh the sheet for updates. worked for me in my documnt