Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how to sort by months in Numbers

Hi guys!


I have been trying to sort by Months. However, I only get the sorting option for Ascending or Descending, so it's been only sorted out by alphabetic orders instead of actual month starting from January.


How do I sort by the order of months?


Posted on Sep 14, 2022 1:09 PM

Reply
Question marked as Best reply

Posted on Sep 14, 2022 2:12 PM

Dates and months and all that are a little tricky. Your months appear to be formatted as text and, as such, will sort alphabetically as text does. There is no custom sort to sort text any other way.


Two ideas, the shortest one first:


Idea 1: Make a new column that will be the month as a number.

  1. Insert a new column
  2. Formula in this column will be =MONTH(A)
  3. Sort by that column


This may be your only choice if you are using a pop-up for the month names.


Idea 2: Format column A as Date&Time.

As Date&Time, they will sort by date and time. It is easy enough to format column A but it may cause you other problems unless you do some more work. Column A will be displayed as "months" but each will actually be a date&time value with a month, a day (the 1st of the month), a year (the year you entered it into the table or formatted it as a date) and a time (12:00AM). January entered this year and January entered next year will not be the same January and they will not sort together. You might consider doing away with the Year column and displaying month & year in the first column, formatted as January 2015. Here is how I would go about doing that:


  1. If you formatted column A as Date&Time already, format it back to Text
  2. Insert a new column C temporarily
  3. Formula in C2 =DATEVALUE(A2&" "&B2)
  4. Fill down to the other rows to complete the column
  5. Select and copy all the cells in C
  6. Paste Formula Results into column A (it is in the Edit menu)
  7. Delete column C
  8. Format column A to show as January 2015
  9. Delete column B (Years)
  10. You can enter months and years in M/YY format in the future versus typing out the month name.


Edit: A third idea

  1. Format Column A as Date & Time
  2. Sort
  3. Format it back to text
4 replies
Question marked as Best reply

Sep 14, 2022 2:12 PM in response to Kimizuuiii

Dates and months and all that are a little tricky. Your months appear to be formatted as text and, as such, will sort alphabetically as text does. There is no custom sort to sort text any other way.


Two ideas, the shortest one first:


Idea 1: Make a new column that will be the month as a number.

  1. Insert a new column
  2. Formula in this column will be =MONTH(A)
  3. Sort by that column


This may be your only choice if you are using a pop-up for the month names.


Idea 2: Format column A as Date&Time.

As Date&Time, they will sort by date and time. It is easy enough to format column A but it may cause you other problems unless you do some more work. Column A will be displayed as "months" but each will actually be a date&time value with a month, a day (the 1st of the month), a year (the year you entered it into the table or formatted it as a date) and a time (12:00AM). January entered this year and January entered next year will not be the same January and they will not sort together. You might consider doing away with the Year column and displaying month & year in the first column, formatted as January 2015. Here is how I would go about doing that:


  1. If you formatted column A as Date&Time already, format it back to Text
  2. Insert a new column C temporarily
  3. Formula in C2 =DATEVALUE(A2&" "&B2)
  4. Fill down to the other rows to complete the column
  5. Select and copy all the cells in C
  6. Paste Formula Results into column A (it is in the Edit menu)
  7. Delete column C
  8. Format column A to show as January 2015
  9. Delete column B (Years)
  10. You can enter months and years in M/YY format in the future versus typing out the month name.


Edit: A third idea

  1. Format Column A as Date & Time
  2. Sort
  3. Format it back to text

Sep 14, 2022 2:28 PM in response to Badunit

I tried out the second idea which was brilliant but too complicated for the newbie like myself. However, the third idea worked!!! :-) thank you a lot!


one little problem : it also sorted out my header rows and now it's down below as letter 'M' comes as the latest. Do you know how to fix it on top and just sort out the data below?

Sep 14, 2022 2:37 PM in response to Kimizuuiii

Apparently your "header" row is not actually a header row.


First get the header row back to the top. Click on the row number then click and hold on the row number and the row will "lift" from the table. Drag it up to the top and let go.


Second, right click on the row number (now should be row 1) and choose "convert to header row". Or you can go to the sidebar on the right, click on the Table tab and change the number of header rows from 0 to 1.

how to sort by months in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.