ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Display file name without the file type extension (https://www.excelbanter.com/excel-worksheet-functions/249167-display-file-name-without-file-type-extension.html)

NAHolmes

Display file name without the file type extension
 
Is it possible to return the file name value to a cell without the '.xlsx'?

Thanks.

Jacob Skaria

Display file name without the file type extension
 
Try the below in a saved workbook.

=TRIM(LEFT(SUBSTITUTE(MID(CELL("filename",A1),
FIND("[",CELL("filename",A1))+1,255),".xl",REPT(" ",255)),255))

If this post helps click Yes
---------------
Jacob Skaria


"NAHolmes" wrote:

Is it possible to return the file name value to a cell without the '.xlsx'?

Thanks.


JLatham

Display file name without the file type extension
 
Try this:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-6)

Keep in mind that the "filename" used with CELL() does not return anything
until the workbook has been saved.

or if you definitely know that the filename ends with .xlsx (and not .xlsm
or other Excel 2007 file type identifier), then this would work:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND(".xlsx]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)


"NAHolmes" wrote:

Is it possible to return the file name value to a cell without the '.xlsx'?

Thanks.


NAHolmes

Display file name without the file type extension
 
This also worked, again - many thanks.

"JLatham" wrote:

Try this:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-6)

Keep in mind that the "filename" used with CELL() does not return anything
until the workbook has been saved.

or if you definitely know that the filename ends with .xlsx (and not .xlsm
or other Excel 2007 file type identifier), then this would work:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND(".xlsx]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)


"NAHolmes" wrote:

Is it possible to return the file name value to a cell without the '.xlsx'?

Thanks.


NAHolmes

Display file name without the file type extension
 
This worked perfectly - many thanks.

"Jacob Skaria" wrote:

Try the below in a saved workbook.

=TRIM(LEFT(SUBSTITUTE(MID(CELL("filename",A1),
FIND("[",CELL("filename",A1))+1,255),".xl",REPT(" ",255)),255))

If this post helps click Yes
---------------
Jacob Skaria


"NAHolmes" wrote:

Is it possible to return the file name value to a cell without the '.xlsx'?

Thanks.


ryguy7272

Display file name without the file type extension
 
This is a great resource:
http://www.mcgimpsey.com/excel/formu..._function.html

HTH,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"NAHolmes" wrote:

This also worked, again - many thanks.

"JLatham" wrote:

Try this:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-6)

Keep in mind that the "filename" used with CELL() does not return anything
until the workbook has been saved.

or if you definitely know that the filename ends with .xlsx (and not .xlsm
or other Excel 2007 file type identifier), then this would work:
=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND(".xlsx]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)


"NAHolmes" wrote:

Is it possible to return the file name value to a cell without the '.xlsx'?

Thanks.



All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com