Get parent folder path from file path using cell formula
This works. =MID(A1,1,LEN(A1)-LEN(MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,”\”,CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,”\”,””))))+1,LEN(A1)))) The above was my original answer. Neil simplified the expression somewhat and posted this as a comment below: =LEFT(A1,FIND(“?”,SUBSTITUTE(A1,”\”,”?”,LEN(A1)-LEN(SUBSTITUTE(A1,”\”,””))))) This takes advantage of the fact that ? is a forbidden character in paths so that “?” can safely be used instead of CHAR(1) as a placemark, thus improving readability a little bit. … Read more