Get Folder Name

djl0525

Well-known Member
Joined
Dec 11, 2004
Messages
1,240
I know how to get the file path...

=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)

But is there a way to get just the FOLDER name (not the entire path) of the current file?

DJ
 
Re: Get Folder Name only from pathe

You got it! It worked! Thank you so much!!!

DJ

P.S. It was nice chatting with your alter ego as well. :)
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Y'know... lots of people are seeking ways to get the current folder in a cell. You should blast this formula all over the internet because I looked for it (a non-VB solution) and it was nowhere to be found!

DJ
 
Upvote 0
djl0525


=MID(CELL("filename",A1);FIND("]",CELL("filename",A1))+1,31)


Would that be what you want?


Decio
 
Upvote 0
=REPLACE(CELL("filename"),FIND("[",CELL("filename")),LEN(CELL("filename")),"")
 
Upvote 0
That returns the whole file path including the final folder: the OP asked for a formula to return JUST the final folder.
 
Upvote 0
Display Folder Name where is opened Workbook placed

You should blast this formula all over the internet because I looked for it (a non-VB solution) and it was nowhere to be found!
I can not you understand fully well.
If you want to know how I created this long formula and from which parts of this formula is made, you can see a complete tutorial with screenshots. (I created tutorial for you)

How to return the name of the subfolder only, where it is located opened Excel Workbook.

My apologies for the bad english.
Greetings from Croatian and all the best in this new year 2017.
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,914
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top