I need help with finding the formula to call a cell in a spreadsheet the folder name that is 3 levels up the path.

I have a very complicated formula to make the name of a cell in the excel spreadsheet be the name of the folder that the spreadsheet is in, but I need to also find a formula to give me the name of a folder 3 paths up.



I can put the formula here that goes up one level if some body could suggest changes to give me 3 up, I would appreciate it very much!


=MID(CELL("filename"), FIND(CHAR(1), SUBSTITUTE(CELL("filename"), "\", CHAR(1), LEN(CELL("filename")) - LEN(SUBSTITUTE(CELL("filename"), "\", "")) - 1)) + 1, FIND("[", CELL("filename")) - 2 - FIND(CHAR(1), SUBSTITUTE(CELL("filename"), "\", CHAR(1), LEN(CELL("filename")) - LEN(SUBSTITUTE(CELL("filename"), "\", "")) - 1)))