Sorting of numbers with slashes

I want to sort the following numbers in a column.
2004/1,
2004/2,
2004/10,
2004/11,
2004/3,
It should be sorted like this
2004/1,
2004/2,
2004/3,
2004/10,
2004/11

Why not change the suffix’ one digit to two, i.e. 2004/1 becomes 2004/01. Other numbers are 2004/02, 2004/03 … 2004/10, 2004/11.

Just add a supporting column, fill it with the formula

=VALUE(LEFT(A2;4))*100+VALUE(MID(A2;6;2))

and then sort the table by this values.

@JohnSUN - when I saw the @Girish’s question I got the idea of formating the cells as a date yyyy/mm and then just sort. However this doesn’t work.

Can you possibly give an explanation why it doesn’t work?

The results I am getting are
column A: descending sorting
column F : ascending sorting
both columns are formated like yyyy/mm

image description

@ROSt53 - You probably have dates with yyyy/m formatting, but original poster has strings. As strings list 10, 1, 101 is correctly sorted.

@Girish - I’d suggest converting these to dates, then you wouldn’t have had a problem in the first place.

@mahfiaz - So it seems the strings are the issue. But what does “string” mean in this context? I checked Calc help but could not find the answer. Could you please continue to help?

Your data in cell may contain many types of data, such as number, string (textual data), date, boolean (true or false). And of course you can have a text which may contain only numbers or “2013/01”. Looks like a date, but technically it is not.
Free tip of the day: If you want to explicitly enter string, start it with ’ (apostrophe), this way it is not converted to number or date.

You can easily convert your data from a text representation of dates in the “true date” with a formula similar to =DATE(VALUE(LEFT(A2;4));VALUE(MID(A2;6;2));1)

@mahfiaz - “Looks like a date, but technically it is not”- I understand. I also understand now @johnSUNs “complicate” looking formula. His formula converts from text string to date. Thanks to both of you.