4

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?

2 Answers 2

3

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
2
  • 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, 2011 at 9:01
  • My original post did include that, pbut somehow it got lost. Have edited accoringly. May 27, 2011 at 9:05
2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .