Excel: two ways of numbering rows

Excel shows row numbers on the side of the spreadsheet. But what if you want those numbers in a column?

This Microsoft Help page describes how to use the Row function:

http://office.microsoft.com/en-us/excel-help/automatically-number-rows-HP001154232.aspx

Enter =row(A1) into the first cell of the column. Then copy the formula, and paste down the column. The formula should automatically adjust with each cell to reflect the row number. If you need to have actual numbers in there and not formula results, copy the column into Notepad, then copy the result in Notepad back into your column.

Another way: Python can do it very quickly.

j = (maximum number of rows, 40 or 200 or whatever you want, plus one)
i = 1

while i < j:
     print i
     i = i + 1

The resulting output can be copied into Excel.

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: