Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to sort by file extension in Excel?

If you have a list of file names which including different extensions, and now, you want to sort the file names by extension. Do you have any good ideas to solve this task in a worksheet?

Sort file names by extension with helper column

Enable you to do smarter, faster and better

Kutools - the best office productivity tool brings 300 advanced features to Excel. Details... Download...

Office Tab - brings tabbed interface to Excel and Word, make your work much easier. Details...Download...

arrow blue right bubble Sort file names by extension with helper column

In Excel, there is no direct way for you to sort the file extension, but you can apply a helper column to extract the extensions first, and then sort the rows based on that helper column. Please do as follows:

1. Enter this formula =REPLACE(RIGHT(A2,5),1,SEARCH(".",RIGHT(A2,5)),"") into a blank cell next to your data, see screenshot:


2. Then drag the fill handle over to the range that you want to contains this formula, and all the extensions have been extracted into column B, see screenshot:


3. And then select the extracted extensions in helper column B, then click Data > Sort, and check Expand the selection in the popped out Sort Warning dialog, see screenshots:


4. In the Sort dialog box, select the column name which you want to sort by under the Column section, and then choose Values from the Sort On section, at last choose the sort order you need.


Note: if your data has headers, please check My data has headers option.

5. After finishing the setting in the Sort dialog, click OK to close the dialog, and now, you can see the file names have been sorted by the extensions as following screenshot shown:


6. Finally, you can delete the data in the helper column as you want.

Tip: In the above formula, A2 indicates the cell you want to extract the extension from.

Related articles:

How to sort rows by upper lower case in Excel?

How to sort or filter data by strikethrough in Excel?

How to sort data by the most frequent value in Excel?

Excel Productivity Tools

Kutools for Excel - The Best Office Productivity Tool

  • Brings 300 powerful advanced features to Excel, enable you to do smarter, faster and better.
  • No longer need memorizing formulas and VBA codes, give your brain a rest from now on.
  • Become an Excel expert in 3 minutes, Complicated and repeated operations can be done in seconds, 
  • Reduce thousands of keyboard & mouse operations every day, say goodbye to occupational diseases now.
  • 110,000 highly effective people and 300+ world-renowned companies' choice.
  • 60-day full features free trial. 60-day money back guarantees. 2 years of free upgrade and support.

Office Tab - brings tabbed interface to Office, make your work much easier.

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.