This is an overview:
This is the sample dataset.
To sort the dataset by names or sales.
If Excel can identify headers, it will sort the dataset as follows when you sort it by names:
If headers are not identified, this is the output:
Method 1 – Sort by Column without Selecting the Header
Steps
- Select the entire dataset excluding the headers.
- Select Sort & Filter >> Sort A to Z or Sort Z to A in the Home tab.
- Do not select the dataset partially:
- Otherwise, if you select Expand the Selection, the headers will also be sorted. If you select Continue with the current selection, it will sort the names only altering the respective sales values.
This is the output.
Read More: Sort Multiple Columns in Excel Independently of Each Other
Method 2 – Use the Custom Sort Option
Steps
- Select a cell in the dataset.
- Select Sort & Filter >> Custom Sort.
- Select Options in the Sort dialog box.
- In Sort Options, select Sort top to bottom to sort by column. It is the default setting.
- Click OK.
- Check My data has headers.
- Choose the Names column in Sort by and A to Z in Order.
- Click OK.
Read More: How to Sort Multiple Columns in Excel
Method 3 – Hide the Header Row and Sort by Column
Steps
- Select the row number of the header.
- Right-click it and select Hide.
- The header row will be hidden. You can sort the data and then unhide the header row.
Read More: Sorting Columns in Excel While Keeping Rows Together
Method 4 – Uncheck the Header and Sort Data Using the Excel Filter Button
Steps
- Select the entire dataset.
- Press CTRL+SHIFT+L to add filter buttons.
- You will see the filter buttons at the bottom-right corner of the header cells.
- Select the filter button in Names. Choose Sort A to Z or Sort Z to A to sort the dataset by names.
Read More: How to Sort Column by Value in Excel
Method 5 – Using an Excel Table and Sorting by Column
Steps
- Select the entire dataset including headers. Press CTRL+T to create the table.
- Check My table has headers.
- Click OK.
Your dataset will be converted to an Excel table. The dropdown arrows in each header will allow you to sort the columns.
Download Practice Workbook
Download the practice workbook.
Related Articles
- How to Sort Alphabetically in Excel with Multiple Columns
- How to Sort Alphabetically in Excel and Keep Rows Together
- How to Sort Two Columns in Excel to Match
- How to Sort Columns in Excel Without Mixing Data
- How to Sort Rows by Column in Excel
- How to Sort Data by Row not Column in Excel
<< Go Back to Sort in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!
Thanks for the information – exactly what I was looking for!
Hi, Irene!
Thanks for your appreciation. To get more helpful information stay in touch with ExcelDemy.
Regards
ExcelDemy