Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.6k views
in Technique[技术] by (71.8m points)

excel - How to move data in colum 1 to odd positions in column 2?

I have a big data and I would like to move data from column 1 to odd positions in column 2 (see the picture). Thanks in advance for your help!

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you only need to do this once:

  • Insert a new column
  • enter the numbers 1 and 3 into the first cells next to the first two data items
  • use the fill handle to drag down with incrementing in steps of 2, so all data items have an odd number in the neighbouring column.
  • in the same column, below the last odd number, enter 2 and in the next row 4
  • use the fill handle and drag down until you have a number bigger than the last odd number.
  • Now select the data column and the numbers and sort by the numbers column.
  • move to your desired position and delete what you no longer need.

You can also use a formula along these lines:

=IF(INT(ROW()/2)=ROW()/2,INDEX(A:A,ROW()/2),"")

Then copy and paste as values over the data.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...