Home life · Updated
How to Organize Excel by Column Data
Quick answer To organize Excel by column data, select the data range, then use Sort (Data tab) to sort by one or more columns, or use Filter to view subsets. This quickly reorders rows alphabetically, numerically, or by custom rules.
What You’ll Need
- A computer with Microsoft Excel (2016 or later, or Microsoft 365) or a free alternative like Google Sheets (steps are similar).
- Your spreadsheet file open, with the data you want to organize in a table or range.
- Know which column(s) you want to sort by—for example, “Last Name”, “Date”, or “Price”.
Step-by-Step
- Select the data range – Click and drag to highlight all cells you want to sort, including the header row. If your data is a proper Excel table (created with Ctrl+T), just click anywhere inside it—Excel will automatically include the whole table.
- Open the Sort dialog – Go to the Data tab on the ribbon and click Sort (not the small A→Z or Z→A icons, which sort by only one column). This opens the Sort dialog box where you can set multiple sorting rules.
- Choose the first column to sort by – In the “Sort by” dropdown, pick the column you want to organize first (e.g., “Department”). Next to it, set “Sort On” to “Cell Values” (the default) and “Order” to “A to Z” (alphabetical) or “Smallest to Largest” (numeric).
- Add more levels if needed – Click Add Level to sort by a second column (e.g., within each department, sort by “Last Name”). Repeat this for as many columns as you need—Excel sorts by the first rule, then the second, and so on.
- Check the header row option – In the Sort dialog, ensure “My data has headers” is checked (top-right). This tells Excel not to sort the header row itself. If your data has no headers, uncheck it so the first row is treated as data.
- Apply the sort – Click OK. Your rows will now be reordered according to the column(s) you chose. If you only need a quick single-column sort, you can instead click the A→Z or Z→A button on the Data tab after selecting one column.
- Use Filter for temporary views – If you want to see only certain values (e.g., only “Sales” department) without reordering, select your data, go to Data > Filter, then click the dropdown arrow in the column header and check/uncheck values. This hides rows that don’t match, but doesn’t change the underlying order.
Common Mistakes
- Selecting only one column – If you highlight just column A and sort, Excel will ask if you want to expand the selection. If you say no, only that column gets sorted, mixing up your rows. Always select the entire data range.
- Forgetting to include the header row – If you don’t check “My data has headers”, Excel treats your header as a regular row and sorts it into the middle of your data.
- Sorting with hidden rows or columns – Hidden rows are not included in the sort, which can leave data out of order. Unhide everything before sorting.
- Mixing text and numbers in a column – If a column contains some numbers stored as text (e.g., “001” vs 1), sorting may put them in odd order. Convert all cells to the same type first.
- Not using “Add Level” for multi-column sorts – A common workaround is sorting by column B, then column A, but Excel sorts by the first rule first, so you must add levels in the correct priority order (most important first).
Tips
- Create an Excel Table (Ctrl+T) before sorting. Tables automatically expand the selection, keep headers fixed, and make filters easier to use.
- Use custom sort orders – In the Sort dialog, under “Order”, choose “Custom List” to sort by things like days of the week (Mon, Tue, Wed) or priority levels (High, Medium, Low) instead of alphabetical.
- Sort by cell color or font color – If you’ve color-coded cells, you can sort by that color using the “Sort On” dropdown in the Sort dialog. This is great for flagging important rows.
- Use the “Sort A to Z” button for quick single-column sorts – After selecting one cell in a column, clicking the A→Z icon sorts the whole table by that column, but only if your data is contiguous and has headers.
- Keep a backup copy – If you’re unsure, copy the sheet (right-click the tab > Move or Copy > Create a copy) before sorting, so you can revert if something goes wrong.
Troubleshooting
- Data gets scrambled after sorting – This usually happens because you selected only one column. Undo (Ctrl+Z) and redo the sort with the entire range selected. If you’re using a table, click any cell inside it first.
- Sort options are greyed out – This can occur if your sheet is protected or if you have merged cells. Unprotect the sheet (Review > Unprotect Sheet) or unmerge cells before sorting.
- Numbers are sorting as text (e.g., 1, 10, 100, 2) – This happens when cells are formatted as text. Select the column, go to Data > Text to Columns, and click Finish (this converts text to numbers). Or use a helper column with =VALUE(A1) and sort by that.
- Filter doesn’t show all values – If some rows are hidden or the range is not correctly defined, click anywhere in the data and reapply the filter. Also check that the filter range includes all rows.
- Header row gets sorted into the data – In the Sort dialog, make sure “My data has headers” is checked. If you’re using a table, headers are always recognized.
- Sort order seems random – Check for leading spaces or non-printing characters in the column. Use the TRIM function in a helper column to clean data, then sort by that column.
Frequently Asked Questions
How do I sort by multiple columns in Excel?
Open the Sort dialog (Data > Sort), then click “Add Level” for each additional column. Set the order of priority: the top rule is the primary sort, the next is secondary, and so on.
Can I sort by column data without moving the rows?
No, sorting inherently reorders entire rows based on the column you choose. If you only want to reorder the column itself, copy it to a new location and sort that range separately, but this breaks the relationship with other data.
How do I sort by date in Excel?
Select the date column, then use the Sort dialog. Choose “Oldest to Newest” or “Newest to Oldest” in the Order dropdown. Make sure the dates are actual date values, not text.
What is the difference between sorting and filtering?
Sorting reorders all rows based on a column’s values. Filtering temporarily hides rows that don’t meet criteria, leaving the order unchanged. You can combine both: filter first, then sort the visible rows.
How do I sort by a custom list like High, Medium, Low?
In the Sort dialog, under Order, select “Custom List”. Type your list in the “List entries” box (e.g., High, Medium, Low) and click Add. Then sort by that column using the custom list.
Why did my sort not include all columns?
This happens when you select only a partial range. Always select the entire data range, or better, convert your data to an Excel Table (Ctrl+T) so Excel automatically includes all rows and columns.
Related
- How to Turn Off Android Auto in Your Car
- How to Get Rid of Small Black Flies in House
- How to Turn Off Android AI on Pixel 9 Pro
Sources: Microsoft Support. Menus and buttons can differ slightly by version. Spotted something out of date? Tell us.