Automatically generating numerical keys

S

So_Long

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: intel

Imagine the a spreadsheet with the following data:

aardvark
impala
lion

Is there a way to automatically generate a column of matching numerals, so my display looks like this?:

1 / aardvark
2 / impala
3 / lion

Of course, I'm dealing with much bigger chunks of data. I have spreadsheets that have over 15,000 rows, and I would like to generate several numerical columns for each one. For example, one numerical column might organize each animal taxonomically, while a second numerical column might organize them by habitat.

I just wondered if I can generate the numbers automatically, rather than typing them in one at a time.

Thanks.
 
C

Carl Witthoft

Not exactly sure what you're getting at. Do you mean that every time
"aardvark" shows up you want the number in the neighbor column to be 1?

If so, you can either do something like

=IF($a$1='aardvark',1,IF($a$1='impala',2,3))
but that'll be a mess if you have a lot of animals.

A better solution is to set up a worksheet with a table of source data:

animal habitat taxon
aard 1 2
lion 4 2
human 3 1

and so on.

then in the column next to your big table of animals, the 'habitat'
column uses a formula like (assume column A has the animal names)

=VLOOKUP([referencetablename], A1,2)
and the taxonomy column would be similar

=VLOOKUP([referencetablename], A1,3)


Carl
 
S

So_Long

Thanks, but that's not what I meant. Instead of the brief example I gave, imagine a spreadsheet with a column that lists 10,000 animal species. If I want to number the rows, I will have to type in 10,000 numerals, from 1 to 10,000.

Is there a way I can automatically generate a column of numerals instead?

So let's say I create another spreadsheet that lists 5,378 bird species in one column, I could create a new column that would be automatically "populated" with the numerals 1 through 5,378. And if I create a third spreadsheet that lists 23 galaxies, I could create a column that's numbered 1-23.

Thanks.
 
C

CyberTaz

One way -

Select the cells to be numbered, enter 1 in the first cell then, Go to Edit>
Fill> Series, select Column, confirm the Step Value is 1 & that Type is set
to Linear, then click OK.

HTH |:>)
Bob Jones
[MVP] Office:Mac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top