How to sort columns based on two criteria?

Jyggalag

Active Member
Joined
Mar 8, 2021
Messages
445
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all!

I currently have this setup (albeit with more columns in reality):

1651046234460.png


I would like to sort it by dates first, and then by the number after. However, I want this done, so it respects the date assortment before the number assortment, so it wouldnt for example put:

1 - February: 1
Before
5 - January: 35

I hope this makes sense. Can somebody guide me on how to do this please?

Thank you!

Kind regards,
Jyggalag
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Use Data - Sort, then use date as the first field and number as the second field.
 
Upvote 0
Solution
Another issue is that I am finding it difficult to sort by date based on the way in which the dates are written. It is not 01/01/2022, but rather 1 - January for example
 
Upvote 0
If those are not real dates, then they will sort alphabetically. I'd suggest you convert them to real dates. You can always format them to display the way you have them now.
 
Upvote 0
H
Use Data - Sort, then use date as the first field and number as the second field.
Hi Rory,

Thank you so much! That is actually a very nice feature that I was not familiar with.

However, it does not seem to work due to the note from before
 
Upvote 0
If those are not real dates, then they will sort alphabetically. I'd suggest you convert them to real dates. You can always format them to display the way you have them now.
Okay thank you, do you have a smart way to do this without doing it manually?
 
Upvote 0
It depends just how messy the data is, and whether your regional settings recognise something like "1-January-2022" as a date. From just your sample, you have misspelled months, trailing dashes and different spacing.
 
Upvote 0
Use Data - Sort, then use date as the first field and number as the second field.
Dear Rory,

I had to spend a little time converting the dates :-) But your solution proposed here works now! Thank you so much once again.

Kind regards,
Jyggalag
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top