Converting Multiple Column Data into a single table

KolGuyXcel

Board Regular
Joined
Jun 29, 2018
Messages
147
Hello,

I'm working on an excel sheet that I've received which has around 30 columns of data. Basically each column refers to one "table" and each "table" has exactly the same 6 columns. Now, each column has a variable 6N number of rows!
I need to compile all the data in a single 6 column table. So, 6 consecutive rows from each column in the "original" excel sheet refers to the same data and needs to go in the same row in the final 6-column table, which I intend to create in a separate sheet.




Note: A non-VBA solution is needed.
 

Attachments

  • DummyExcel.png
    DummyExcel.png
    12.2 KB · Views: 9

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
First at sheet1, I add Manually Zero Values at Cell AI2 Then I add one Helper Column to Count Data at Each column. I add it at column AI (after 30 Columns).
Book1
ABCDEFGH
1ItemCode1ItemCode4ItemCode6ItemCode7ItemCode8ItemCode9ItemCode10ItemCode11
2ItemName1ItemName4ItemName6ItemName7ItemName8ItemName9ItemName10ItemName11
3ItemRate1ItemRate4ItemRate6ItemRate7ItemRate8ItemRate9ItemRate10ItemRate11
4ItemQuantity1ItemQuantity4ItemQuantity6ItemQuantity7ItemQuantity8ItemQuantity9ItemQuantity10ItemQuantity11
5ItemPrice1ItemPrice4ItemPrice6ItemPrice7ItemPrice8ItemPrice9ItemPrice10ItemPrice11
6ItemExpiry1ItemExpiry4ItemExpiry6ItemExpiry7ItemExpiry8ItemExpiry9ItemExpiry10ItemExpiry11
7ItemCode2ItemCode5ItemCode7ItemCode8ItemCode9ItemCode10ItemCode11ItemCode12
8ItemName2ItemName5ItemName7ItemName8ItemName9ItemName10ItemName11ItemName12
9ItemRate2ItemRate5ItemRate7ItemRate8ItemRate9ItemRate10ItemRate11ItemRate12
10ItemQuantity2ItemQuantity5ItemQuantity7ItemQuantity8ItemQuantity9ItemQuantity10ItemQuantity11ItemQuantity12
11ItemPrice2ItemPrice5ItemPrice7ItemPrice8ItemPrice9ItemPrice10ItemPrice11ItemPrice12
12ItemExpiry2ItemExpiry5ItemExpiry7ItemExpiry8ItemExpiry9ItemExpiry10ItemExpiry11ItemExpiry12
13ItemCode3
14ItemName3
15ItemRate3
16ItemQuantity3
17ItemPrice3
18ItemExpiry3
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Sheet1

Book1
AI
1CountItemsatColumns
20
318
430
542
654
766
878
990
10102
11102
12102
13102
14102
15102
16102
17102
18102
19102
20102
21102
22102
23102
24102
25102
26102
27102
28102
29102
30102
31102
32102
Sheet1
Cell Formulas
RangeFormula
AI3:AI32AI3=IFERROR(COUNTIFS(INDIRECT(ADDRESS(1,ROWS($A$1:$A$1))&":"&ADDRESS(1000,ROWS($A$1:A1))),"<>"),0)


Then At Sheet2 Try this formula:

Cell Formulas
RangeFormula
A2:F8A2=OFFSET(Sheet1!$A$1,(ROW($A1)-1)*6+COLUMNS($A:A)-1-INDEX(Sheet1!$AI$2:$AI$31,MATCH((ROW($A1)-1)*6+COLUMNS($A:A)-1,Sheet1!$AI$2:$AI$31,1)),MATCH((ROW($A1)-1)*6+COLUMNS($A:A)-1,Sheet1!$AI$2:$AI$31,1)-1)
 
Upvote 0
Solution
First at sheet1, I add Manually Zero Values at Cell AI2 Then I add one Helper Column to Count Data at Each column. I add it at column AI (after 30 Columns).
Book1
ABCDEFGH
1ItemCode1ItemCode4ItemCode6ItemCode7ItemCode8ItemCode9ItemCode10ItemCode11
2ItemName1ItemName4ItemName6ItemName7ItemName8ItemName9ItemName10ItemName11
3ItemRate1ItemRate4ItemRate6ItemRate7ItemRate8ItemRate9ItemRate10ItemRate11
4ItemQuantity1ItemQuantity4ItemQuantity6ItemQuantity7ItemQuantity8ItemQuantity9ItemQuantity10ItemQuantity11
5ItemPrice1ItemPrice4ItemPrice6ItemPrice7ItemPrice8ItemPrice9ItemPrice10ItemPrice11
6ItemExpiry1ItemExpiry4ItemExpiry6ItemExpiry7ItemExpiry8ItemExpiry9ItemExpiry10ItemExpiry11
7ItemCode2ItemCode5ItemCode7ItemCode8ItemCode9ItemCode10ItemCode11ItemCode12
8ItemName2ItemName5ItemName7ItemName8ItemName9ItemName10ItemName11ItemName12
9ItemRate2ItemRate5ItemRate7ItemRate8ItemRate9ItemRate10ItemRate11ItemRate12
10ItemQuantity2ItemQuantity5ItemQuantity7ItemQuantity8ItemQuantity9ItemQuantity10ItemQuantity11ItemQuantity12
11ItemPrice2ItemPrice5ItemPrice7ItemPrice8ItemPrice9ItemPrice10ItemPrice11ItemPrice12
12ItemExpiry2ItemExpiry5ItemExpiry7ItemExpiry8ItemExpiry9ItemExpiry10ItemExpiry11ItemExpiry12
13ItemCode3
14ItemName3
15ItemRate3
16ItemQuantity3
17ItemPrice3
18ItemExpiry3
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Sheet1

Book1
AI
1CountItemsatColumns
20
318
430
542
654
766
878
990
10102
11102
12102
13102
14102
15102
16102
17102
18102
19102
20102
21102
22102
23102
24102
25102
26102
27102
28102
29102
30102
31102
32102
Sheet1
Cell Formulas
RangeFormula
AI3:AI32AI3=IFERROR(COUNTIFS(INDIRECT(ADDRESS(1,ROWS($A$1:$A$1))&":"&ADDRESS(1000,ROWS($A$1:A1))),"<>"),0)


Then At Sheet2 Try this formula:

Cell Formulas
RangeFormula
A2:F8A2=OFFSET(Sheet1!$A$1,(ROW($A1)-1)*6+COLUMNS($A:A)-1-INDEX(Sheet1!$AI$2:$AI$31,MATCH((ROW($A1)-1)*6+COLUMNS($A:A)-1,Sheet1!$AI$2:$AI$31,1)),MATCH((ROW($A1)-1)*6+COLUMNS($A:A)-1,Sheet1!$AI$2:$AI$31,1)-1)
Thanks! This worked fine!
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

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