Link to home
Start Free TrialLog in
Avatar of Bill Golden
Bill GoldenFlag 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.
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

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...
Avatar of Bill Golden

ASKER

It is save but all I got was #VALUE!
See this explanation

File Name in Cell
And, I am looking for the first 5 characters of the TAB
Sorry the formula will be..

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

Open in new window


Saurabh...
ASKER CERTIFIED SOLUTION
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Professor J
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

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....
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.