Forum Discussion
Sorting small and capital letters correcly
- Jul 01, 2021
Hi, SaeedShaeri
here are two possible options of doing this without an extra column. I am using Excel for Microsoft 365.
The first option puts small case before the capital letters when sorting. See if this works for you:
Click anywhere on the table > File Tab > button Sort & Filter > Custom Sort > button Options > checkmark on "case sensitive" > OK.
[see pic 1 attached]
The other option is to use a Custom List.
First create the custom list by going to File > Options > Advanced
scroll down to General
click button "Edit Custom Lists..." > click where it says NEW LIST and add your list sorted the way you want.
Then go to Custom Sort again and under "Order" choose "Custom List":
[see pic 2 attached]
To solve the issue as non VBA method, you need a Helper Data Column.
How it works:
- Formula in cell AP2:
=IF(EXACT(AQ2,UPPER(AQ2)),"UC",IF(EXACT(AQ2,LOWER(AQ2)),"LC",IF(EXACT(AQ2,PROPER(AQ2)),"PC","otr")))
N.B.
- Values UC, LC, PC & otr are adjustable, it may be 0 for digits & 1 for Special characters, 2 for Lower case, 3 for Proper, 4 for Upper case.
- Select AO1:AP10, then go to Custom Sort.
- Set Help Data as First Level & Unsorted as Second Level.
- Finish with Ok.
You find all small letters/alphabets first then Proper case data and finally capital letters/alphabets.
N.B.
- For neatness you may hide Help Data column.
- To follow the hierarchy of data while SORT you may extend your formula to check DIGITS, SPACES & SPECIAL Characters.
- SaeedShaeriJul 03, 2021Copper ContributorThanks Rajesh_Sinha. I'd follow your approach if I were the sole user. With a shared database, I prefer not to add extra columns.
- Rajesh_SinhaJul 04, 2021Iron ContributorUsing extra column is not a big issue if your data set is shareable even,,, Copy Sorted data and Paste as Link,,, other create Helper column at far from main data set columns,,, Another is VBA macro,,, without extra column,, are you comfortable with that ?