How to Extract Extension from Filename in Excel

Extraction of certain filename components, like the extension, might be helpful when working with filenames in Excel. The file type is indicated by the extension; for example, ".xlsx" stands for Excel files, ".docx" for Word documents, and ".jpg" for image files. You may simply categorise and analyse files depending on their categories, automate specific processes, or carry out different operations on particular file types by understanding how to extract the extension.

This tutorial will give you step−by−step instructions and examples so you can comprehend and utilise the strategies whether you're a novice or an expert Excel user. You will have a thorough understanding of how to extract the extension from filenames in Excel at the end of this tutorial, enabling you to increase productivity and simplify file management procedures. Consequently, let's get started and discover how to effectively extract file extensions in Excel!

Extracting Extensions from Filename in Excel

Here we will first use a formula to get any one of the values, then use the autofill handle to complete the task. So let us see a simple process to know how you can extract the extension from a filename in Excel.

Step 1 : Consider an Excel sheet where you have a list of file names along with their extensions, similar to the below image.

First, click on an empty cell and enter the formula as

=RIGHT(A2,LEN(A2)−FIND("|",SUBSTITUTE(A2,".","|",LEN(A2)−LEN(SUBSTITUTE(A2,".",""))))) and click enter. In the formula, A2 is the address of the cell containing the file name.

Empty cell > Formula > Enter.

Step 2 : Then drag down using the autofill handle to complete the task.

This is how you can extract the extension from a file name in Excel.


In this tutorial, we have used a simple example to demonstrate how you can extract an extension from a filename in Excel to highlight a particular set of data.

Updated on: 20-Jul-2023

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started