return filename without extension

andrewvanmarle

New Member
Joined
Aug 11, 2015
Messages
40
Hi All!

years ago I got this code from a helpful user at this forum:

Excel Formula:
=(DEEL(CEL("bestandsnaam");VIND.SPEC("[";CEL("bestandsnaam"))+1;VIND.SPEC("]";CEL("bestandsnaam"))-VIND.SPEC("[";CEL("bestandsnaam"))-5))+C13

Which is supposed to return the 5 digit filename without the extension.

These days we sometimes have a letter appended to that five digit filename, and if we do this code returns a value error.

I've been fiddling with the +1 and the -5 but that didn't come up with the result i wanted.

Can anyone help?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
The following suggestion does not depend on the length of the file.
I cannot translate from English and you may have to replace , s with ;

The formula can be much shorter with Excel 365's Let function or a UDF.

=REPLACE(LEFT(CELL("filename",A1),FIND(".",CELL("filename",A1))-1),1,FIND("[",CELL("filename",A1)),"")
 
Upvote 0
Solution
Super!! thank you!

I translated it with Translator


to

Excel Formula:
=VERVANGEN(LINKS(CEL("bestandsnaam";A1);VIND.ALLES(".";CEL("bestandsnaam";A1))-1);1;VIND.ALLES("[";CEL("bestandsnaam";A1));"")
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

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