Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

migrated from stackoverflow.com May 27 '11 at 7:48

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

add comment

2 Answers

up vote 3 down vote accepted

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
share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.