Section 7. Sorting Data


Section 7. Sorting Data

Often, you want your data to appear in a sorted order. You might want to sort your data by date, for example, or by quantity or dollar value. Fortunately, Google Spreadsheets lets you sort your data either alphabetically or numerically, in either ascending or descending order.



Executing a Sort

Sorting data in Google Spreadsheets is a two-step operation. You first have to "freeze" the header row(s) of your spreadsheet, then you identify the column by which you want to sort. Google will then order all the "unfrozen" (non-header) rows of your spreadsheet in whichever order (ascending or descending) you specified.

Here's how to do it:

1.

Click the Sort tab, as shown in Figure 19.

Figure 19. Getting ready to sort via the Sort tab.


2.

Click the Freeze Rows button and select how many rows you want to include as the spreadsheet's header, as shown in Figure 20. (In most cases, it's just one row.) When you freeze a header row, it no longer scrolls with the rest of the spreadsheetand is not included in any sort.

Figure 20. Choosing which rows to freeze.


3.

Identify which column you want to sort by, and move the cursor to any cell within that column.

4.

To sort in ascending order, click the A>Z button; to sort in descending order, click the Z>A button.

The A>Z and Z>A sorts don't just sort by letter; they also sort by number. An A>Z sort will arrange numerical data from smallest to largest; a Z>A sort will arrange numerical data from largest to smallest.



Sorting a Range

This procedure conducts a sort on the entire contents of your spreadsheet. You can also sort within a selected range of cells, with certain limitations. To do this, follow these steps:

1.

Select the Sort tab.

2.

Position the cursor on the first cell in the first column of the range.

3.

Use the mouse or the keyboard to select the entire range; the first cell stays selected.

4.

Click the A>Z button to sort the range on the first column, in ascending order; click the Z>A to sort the range on the first column, in descending order.

Caution

When you sort a range, you can sort only on the first column selected. You cannot sort on a middle column within a range.




Performing Multiple-Column Sorts

Know that, unlike Excel, Google Spreadsheets can sort only on one column at a time. (Excel can sort on up to three columns, in order.) That means you may need to sort your spreadsheet multiple times, for each column you need sorted.

For example, if you have one column for names and another for dates, and you want your spreadsheet sorted by date first and then alphabetical by name within each date, you must do two sorts. The first sort should be by name (to set up the alphabetical arrangement), and the second sort should be by date.



Section 8. Inserting, Deleting, Moving, and Copying Data

There are times when you need to rearrange data on your worksheetbeyond simple sorting, that is. When you need to move data from place to place, duplicate certain cells, or delete something you don't like, it's time to learn Google Spreadsheets' cell, row, and column editing functions.



Inserting Rows and Columns

To insert a new row or column, follow these steps:

1.

Position the cursor in the row or column where you want to insert a new row or column.

2.

Click the Insert button.

3.

Select whether you want to insert a row or a column.

Google Spreadsheets now inserts the new row above the selected row or the new column to the left of the selected column. The existing row or column is shifted either down or to the right.

Note

Unlike Microsoft Excel, Google Spreadsheets only lets you insert entire rows or columns; you can't insert individual cells into the spreadsheet. You also can't insert rows below the current row or to the right of the current column.