Transpose and Index

jpsocal

New Member
Joined
May 31, 2013
Messages
3
I have a table with thousands of base items and each one comes in multiple colors. I need to have the vertical list turned into horizontal layout and ordered by base item followed by the colors - one in each column. Tried it with match, index, hlookup and mixtures of it, but could not get all the variables out of it to have the wished result as here bellow.

Original Data -->Wished Result with the colours in columns and the base porduct in new rows
Product ProductColor 1Color 2Color 3
123456black123456blackwhiteorange
123456white987654blackgreen
123456orange147258whiteblack
987654black
987654green
147258white
147258black

<tbody>
</tbody>

Thank you for your help!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,

A few questions at the beginning:

1) How many colors can there be for a single product?
2) Is the initial data sorted by product number?
3) As far as I can see, you do not insist that the same color is always in the same column - please confirm

Best,

J.Ty.
 
Upvote 0
Hi J.Ty.,

Thank you for your answer.

To your question there can be up to 8 colors for each base products in my list.
The initial data is sorted by base product and then in each row following a color if available, plase see here an example spreeadsheet:
https://docs.google.com/spreadsheet/ccc?key=0Apc01y9ZibTDdGpLZUY5cnF4SXBZeXo5R2JaUFFzLWc#gid=0
No the colors do not need to be in the same column in the wished result. I only need to know for each base products what colors are vailable and this in one row.

Cheers


 
Upvote 0
Here is the manual of use of the solution below:

0) Copy and paste your initial data below the "Product" header
1) Mark this column and choose Data->Remove duplicates from the ribbon (Excel will ask if you want to extend this range - keep it unchanged).
2) Mark cell E13 and fill to the right creating as many additional columns as necessary - as per your information 8 should suffice.
3) Mark the cells from the first row below the headers and fill down for the whole length of data in column D.
4) You may want to copy those cells with information about colors and paste "as values" in the same location (this removes the formulas, keeping the data).

J.Ty.


Book1
ABCDEFGHIJK
1Original DataWished Result with the colours in columns
2
3ProductColours-->ProductColor 1Color 2Color 3Color 4Color 5Color 6Color 7
4123456black123456blackwhiteorange
5123456white987654green flashwhite
6123456orange147258whitegrey
7987654black369852bluegreen flashatomic orangeredblackwhiterose
8987654green flash
9147258white
10147258greyComputed result
11369852blue
12369852green flashProductColor 1Color 2Color 3Color 4Color 5Color 6Color 7
13369852atomic orange123456black
14369852red987654
15369852black147258
16369852white369852
17369852rose
Sheet1
Cell Formulas
RangeFormula
E13=IFERROR(IF(INDEX($A$4:$A$17,MATCH($D13,$A$4:$A$17,0)+COLUMNS($D13:D13)-1)=$D13,INDEX($B$4:$B$17,MATCH($D13,$A$4:$A$17,0)+COLUMNS($D13:D13)-1),""),"")
 
Upvote 0
This is an alternative.

=IFERROR(INDEX($B$2:$B$8,SMALL(IF($A$2:$A$8=$C2,ROW($A$2:$A$8)-ROW($A$2)+1),COLUMNS($D2:D2))),"")
 
Upvote 0
Thank you very much J.Ty. your formula works perfec for my problem!

@Ramanan, I also tried yours but could not get it to work. Thank you though too for your help.


:) Cheers,
Jan
 
Upvote 0
You are welcome!

J.Ty.
 
Upvote 0

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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