Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to sort a table alphabetically in a document

Table, then Sort in Write by Zaweba puts rows in A to Z order by any column, keeps the header at the top and can sort numbers, pound amounts and dates too.

How to sort a table alphabetically in a document

Click in the table and choose Table, then Sort in Write by Zaweba. Pick the column to sort by, choose text and ascending, and the rows go into A to Z order. The header row stays at the top, so your column headings are not shuffled in with the data.

What sorting can do for you

Tables in documents tend to grow in whatever order things were added. A list of club members gets new names at the bottom, a reading list collects books as you find them, and a price list picks up items as stock arrives. Sorting puts it all in order in one step instead of cutting and pasting rows.

The same command works on plain paragraphs as well as table rows. Select a list of names, one per line, and sort it alphabetically without making a table at all.

Sorting step by step

Click anywhere in the table. Open the Table menu and choose Sort. Choose the column that holds the values you want to sort on, such as Surname. Choose to sort as text for names and words. Then pick ascending for A to Z or descending for Z to A, and confirm.

Every row moves as a whole, so a person's phone number and address stay with their name. The header row is kept at the top.

If the first column holds first names and you want surname order, sort on the surname column. If there is no separate surname column, it is worth splitting the names into two columns before you sort.

Numbers, money and dates

Sorting text alphabetically puts 10 before 9, because it compares the characters one by one. That is why Write lets you sort as numbers too. Choose number for quantities, ages or scores, and the rows go in true numeric order. Amounts with a pound sign are understood as numbers, so a price list sorts from cheapest to dearest or the other way round.

Dates have their own sort type. Sort a table of meetings, payments or events as dates and they go into calendar order rather than the order of the characters.

Tidy data sorts better

A sort is only as good as the values in the column. Check that each row really has something in the sort column, that names are spelled consistently, and that dates are all written in the same form. A stray space at the start of a cell can push a row to the top of an A to Z list.

If the table has merged cells in its body, sort before merging, or keep merged cells to the header row, so whole rows can move freely.

Turning text into a sortable table

If your list started life as tab or comma separated text, perhaps pasted from an email or a spreadsheet, Write's Convert text to table turns it into a real table first. Sort it, and if you want plain text back, Convert table to text gives you tab separated lines again.

Write keeps unlimited undo, so Ctrl+Z puts things back if you chose the wrong column. Write by Zaweba keeps the job short, so a messy list becomes an ordered one in seconds.