简体   繁体   中英

How to instruct Excel to go copy a range of cells from left to right?

So basically, my sheet has a list of items, but they are ordered like this:

A2 | Item 1 Code | Item 1 name | Quantity | Item 2 code | Item 2 name | Quantity
A3 | Item 3 Code | Item 3 name | Quantity | Item 4 code | Item 4 name | Quantity 

etc.

I want to reorder the items to make it a single list, since the codes should remain in the same order after filtering and it's been quite a conundrum. I tried putting like

=B2 | =C2 | =D2
=E2 | =F2 | =G2
=B3 | =C3 | =D3
=E3 | =F3 | =G3

and then auto-filling, but as you may imagine, that caused Excel to start skipping rows as it got to the end of the formulas it was copying to the lower cells.

Anyone able to explain to me how to fix this? :')

Not the cleanest but it may work for you:

在此处输入图像描述

Formula in column I is:

=IF(ISODD(ROW());INDEX($B$1:$B$9;ROUNDUP(ROW()/2;0));INDEX($E$1:$E$9;ROUNDUP(ROW()/2;0)))

Formula in column J:

=IF(ISODD(ROW());INDEX($C$1:$C$9;ROUNDUP(ROW()/2;0));INDEX($F$1:$F$9;ROUNDUP(ROW()/2;0)))

Formula in column K:

=IF(ISODD(ROW());INDEX($D$1:$D$9;ROUNDUP(ROW()/2;0));INDEX($G$1:$G$9;ROUNDUP(ROW()/2;0)))

It's always same formula, but changing target range. After dragging, copy/paste values and delete original data:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM