When we save a filename in an operating system like Microsoft Windows it carries the extension to identify the type of file. The file extension is a string of characters at the end of a filename, usually three or four characters long, that comes after a full stop, like “.doc”, “.xlsx” etc. Using the formula, we can remove the extension from filename in Excel to return the filename only.
Figure 1. Removing the Extension From Filename
The syntax for the formula is;
- Filename – It is a cell reference or text string entered directly as an argument in the formula.
- The LEFT function returns the specified number of characters from the start of the text string.
- The FIND function returns the starting position of a character or one text string within another text string. It is used to determine the number of characters to extract.
- 1 is subtracted from the position of the first match of “.” returned by the FIND function to get the exact number of characters by excluding the “.” from the count.
Note: This formula syntax finds the first match of “.”, therefore it will work perfectly where there are not more than one “.” in the filename.
Figure 2. The Syntax For The Formula
We have a list of filenames that have different file extensions attached with them in column B like “.xlsx”, “.docx”, “.png” etc. and we want to remove the extension from filename returning the filename only in column C. We will use the following formula in cell C2 and drag it down to other cells in column C, such as;
Figure 3. The Final Preview of the Formula Result
Instant Connection to an Expert through our Excelchat Service:
Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.