How to drag columns to the right and change row reference by one for every 6 columns dragged

ddgale

New Member
Joined
Feb 17, 2016
Messages
9
Hi Mr. Excel,

How can I drag columns to the right and change row reference by 1 every six columns, for example:

Sheet2 A column will reference Sheet1 $A$2
Sheet2 G column will reference Sheet1 $A$3
Sheet2 M column will reference Sheet1 $A$4

Ideally I would like to drag a range from Sheet2, let's say A:F and move it indefinitely and have the above happen (Row reference change by 1 for every 6 columns dragged to the right).

Is this possible? I have tried offset but I am sure I don't understand the function fully to use it at it's best capacity.

Any help is appreciated!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Let's say that Sheet1!A2:F10 contains your data. Try...

Code:
Sheet2!A2, copied across:

=INDEX(Sheet1!$A$2:$F$10,INT((COLUMNS($A2:A2)-1)/6)+1,MOD(COLUMNS($A2:A2)-1,6)+1)

Change the range, A2:F10, accordingly.

Hope this helps!
 
Upvote 0
It worfed for the first set of columns but then it stopped working, wondering if it has limitations...
 
Upvote 0
Did you adjust the formula according to your range of data?

Which rows contain your data?

Can you post the exact formula that you tried?
 
Upvote 0
I did make the necessary adjustments, I believe. See below:

=ArrayFormula((IFERROR(INDEX('Data Dump'!$A$2:$D$5000,SMALL(IF('Data Dump'!$A$2:$D$5000=INDEX('MTBF MTTR'!$A$2:$F$30,INT((COLUMNS($A2:A2)-1)/6)+1,MOD(COLUMNS($A2:A2)-1,6)+1),ROW('Data Dump'!$A$2:$D$5000)-1,""),ROWS(A$3:3)),1),"")))

I underlined the area of interest.
 
Upvote 0
This is kinda how it looks, the A3 cell (bolded and resized) is the number
1000632383, this column is actually a dynamic table and the B:F columns are just VLOOKUPS of the A column. Everything repeats itself for the next set of columns and so forth, I would like to drag to the right the A:F data for several hundred columns.

23
OrdersBreakdown durationMalfunction startStart of Malfunctn (Time)Malfunction endMalfunctn End (Time)OrdersBreakdown durationMalfunction startStart of Malfunctn (Time)Malfunction endMalfunctn End (Time)
100063238319.998/10/20114:01:06 PM8/11/201112:00:20 PM100081068661.136/30/20127:00:00 AM7/2/20128:07:35 PM
100073397882/10/20125:00:00 PM2/11/20121:00:00 AM10010406348.138/7/20137:00:00 AM8/7/20133:07:32 PM
1000736089102/16/20123:00:00 PM2/17/20121:00:00 AM1001040824568/6/201312:00:00 PM8/8/20138:00:00 PM
10007503669.333/8/20123:00:00 PM3/9/201212:20:00 AM100104390632.698/15/201311:00:00 AM8/16/20137:41:09 PM
1000791205183.885/15/20123:00:00 AM5/22/20126:52:43 PM10010567804228.139/2/201311:00:00 AM2/25/20143:07:36 PM
100089950227.0112/3/20123:10:00 AM12/4/20126:10:45 AM10010596053.679/5/20132:00:00 PM9/5/20135:40:30 PM
1000917427120.991/12/20135:51:00 AM1/17/20136:50:08 AM10010596063.719/5/20132:00:00 PM9/5/20135:42:23 PM
1000920326155.741/22/20133:15:26 AM1/28/20133:00:00 PM10015561183.899/28/201511:13:35 AM9/28/20153:07:16 PM
10010788331.4210/3/20133:00:00 PM10/3/20134:25:09 PM
100108711218.5810/18/201311:00:00 AM10/19/20135:35:00 AM
1001091226103.0210/29/201312:00:00 PM11/2/20137:00:58 PM
1001138409421/7/20147:00:00 AM1/9/20141:00:00 AM
100122131848.55/8/20144:00:00 PM5/10/20144:30:00 PM

<colgroup><col style="width: 182px"><col width="120"><col width="103"><col width="180"><col width="180"><col width="131"><col width="120"><col width="120"><col width="120"><col width="151"><col width="120"><col width="130"></colgroup><tbody>
</tbody>
 
Upvote 0
Did you change the location of the first cell in which you're entering the formula? If so, you'll need to adjust this part of the formula too...

COLUMNS($A2:A2)

So, for example, if the first cell in which you're entering the formula is B2 instead of A2, you'll need to change it to...

COLUMNS($B2:B2)
 
Upvote 0
Can you please clarify which cells contain the source data, and into which cells you want to place the results?

I'm currently not at my computer, but I'll have a look at it when I get a chance.
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top