Sort rows in ascending order (A to Z, or 0 to 9) or descending order (Z to A, or 9 to 0)
Note In a PivotTable report, Microsoft Excel uses the selected field to sort.
For best results, the range you sort should have column labels.
Sort rows by months or weekdays
Use your own data as the sort order
In a range of cells, enter the values you want to sort by, in the order you want them, from top to bottom. For example:
Data |
---|
High |
Medium |
Low |
Select the range.
On the Tools menu, click Options, and then click the Custom Lists tab.
Click Import, and then click OK.
Select a cell in the range you want to sort.
On the Data menu, click Sort.
In the Sort by box, click the column you want to sort.
Click Options.
Under First key sort order, click the custom list you created. For example, click High, Medium, Low.
Click OK.
Select any other sort options you want, and then click OK.
Note You can't use a custom sort order in a Then by box. The custom sort order applies only to the column specified in the Sort by box. To sort multiple columns by using a custom sort order, sort by each column separately. For example, to sort by columns A and B, in that order, first sort by column B, and then specify the custom sort order by using the Sort Options dialog box. Next, sort the range by column A.
Most of the time, you sort rows. This procedure sorts the order of columns.
Note When you sort rows that are part of a worksheet outline, Microsoft Excel sorts the highest-level groups (level 1) so that the detail rows or columns stay together, even if the detail rows or columns are hidden.