Forum Discussion
Alireza2291
Apr 01, 2022Copper Contributor
File Name
Hi There, What kind of formula should I use to have the excel file name in a cell WITHOUT the extension of the file, Thanks, Ali
- Apr 01, 2022
Alireza2291 Perhaps this:
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND(".xlsx",CELL("filename"))-FIND("[",CELL("filename"))-1)It assumes that the extension you seek is ".xlsx" since you are working in an Excel file. If you are on a recent version you can avoid the receptive references to CELL() by using the LET function.
Vimal_Gaur
Apr 01, 2022Brass Contributor
Sir, your formula is good as it is short.
In my formula you need not to bother about the length of extension.
My formula will handle both .xls as well as .xlsx
In my formula you need not to bother about the length of extension.
My formula will handle both .xls as well as .xlsx
SergeiBaklan
Apr 02, 2022Diamond Contributor
On the other hand your formula doesn't work if the file is synced with OneDrive/SharePoint folder.
Riny_van_Eekelen formula works with both extensions if change *.xlsx on *.xls. And both for synced and not synced folders.
- Vimal_GaurApr 02, 2022Brass ContributorGreat Sir