# Duplicating rows

wonder if there's an easy way to duplicate rows in excel. An example would be:
Before:

``````1
2
3
4
``````

after:

``````1
1
2
2
3
3
4
4
``````

I meet this issue way to often to cut/paste my way down.. Anyone have a trick or two?

-

## migrated from stackoverflow.comMay 27 '11 at 7:48

This question came from our site for professional and enthusiast programmers.

Suggest you do an sorting your first result-set that includes each of your columns, e.g.

Sort By Column A

Then By Column B

Then By Column C

...etc

This might give you something like:

``````1   A   X
2   B   Z
3   C   Y
4   D   T
``````

Then you can copy the result set and paste it immedately below your first:

``````1   A   X
2   B   Z
3   C   Y
4   D   T
1   A   X
2   B   Z
3   C   Y
4   D   T
``````

Then you would sort it again

``````1   A   X
1   A   X
2   B   Z
2   B   Z
3   C   Y
3   C   Y
4   D   T
4   D   T
``````
-
your solution would give me: colA: 1,2,3,4,1,2,3,4 you solution plus an extra sort: colA: 1,1,2,2,3,3,4,4 This gives me what I need for my datasets, thanks alot m8 :) – d0lph1n May 27 '11 at 9:01
My original post did include that, pbut somehow it got lost. Have edited accoringly. – James Wiseman May 27 '11 at 9:05

Initial state, many rows, many columns :

``````... ... ...
... ... ...
... ... ...
``````
1. In an extra column, you add numbers from 1 to the number of rows :

``````... ... ...  1
... ... ...  2
... ... ...  3
``````
2. Copy-paste the whole block below itself :

``````... ... ...  1
... ... ...  2
... ... ...  3
... ... ...  1
... ... ...  2
... ... ...  3
``````
3. Order according to the last column :

``````... ... ...  1
... ... ...  1
... ... ...  2
... ... ...  2
... ... ...  3
... ... ...  3
``````
4. You may now remove the extra column.

-