Josh
Josh

Reputation: 1610

Formula for creating identity column in Excel

I'm sure my terminology is off, I just want a formula to put in a column in excel where each cell equals the cell above it + 1. End result I make the first cell 1 and the rest count up from there. Maybe there's a more correct way to do this. Suggestions?

Upvotes: 2

Views: 18165

Answers (2)

Jett Pesson
Jett Pesson

Reputation: 16

=IF(B2<>"",A2+1)

This is a way to only populate the number once the rest of the row start being filled out. I had a macro that did this, but teams can't use macros, so I found this formula that sufficed.

Upvotes: 0

pnuts
pnuts

Reputation: 59450

A more versatile approach (no copying down etc) is Series Fill, on the Ribbon under HOME > Editing - Fill. Seed the start cell with the start value (1 in the example), if necessary reselect it, and as shown if to increment by 1 down a column one hundred times:

SO10128153 example

Can be across a row instead, dates etc, but the main advantage over =A1+1 may be that no formula is involved.

Upvotes: 3

Related Questions