Portmint Lighthouse

Sorting: Putting Data in Order

Hello again. Pip here.

Last lesson we scrubbed the data clean. Now let's put it in order, so the answers float right to the top.

What sorting actually does

Sorting means rearranging the rows of your table by one column you choose, lining them up from low to high or high to low.

Think of a deck of playing cards. Fan them out and arrange them so the 2 comes first and the King comes last, and you can find any card in a blink. Sorting a spreadsheet is the same move: pick a column, and the rows reshuffle into a tidy line.

Suddenly questions answer themselves. Which order was the biggest? Who joined first? What sold the least? No counting, no squinting — the answer is sitting at the top or bottom of the list.

Ascending vs. descending

These are just the two directions you can sort.

  • Ascending goes from small to large: A to Z, 1 to 100, oldest date to newest.
  • Descending goes from large to small: Z to A, 100 to 1, newest date to oldest.

An easy way to remember: ascending is like climbing stairs — you start low and go up. Descending is walking back down.

So if you want your top sellers first, sort the sales column descending. If you want a guest list alphabetical, sort the name column ascending.

The one rule you must never break

Here is the rule that saves people from real disasters: always sort the whole table, never a single column on its own.

Picture a row as one person's full file: name, phone number, and amount they owe, all sitting side by side. Those three pieces belong together. If you highlight only the "amount owed" column and sort just that, the dollar figures slide up and down — but the names and phone numbers stay frozen in place.

Now Maria's name is glued to David's debt. The numbers look beautifully ordered, but every row is quietly wrong. This is the most common way people wreck a spreadsheet without noticing.

So before you sort: select the entire table, or just click a single cell inside it and use the built-in Sort command, and let the program grab the whole block. A good spreadsheet keeps each row intact, carrying the name, phone, and amount together as one unit. If your tool ever asks whether to "expand the selection," say yes.

Multi-level sorting (the tiebreaker)

Sometimes one column isn't enough. Imagine sorting customers by state — Texas, Texas, Texas. Within Texas, what order are they in? Whatever order they happened to land in. Messy.

A multi-level sort fixes that with a tiebreaker. You say: first sort by State, and when two rows share a state, then sort those by Last Name.

It's like a library. Books are shelved by subject first; books on the same subject are then ordered by author. Two rules, working together, so everything lands in a sensible spot. Most spreadsheets let you stack these in the sort menu: a first column, then "add another level" for the tiebreaker, and another after that if you need it.

Your turn

Open a small table — even a list of five favorite movies with a "year" column works.

  1. Sort it descending by year. Is the newest on top? Good.
  2. Now check that each title still matches its year. It should, if you sorted the whole table.
  3. Add a second column like rating, and try a two-level sort: year first, rating as the tiebreaker.

If a title ever ends up next to the wrong year, you sorted one column alone — undo, then try again with the full table selected.

Sorting lines everything up. Next we'll learn to make the rows you don't care about disappear, so only the ones that matter remain. See you in Filtering: Finding the Rows That Matter. 🐙

Stuck or curious?

Ask Pip about this lesson — tap the porthole bottom-right.