Forum Discussion

eddymalcs's avatar
eddymalcs
Copper Contributor
Feb 24, 2022
Solved

Insert current file name only

I am using the formula 

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

to insert the file name into a cell.

I would like this to work without inserting the .xlsx suffix. How can this formula  be modified to achieve that please?

  • eddymalcs Perhaps like this?

     

    =SUBSTITUTE(MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1),".xlsx","")

     

2 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    eddymalcs Perhaps like this?

     

    =SUBSTITUTE(MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1),".xlsx","")

     

Resources