How to fill a column with sequential numbers when some rows need to be skipped

Copper Contributor

I am trying to automate a process whereby I fill a column with a linear series of numbers with a step value of 1.  The challenge is that not all rows qualify to receive a number. (The rows represent orders and the number in the column becomes the box number for the ordered items.  Not all rows have orders.)

 

Currently, I use a simple formula which adds 1 to the value in the cell above it. [C3=C2+1]  This works if the rows requiring a number assignment are contiguous, however some rows need to be skipped (the rows with no orders).  I could write an "IF" statement to have the formula look to see if there is an order in that row, but I do not know how to tell it to set the value to 1 plus the last row with a value.

 

Any suggestions?

2 Replies

@RLevkoy 

Let's say that you want to skip a row if column A is blank. In C3:

=IF(A3="","",MAX(C$2:C2)+1)

Fill down.