3

I have a list of files in Windows Explorer sorted ascending by name

3a.txt
6a.txt
10a.txt

In Excel I have the names of these files in a column, I sort them A-Z and except them to be the same as the order of the files in Explorer, however this is not the case:

Sheet1: SORTED A-Z
10a.txt
3a.txt
6a.txt

I do not mind whichever sorting is used however I need the sorting to be consistent across both programs. Is there an easy way to achieve this?

6

1 Answer 1

3

Excel sorts in simple alphabetical order, while Windows Explorer uses numerical sorting. So Explorer will cleverly sort file9 before file10, while Excel will do the opposite.

As solution, you may either make all the numbers of your file names to be of the same length, meaning file09 and file10, or disable numerical sorting in Explorer.

To disable numerical sorting in Explorer:

  • Start the Local Group Policy Editor from the Start menu or run gpedit.msc

  • Navigate to User Configuration > Administrative Templates > Windows Components > File Explorer

  • Double-click Turn off numerical sorting in File Explorer on the right

  • Select Enable

  • Click OK to save the changes

  • Logout and back in to apply the changes.

For more information see the article
How to Enable or Disable Numerical Sorting in File Explorer in Windows 10

1
  • Is there a way to enable numerical sorting in excel? Commented Nov 1, 2023 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .