I was not able to get the answers from Get parent folder path from file path using cell formula to work with my data.
Using the below, only one part of my path gets trimmed.
=LEFT(A1,FIND("?",SUBSTITUTE(A1,"\","?",LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))))
I have /stack/over/flow/today/is/friday in A1, above formulas will give me /stack/over/flow/today/is/
Result i want is /stack or stack/ or just stack from my path.
Any VBA,functions or formulas are welcome.