How to get the spreadsheet name into a cell?

paulkinzelman

New Member
Joined
Aug 20, 2012
Messages
13
I've got a sheet named like 2013 and I'd like to have that value appear in a cell, then perform arithmetic on it (like to calculate the next year by adding 1). Any suggestions on how to do this?
TIA!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I've got a sheet named like 2013 and I'd like to have that value appear in a cell, then perform arithmetic on it (like to calculate the next year by adding 1). Any suggestions on how to do this?
TIA!
Put this in any cell

=REPLACE(CELL("Filename",A4),1,FIND("]",CELL("filename",A4)),"")
 
Upvote 0
Try
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)

Note, this will only work AFTER the file has been saved...
meaning if you are creating a new book, it won't work until after you save it and give it a name.
 
Upvote 0
I'm using LibreOffice, so I had to change your "]" character to "$" and it worked! Sort of.

I found that when I typed that formula into a cell, it worked, but if I renamed the sheet, the cell would not get the renamed value, the cell data was stale. I found that if I copied the formula into another cell, the new cell would show the properly value. Maybe it's an artifact of LibreOffice?

Is that the only way to get the sheet name? Your idea seems a bit round-about. Also, if Excel wants "]" in the search string, I can't use the same file for both Excel and LibreOffice users.

Thanks very much!
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,790
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top