In Excel: select one cell in the table, choose Data ▸ Sort, tick My data has headers, pick the column and order, and expand the selection so whole rows move together.
What this does
Sorting reorders rows by one or more columns. The key safety rule is that whole records must move together; sorting a single column by itself can detach names, dates and amounts from one another. Dates sort correctly only when Excel recognizes them as real dates, not text. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “sort two columns in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected columns change, and only then apply the same setup to the full sheet. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That is what makes a data step that keeps your analysis trustworthy useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
A table has Customer, Date and Amount. Click inside it, choose Data ▸ Sort, tick My data has headers, sort by Date from Oldest to Newest, then add a level for Amount largest to smallest. Each row stays intact while the table order changes. Sorting is simple but high-risk: done correctly it reveals order and priority; done on the wrong range it corrupts the dataset. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. Nothing on this page is behind a login: the tool runs entirely in your browser, the formula is shown in full with one-click copy, and the steps work the same on Windows and Mac. That is the whole promise here — the exact answer, a way to prove it on your own numbers, and just enough context to make it stick. If you take one thing from this page on “sort two columns in excel”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.
Common mistakes
- Sorting only one column and corrupting row relationships.
- Sorting dates stored as text, which can order alphabetically instead of chronologically.
- Leaving blank rows that split the detected table range.
- Forgetting to include hidden rows if they should be sorted too.
Frequently asked questions
How do I sort by date?
Make sure the values are real dates, then Data ▸ Sort by that date column.
How do I sort columns left to right?
Use Sort Options and choose Sort left to right.
Why did my rows get mixed up?
Only one column was sorted. Undo and sort the whole table range.
Other ways people ask this
This guide also answers
- excel sort by two columns