Return the workbook name from a full path


 A
1Book1.xls
2C:\Temp\BetterSolutions.xls
3C:\Temp\SubFolder\Another Folder\Workbook_Name.xls
4=MID(A1,FIND("#",SUBSTITUTE("\"&A1,"\","#",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))+1)),LEN(A1))="Book1.xls"
5=MID(A2,FIND("#",SUBSTITUTE("\"&A2,"\","#",LEN(A2)-LEN(SUBSTITUTE(A2,"\",""))+1)),LEN(A2))="BetterSolutions.xls"
6=MID(A3,FIND("#",SUBSTITUTE("\"&A3,"\","#",LEN(A3)-LEN(SUBSTITUTE(A3,"\",""))+1)),LEN(A3))="Workbook_Name.xls"

Built-in Functions

MID - The characters from the middle of a text string.
FIND - The starting position of a substring within a larger text string (case sensitive).
SUBSTITUTE - The text string after replacing instances of a substring.
LEN - The number of characters in a text string.


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top