Using Part of the Tab Name in a Cell

I have a tab named 1403-JE-PG-1
I want to place the value of everything to the right of the third - of the Tab in a cell OR, IN THE ALTERNATIVE
I want to place the value of the last character of the Tab in a cell.
Bill GoldenExecutive Managing MemberAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ProfessorJimJamMicrosoft Excel ExpertCommented:
put this formula in any cell.

=LEFT(IF(ISERROR(RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1)))),"This workbook never saved",RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1)))),1)

Open in new window

Bill GoldenExecutive Managing MemberAuthor Commented:
Your formula is giving me the first character in the Tab, not the last character.
Saurabh Singh TeotiaCommented:
You can simply use this...


Open in new window

This will give you only the last char of your sheet name...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

ProfessorJimJamMicrosoft Excel ExpertCommented:
Replace my formula begging "left" with "right"
ProfessorJimJamMicrosoft Excel ExpertCommented:
Use this

=RIGHT(IF(ISERROR(RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1)))),"This workbook never saved",RIGHT(CELL("filename",$A$1),LEN(CELL("filename",$A$1))-FIND("]",CELL("filename",$A$1)))),1)
Bill GoldenExecutive Managing MemberAuthor Commented:
The simplest solution would seem to be the best solution.  

I was unsure of what to do when the PG-1 (which indicates the page number) grew to PG-10.  Eureka, I changed the last 1) in either formula to a 2) so -1 become 1 and -10 becomes 10.


Rodney EndrigaData AnalystCommented:
This should provide you with the value after the 3RD Hyphen in your Sheetname:

Open in new window

Whether the digit is 1, 2, 3, or so on, it will provide the following:
1403-JE-PG-1            result in cell-->  1
1403-JE-PG-123       result in cell-->  123
1403-JE-PG-1234     result in cell-->  1234
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.