Day(s)

:

Hour(s)

:

Minute(s)

:

Second(s)

How To Use CELL To Get Current Workbook Information

Get The Completed Workbook

Note: You will need to save the completed workbook somewhere on your computer for the functions to work.

How do you get information about the current workbook such as the file name, file path and the current sheet name? The CELL function can be a pretty handy tool for getting this type of information, but you’ll have to do a bit of work to get it.

 

 

Without any adjustments CELL(“filename”,A1) will return the full file path and current sheet name, so some text parsing will be needed.

For the file path:

=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1))-2)

For the workbook name:

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

For the sheet name:

=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

 

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and qualified actuary with over 15 years of experience. He has worked in a variety of industries, including insurance, ad tech, and most recently Power Platform consulting. He is a keen problem solver and has a passion for using technology to make businesses more efficient.

Subscribe

Subscribe for awesome Microsoft Excel videos 😃

John MacDougall

I’m John, and my goal is to help you Excel!

You’ll find a ton of awesome tips, tricks, tutorials, and templates here to help you save time and effort in your work.

Related Posts

Comments

0 Comments

Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃