Microsoft Office Tutorials and References

In Depth Information

**Tip 76: Numbering Table Rows Automatically**

Numbering Table Rows Automatically

In some situations, you may want a table to include sequential row numbers. This tip describes how

to take advantage of the calculated column feature (explained in Tip 75) and create a formula that

numbers table rows automatically.

Figure 76-1 shows a table (named
Table1
) with information about job applicants. The first column of

the table, labeled
Num
, displays sequential numbers.

Figure 76-1:
The numbers in column B are generated with a formula.

The calculated column formula, which you can enter into any cell in the
Num
column, is

=ROW()-ROW(Table1)+1

When you enter the formula, it’s automatically propagated to all other cells in the
Num
column.

The ROW function, when used without an argument, returns the row that contains the formula.

When the ROW function has an argument that consists of a multirow range, it returns the first row of

the range.

A table’s name does not include the header row of the table. So, in this example, the first

row of Table1 is row 5.

Note

The numbers are table row numbers, not numbers that correspond to a particular row of data. For

example, if you sort the table, the numbers will remain consecutive — and they will no longer be

associated with the same row of data.