OHSU's Software Forum Forum Index OHSU's Software Forum
Peer support for software.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Welcome
Welcome to OHSU's Software Forum.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

Putting just the filename in your worksheet

 
Post new topic   Reply to topic    OHSU's Software Forum Forum Index -> Excel 2007
View previous topic :: View next topic  
Author Message
Bill Foust



Joined: 11 Apr 2008
Posts: 10

PostPosted: Thu Jul 17, 2008 9:09 am    Post subject: Putting just the filename in your worksheet Reply with quote

It's sometimes helpful to have the name of the file in your worksheet, and it's nice to have a formula that enters it automatically. The not so nice part is that with the standard formula provided by Excel:

=cell("filename")

you also get the complete directory path, which you may not want. Here's a formula that will enter just the filename:

=MID(CELL("filename",B18),FIND("[",CELL("filename",B18),1)+1,FIND("]",CELL("filename",B18),1)-FIND("[",CELL("filename",B18),1)-1)

Dissecting this formula to find out what each piece does might be interesting, but won't be discussed here, in the interest of brevity. Just one note - the "B18" that appears in the formula can be just any random cell; every cell has the same filename associated with it, so any cell will do.

Try it out; copy this formula to any cell in any worksheet and check your results.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OHSU's Software Forum Forum Index -> Excel 2007 All times are GMT - 7 Hours
Page 1 of 1   

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Community Chest


Powered by phpBB
Hosted by FreeForums.org