Sort a list of data in Excel 2016 for Mac

In Excel, you can sort numbers, text, weekdays, months, or items from custom lists that you create. You can also sort by font color, cell color, or icon sets. Sorts can be case-sensitive.

When you sort a column, you rearrange the rows of the column. When you sort multiple columns or a table, you typically rearrange all the rows based on the contents of a particular column.

Important: If the columns that you want to sort contain both numbers that are stored as numbers and numbers that are stored as text, the numbers will not sort correctly. Numbers that are stored as text are displayed aligned left instead of right. To format selected numbers consistently, on the Home tab, in the Number Format box, select Text or Number.

Number formats box

Sort a column

  1. Click a cell in one of the columns that you want to sort.

    Data in adjacent columns will be sorted based on the data in the column that you selected.

  2. On the Data tab, select Ascending Ascending sort icon or Descending Descending sort icon .

    To sort

    Click

    The lowest values to the top of the column

    A to Z

    The highest values to the top of the column

    Z to A

Note: If the results aren't what you expected, check that all numbers are stored as numbers. For example, negative numbers imported from some accounting systems are stored as text.

Sort a list by two or three columns

You can sort by several columns by adding levels of sorting criteria. For example, you could sort a sales report by region, then by date, and then by salesperson. Each sort level is represented by a single row in the Sort dialog box.

  1. Click a cell in one of the columns that you want to sort.

  2. On the Data tab, select Sort.

    On the Excel Data tab, select Sort

  3. If your data has a header row, select the My list has headers check box. But if the data does not have a header row, clear the My list has headers check box.

  4. In the row next to Sort by, under Column, click the blank space, and then click the column that you want to sort by.

  5. Under Sort On in the same row, click Values, and then on the shortcut menu, click the criteria that you want.

    You can also choose to sort based on cell or font color, or on the icon in a cell.

  6. Under Order in the same row, click A to Z, and then on the shortcut menu, click the criteria that you want.

    Tip: If the sort order you want is not listed, select Custom List. If the custom sort order you want isn't listed, see Create a custom list to sort by.

  7. If you selected Cell Color, Font Color, or Cell Icon in step 5, then under Color/Icon, click the row, and then on the shortcut menu, click the criteria that you want.

  8. For each additional column you want to sort by, click Add Level.

      Add level icon

    Then fill in the Column, Sort On, Order, and Color/Icon columns for the new row.

Sort a list by rows

Note: This procedure can't be performed in a table. To remove table formatting so that you can sort by rows, on the Table tab, select Convert to Range.

  1. Click a cell in the row that you want to sort.

  2. On the Data tab, select Sort.

    On the Excel Data tab, select Sort

  3. If your data has a header row, select the My list has headers check box. But if the data does not have a header row, clear the My list has headers check box.

  4. Click Options.

  5. Under Orientation, click Sort left to right, and then click OK.

  6. In the first row, under Row, click the blank space next to Then by, and then on the shortcut menu, click the row that you want to sort next.

  7. Under Sort On in the same row, click Values, and then on the shortcut menu, click the criteria that you want.

  8. Under Order in the same row, click A to Z, and then on the shortcut menu, click the criteria that you want.

    Tip: If the sort order you want is not listed, select Custom List. If the custom sort order you want isn't listed, see Create a custom list to sort by.

  9. For each additional row you want to sort by, click Add Level.

      Add level icon

    Then fill in the Row, Sort On, Order, and Color/Icon columns for the new row.

Create a custom list to sort by

Excel includes custom lists that you can sort by: days of the week and months of the year. In addition, you can create your own custom lists, for example, grade levels in a school, such as Freshman, Sophomore, Junior, and Senior. Once your custom list is created, to use it, in the Sort box, under Order, select Custom List.

  1. On the Excel menu, click Preferences, and then under Formulas and Lists, click Custom Lists .

  2. Click Add.

  3. Type the values for your list in the order that you want them sorted, with a comma between each value.

  4. When you are finished, click Add, and then close the Custom Lists box.

Sort by a custom list

Excel includes custom lists that you can sort by: days of the week and months of the year. In addition, the previous procedure explains how you can create your own custom lists, for example, grade levels in a school, such as Freshman, Sophomore, Junior, and Senior.

  1. Click a cell in one of the columns that you want to sort.

  2. On the Data tab, select Sort.

    On the Excel Data tab, select Sort

  3. If the data has a header row, select the My list has headers check box. But if the data does not have a header row, clear the My list has headers check box.

  4. Under Order, click Custom List.

  5. Select the list that you want to sort by, and then click OK.

    Note: The custom sort order applies only to the column specified under Column. To sort multiple columns by weekday, month, or another custom list, use the previous "Sort a list by two or three columns" procedure to sort each column separately.

Sort dates or times

  1. Select a column of dates or times in a range of cells or in a table.

  2. On the Data tab, select Ascending Ascending sort icon or Descending Descending sort icon .

    Note: If the results are not what you expected, the data might contain dates or times that are stored as text or numbers, instead of as dates or times. To store the numbers in date or time format, select the column, and on the Home tab, select Date or Time in the Number Format box.

Sort case-sensitive text

  1. Click a cell in one of the columns that you want to sort.

  2. On the Data tab, select Sort.

    On the Excel Data tab, select Sort

  3. In the Sort box, select Options, and then select Case sensitive.

Sort by cell color, font color, or icon

If there are cells formatted by cell color or font color in the column that you are sorting, you can sort by these colors. You can also sort by an icon set that was created by using a conditional format. Because there is no default sort order for cell color, font color, or icons, you must define your own order for each sort operation.

  1. Click a cell in one of the columns that you want to sort.

  2. On the Data tab, select Sort.

    On the Excel Data tab, select Sort

  3. If the data has a header row, select the My list has headers check box. But if the data does not have a header row, clear the My list has headers check box.

  4. Under Column, click the blank space next to Then by, and then on the shortcut menu, click the column that you want to sort by.

  5. Under Sort On in the same row, click Values, and then on the shortcut menu, click Cell Color, Font Color, or Cell Icon.

  6. Under Color/Icon, select the color or icon.

  7. Under Order, choose whether the selected color or icon should be at the top or bottom of the list.

  8. For each additional column you want to sort by, click Add Level.

      Add level icon

    Then fill in the Column, Sort On, Order, and Color/Icon columns for the new row.

Sort one column in a range of cells without affecting the other columns

Important: Be careful when you use this feature. Sorting by one column in a range can produce results that you don't want, such as moving cells in that column away from other cells in the same row.

  1. Select a column in a range of cells that contains two or more columns.

    Note: This procedure can't be performed in a table. To remove table formatting so that you can sort one column, on the Table tab, select Convert to Range.

  2. Select the column data that you want to sort.

  3. On the Data tab, click Sort.

    On the Excel Data tab, select Sort

  4. In the Sort Warning that appears, select Continue with the current selection, and then click Sort.

    If the results are not what you want, click Undo  Undo icon .

See Also

Filter by font color, cell color, or icon sets

Filter a list of data

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×