# sort rows by date (solved)

#### stefanoste78

##### Member
Good evening. I extracted the date from the first column with the aim of sorting the column from the most recent to the oldest date. If you notice they are not sorted correctly. Can you help me? Thank you

#### Attachments

• ordine circolari.xlsx
13.8 KB · Views: 1
they are not dates - they are text

goto the column - select it all
then
data - text to columns
then go next, next - until you get an option to change to a date
DMY or MDY
options

then you should be OK

#### Attachments

• ordine circolari -ETAF.xlsx
13.5 KB · Views: 1
thanks

you are welcome

you are welcome
I would also like to extract the number. The one between "n." and the date in order to sort them by date, and if the date is the same, progressively by number. If it were possible to do everything in one formula it would be better, to have one column
Is possible?

you probably need to start a new thread as that is different question, as i have seen moderators ask posters to do that and close

But when you do - i'm not sure i follow the question ,

Risposta n. 325 del 9/09/2020

the numbers will sort as text so
so 12
will be with all the ones
then 2

1
11
12
2
22
3

so not in numeric order
perhaps give some examples of expected result

I would like the order to happen first based on date and then when the dates are equal based on number.
Example

Risposta n. 20 del 12/2/2023
Risposta n. 40 del 20/3/2020
Risposta n. 19 del 12/2/2023

becomes in order:
Risposta n. 40 del 20/3/2020
Risposta n. 19 del 12/2/2023
Risposta n. 20 del 12/2/2023

the last two have the same date so they are sorted progressively from the smallest to the largest number

as mentioned need to start a new post with that explanation

they concern the same file and data. It would be better to use the same post, don't you think?

well, i'm not a mod, and its a different question , as i say i have seen these closed in the past midway through

but only way i know would be to extract the number as text and convert to a number - using *1 as partof the formula and then using that column

in a new column
=MID(A2,SEARCH("n.",A2,1)+2,(SEARCH("del",A2,1)-2)-(SEARCH("n.",A2,1)))*1

then you can sort by date and then by the number -

maybe a way to do without the new column, not sure - but it will also depend on your version of excel - what is it ?

even with TEXTbefore() and textafter()

well, i'm not a mod, and its a different question , as i say i have seen these closed in the past midway through

but only way i know would be to extract the number as text and convert to a number - using *1 as partof the formula and then using that column

in a new column
=MID(A2,SEARCH("n.",A2,1)+2,(SEARCH("del",A2,1)-2)-(SEARCH("n.",A2,1)))*1

then you can sort by date and then by the number -

maybe a way to do without the new column, not sure - but it will also depend on your version of excel - what is it ?

even with TEXTbefore() and textafter()

the formula doesn't work. Could you apply it directly to the file?

here it is , also sorted by date and then number

but thats based on your sample - which all has n. and del in , with the number in the middle

#### Attachments

• ordine circolari -ETAF-2.xlsx
17.6 KB · Views: 2
Resolved. I used the formula translator.
Thank you

ok , you are welcome , no idea what that is