Avatar of Bill Golden
Bill Golden
Flag for United States of America asked on

Displaying a portion of the tab name in a cell

I have tabs that are generally 1234A-0914.  I want to display the FIRST FIVE CHARACTERS in a Cell.
Microsoft Excel

Avatar of undefined
Last Comment
Bill Golden

8/22/2022 - Mon
Saurabh Singh Teotia

Use this formula..
=MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,FIND("-",CELL("filename"),1)-FIND("]",CELL("filename"),1)-1)

Open in new window


This will give you the sheet name if your workbook is saved..

Saurabh...
Bill Golden

ASKER
It is save but all I got was #VALUE!
Roy Cox

See this explanation

File Name in Cell
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Bill Golden

ASKER
And, I am looking for the first 5 characters of the TAB
Saurabh Singh Teotia

Sorry the formula will be..

=MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,5)

Open in new window


Saurabh...
ASKER CERTIFIED SOLUTION
Roy Cox

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Professor J

use this one flawless

=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)))),5)

Open in new window

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Bill Golden

ASKER
That did the trick, although 2003 wanted to stick close parenthesis at the end.  (I am too doped up from drugs for a hyper-extended knee to count the parenthesis but I will take the program's word for it!) Thanks a million....
Bill Golden

ASKER
Sorry Saurabh and Professor. I didn't see your solutions come in but I got a solution.  Maybe you can help on the next one.