{"id":12093,"date":"2011-11-20T10:01:04","date_gmt":"2011-11-20T10:01:04","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=752"},"modified":"2011-11-20T10:01:04","modified_gmt":"2011-11-20T10:01:04","slug":"file-name-formula","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/11\/file-name-formula\/","title":{"rendered":"File Name Formula"},"content":{"rendered":"
There are few instances when we want to store the File Name or Current Workbook Name in a particular Cell. This is very easy. This can be done by using Cell() <\/strong> function as shown below: Syntax:<\/strong> =CELL(“filename”)<\/span> Note:<\/strong> The problem with this is that it gives the complete path including Drive and folders with Sheet Name.<\/em><\/span><\/p>\n Syntax:\u00a0 <\/strong>=MID(CELL(“filename”),1,FIND(“[“,CELL(“filename”))-1)<\/span><\/p>\n Returned Value:<\/strong>\u00a0 C:\\Users\\Vish\\Desktop\\<\/span><\/p>\n<\/li>\n Syntax:<\/strong>\u00a0 =MID(CELL(“filename”),FIND(“[“,CELL(“filename”))+1,FIND(“]”,CELL(“filename”))-FIND(“[“,CELL(“filename”))-1)<\/span><\/p>\n Returned Value:<\/strong> Test.xlsx<\/span><\/p>\n<\/li>\n Syntax:<\/strong> =MID(CELL(“filename”),FIND(“]”,CELL(“filename”))+1,255)<\/span><\/p>\n Returned Value:<\/strong> Sheet1<\/span><\/p>\n<\/li>\n<\/ul>\n \n Read this Also:<\/strong><\/p>\n There are few instances when we want to store the File Name or Current Workbook Name in a particular Cell. This is very easy. This can be done by using Cell() function as shown below: Syntax: =CELL(“filename”) Returned Value: C:\\Users\\Vish\\Desktop\\[Test.xlsx]Sheet1 Note: The problem with this is that it gives the complete path including Drive and […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1672,1673],"tags":[],"class_list":["post-12093","post","type-post","status-publish","format-standard","hentry","category-excel-formula","category-excel-functions"],"yoast_head":"\n
\n<\/strong><\/p>\n
\nReturned Value:<\/strong> C:\\Users\\Vish\\Desktop\\[Test.xlsx]Sheet1<\/span><\/p>\n\n
\n