Sorting a table without scrambling the whole thing
Last lesson we set up columns for dates and entries on the tracking sheet. Plain, basic stuff, one row per thing you are tracking. Today we sort that table, because sooner or later you will want to see it oldest to newest, or biggest to smallest, and if you sort it wrong you can genuinely scramble your data without noticing right away.
Casey found this one out the hard way. I tried to teach him how to sort a table, and he right off clicked the little sort arrow on just one column header, not the whole table, and it sorted THAT column and left every other one sitting still. So all of a sudden the dates no longer matched the entries. Everything looked fine, nothing showed an error, it was just quietly wrong. I fixed it in about ten seconds, but he still brings it up as though it were somehow my fault. It was not. It is only what the button does if you do not tell it otherwise.
And that is the real danger with sorting. It will not yell at you. There is no red error message. Your money tracker will just sit there looking ordinary while row 12's date is attached to row 40's entry. You will not catch it until something looks strange three weeks on and you cannot work out why.
Selecting the whole table first
The fix is simple, and I want you to actually do it every single time, not only the first time.
- Click into any cell in your table.
- Select the whole range, all your columns, all your rows with data in them. In Google Sheets you can click the little corner box or just drag-select from your top-left cell to your bottom-right cell. In Excel, same idea, drag to select everything.
- THEN sort.
In Google Sheets, once you have the range selected, go to Data, then Sort range. It will ask whether your data has a header row; say yes, then pick which column to sort by. In Excel it is Data, then Sort, and it will usually offer to "expand the selection" on its own if it notices you have more columns next to what you selected, say yes to that too.
The whole point is that every row should move together as one unit. Date, entry, category, all of it travels as a package. If you only select one column, that column goes off on its own little trip and leaves everyone else behind.
A shortcut that is actually safer
If your data sits in a proper formatted table (not just cells with a header row, but a real Table object), both Google Sheets and Excel are smarter about this. The little dropdown arrows on your header row will sort the whole table on their own, because the table knows its own edges. That is honestly the safer setup for a beginner, less to remember, less to muddle.
I will admit I do not always bother making a formal Table object for something quick and small. But for a real tracking sheet you will use for months, it is worth the two extra minutes to set it up as a Table once. The you of the future will thank the you of today.
Sort by the question you are asking
Do not sort just for the sake of sorting. Ask yourself what you actually want to know first. Oldest first if you want to see how things built up over time. Newest first if you only want to see what happened most recently without scrolling to the bottom. Biggest number first if you are trying to find your worst month, or your best.
That is my whole opinion on spreadsheets in a single sentence, truly. Most people do not have a spreadsheet problem, they have a question problem. Sorting is a good example, because if you do not know what you are trying to see, you will sort it three different ways and only feel more confused, not less.
A quick aside on being technically right
I had a coworker once who was VERY sure that a certain function (VLOOKUP, if you are curious) could not look to the left of its own reference column. He was wrong about WHY, there is in fact a workaround, but he was right that it is a nuisance and most folks do not bother with the workaround. I told him so, out loud, in front of people. Being right about the annoying part still counts as being right.
I bring it up because sorting has a similar flavor. People get very sure about "I always just click the column header," and they are technically doing something, it is only not the thing they think it is doing. Confidence and correctness are not the same. Check your work after you sort, at least the first few times, until it becomes a habit.
Undo is your friend here
One real caution: if you sort and it looks wrong, hit undo right away, do not try to fix it by hand, dragging rows around. Ctrl+Z (or Cmd+Z) will put it straight back. Trying to hand-fix a scrambled table is how you make it worse. And of course, autosave ought to be on, we have talked about that, so even if you close the file confused, you have not lost anything.
Before next time
Go sort your tracking sheet by date, oldest first, using the full-range method. Then look at three random rows and make sure the entry still matches the date you remember writing down. If it does, that is the sheet working.
- C