Transpose special case

sonkar

New Member
Joined
Nov 10, 2014
Messages
5
Hi,

I have a data which looks like this with headers where the columns variable.

423115000001 TYPE -- -- MATERIAL COTTON COTN WEIGHT 100 GM 100GM DIMENSION -- -- ADDITIONAL INFORMATION -- --


I am trying to get the output like below

423115000001 TYPE -- --
423115000001 MATERIAL COTTON COTN
423115000001 WEIGHT 100 GM 100GM
423115000001 DIMENSION -- --
423115000001 ADDITIONAL INFORMATION -- --


any help would be great i have more than 30000 rows to be converted in this pattern.

Regards

Sachin
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Please give some more information - i am confused on the result you need to achieve.

Describe the input and outputs a bit further.
 
Upvote 0
Hi,

Sorry for the late reply,I was trying to attach excel file but don't know how to do that here cannot see the options for doing that.

Pasting the cell contents hope that helps you to understand my problem.

the input is as below with headers
[TABLE="width: 1433"]
<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Code[/TD]
[TD]ATTRIBUTE[/TD]
[TD]ATT_VALUE[/TD]
[TD]ABB_VALUE[/TD]
[TD]ATTRIBUTE[/TD]
[TD]ATT_VALUE[/TD]
[TD] ABB_VALUE [/TD]
[TD]ATTRIBUTE[/TD]
[TD] ATT_VALUE[/TD]
[TD] ABB_VALUE [/TD]
[TD] ATTRIBUTE[/TD]
[TD]ATT_VALUE [/TD]
[TD]ABB_VALUE[/TD]
[TD] ATTRIBUTE[/TD]
[TD]ATT_VALUE[/TD]
[TD]ABB_VALUE[/TD]
[/TR]
[TR]
[TD]423115000001[/TD]
[TD]TYPE[/TD]
[TD]--[/TD]
[TD]--[/TD]
[TD]MATERIAL[/TD]
[TD]COTTON[/TD]
[TD] COTN[/TD]
[TD]WEIGHT[/TD]
[TD]100 GM[/TD]
[TD]100GM[/TD]
[TD]DIMENSION[/TD]
[TD]--[/TD]
[TD]--[/TD]
[TD]ADDITIONAL INFORMATION[/TD]
[TD]--[/TD]
[TD]--[/TD]
[/TR]
</tbody>[/TABLE]

And the ouptput is as below.

[TABLE="width: 511"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD] Code[/TD]
[TD]ATTRIBUTE[/TD]
[TD]ATT_VALUE [/TD]
[TD]ABB_VALUE[/TD]
[/TR]
[TR]
[TD]423115000001[/TD]
[TD]TYPE[/TD]
[TD]--[/TD]
[TD]--[/TD]
[/TR]
[TR]
[TD]423115000001[/TD]
[TD]MATERIAL[/TD]
[TD]COTTON[/TD]
[TD]COTN[/TD]
[/TR]
[TR]
[TD]423115000001[/TD]
[TD]WEIGHT[/TD]
[TD]100 GM[/TD]
[TD]100GM[/TD]
[/TR]
[TR]
[TD]423115000001[/TD]
[TD]DIMENSION[/TD]
[TD]--[/TD]
[TD]--[/TD]
[/TR]
[TR]
[TD]423115000001[/TD]
[TD]ADDITIONAL INFORMATION[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]



Thanks

Sachin
 
Upvote 0
OK - I think I got it now.
First - a few assumptions:
- you data is coherent - structured the same way all the way down
- The data is on "Sheet1" and starts from cell A1 (the value in it is "Code" - the header)
I assume your data, including the Headers, occupies the range A1:P3000 (or P10000 - doesn't really matter how long is the list)
- The product codes are unique (or at least you don't have identical codes for different products immediately one after the other)

That said, the directions:
- go to "sheet2" or any other
- put the Headers on row 4 (A4-> Code, B4 ->Attribute, C4-> ATT_VALUE, D4-> ABB_VALUE)
- put the following formula in cell A5:
=INDIRECT("'Sheet1'!A"&TRUNC(ROW()/5)+1)

- put the following formula in cells B5, C5, D5:
=INDIRECT("'Sheet1'!R"&TRUNC(ROW()/5)+1&"C"&(COUNTIF($A1:$A5,$A5)-1)*3+COLUMN(),FALSE)

- now multiply (FillDown) the range A5:D5 for about 15 000 rows

Hope this helps
 
Upvote 0
Hi Bobsan42,

Thanks for the help it worked for me.
I modifed it as below for my requirements cause i had more columns
=INDIRECT("'Sheet1'!A"&TRUNC(ROW()/12)+1)
=INDIRECT("'Sheet1'!R"&TRUNC(ROW()/12)+1&"C"&(COUNTIF($A1:$A12,$A12)-1)*3+COLUMN(),FALSE)

Thanks

Sachin
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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