Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel formula to auto-increment after X amount of rows

I imported a few thousand rows of data into Excel and whereas one item represented one row, I've had to modify each item so that 11 rows represent the same item id.

For example:-

Original

63 --->data
64 --->data
65 --->data

Current

63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
63 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data
64 --->data

(you get the idea)...

However, due to the formula I have used to populate the additional 10 rows per item, I am left with the same ID in Column A as all the rows the formula was based on.

I'm looking for a formula that will auto-increment the cell values based but only every 11 rows, so that I can click and drag down column A and it will fill the same id for 11 rows and then auto-increment (+1) and fill the next 11 rows like this.

I've tried a number of variants all to no avail. Thanks.

EDIT

Here is an example of what I currently have and wish to simplify:-

A    B    C    D    E    F
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
79 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id
80 <--already correct id

58 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
57 <-- needs to be changes to 81
58 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82
57 <-- needs to be changes to 82

There are thousands of rows like this...

like image 486
zigojacko Avatar asked Mar 26 '13 14:03

zigojacko


People also ask

How do you increment a cell reference by X rows in Excel?

Select a blank cell, enter formula =OFFSET($C$1,0,(COLUMN()-1)*3) into the Formula Bar, then press the Enter key. See screenshot: 2. Then drag the result cell across the row to get the needed results.

How do you increment automatically in Excel?

Microsoft Excel inherently offers a numbering system to automatically create a series of incremented numbers. Enter any starting value in cell A1. Enter the next value in cell A2 to establish a pattern. Select those two cells and drag the bottom fill handle down the column to create a series of incremental numbers.


2 Answers

You can also use this formula, it will also usefull for even and odd numbering

=INT(((ROW(a1)-1)/11))*1+1

use *1 for 1 increment, *2 for 2 increment, +1 is starting number, if you want to start from 79 use +79 at the end

like image 165
Ibrahim Akbar Avatar answered Oct 12 '22 15:10

Ibrahim Akbar


If Im understanding the issue correctly there is no need for a complex formula.

try this in a column to test for your self to see if this is what you need.

Start in A1 and put the num 1 in each of 3 cells (a1,a2,a3)

in A4 put A4 = A1+1

then drag down. YOu will see the sequence you need... 1 1 1 2 2 2 3 3 3

if the sequence you need is indeed sequential then you can apply this as needed.

like image 43
Adam Daniel Avatar answered Oct 12 '22 14:10

Adam Daniel