Transposing/Index & Matching? Data from Rows to Columns

FuriousD

New Member
Joined
Sep 1, 2016
Messages
35
Office Version
  1. 365
Platform
  1. MacOS
I'd like to use Index/Match or something similar to fix how a report runs for me. I have duplicate data in columns (req number) but unique data associated with it (Approver). How would I accomplish this so I can have each approver in a separate column. I've tried to transpose, but it doesn't give the results in a functional way.

Example - How it is currently formatted

[TABLE="width: 500"]
<tbody>[TR]
[TD]Req Number[/TD]
[TD]Approver Name[/TD]
[/TR]
[TR]
[TD]123
[/TD]
[TD]MacGuyver[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]BA Barakus[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]AC Slater[/TD]
[/TR]
[TR]
[TD]321[/TD]
[TD]Zach Morris[/TD]
[/TR]
[TR]
[TD]321[/TD]
[TD]Kelly Kapowski[/TD]
[/TR]
</tbody>[/TABLE]

How I need it formatted:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Req[/TD]
[TD]Approver[/TD]
[TD]Approver[/TD]
[TD]Approver[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]MacGuyver[/TD]
[TD]BA Barakus[/TD]
[TD]AC Slater[/TD]
[/TR]
[TR]
[TD]321[/TD]
[TD]Zach Morris[/TD]
[TD]Kelly Kapowski[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


TIA
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Excel 2010
ABCD
1Req NumberApprover Name
2123MacGuyver
3123BA Barakus
4123AC Slater
5321Zach Morris
6321Kelly Kapowski
7
8
9ReqApproverApproverApprover
10123MacGuyverBA BarakusAC Slater
11321Zach MorrisKelly Kapowski 
Sheet4
Cell Formulas
RangeFormula
B10{=IF(COLUMNS($B10:B10)>COUNTIF($A$2:$A$6,$A10),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A10,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B10:B10))))}
B11{=IF(COLUMNS($B11:B11)>COUNTIF($A$2:$A$6,$A11),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A11,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B11:B11))))}
C10{=IF(COLUMNS($B10:C10)>COUNTIF($A$2:$A$6,$A10),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A10,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B10:C10))))}
C11{=IF(COLUMNS($B11:C11)>COUNTIF($A$2:$A$6,$A11),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A11,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B11:C11))))}
D10{=IF(COLUMNS($B10:D10)>COUNTIF($A$2:$A$6,$A10),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A10,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B10:D10))))}
D11{=IF(COLUMNS($B11:D11)>COUNTIF($A$2:$A$6,$A11),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A11,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B11:D11))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
You can use formulas to extract the unique values and also to populate the values across:


Book1
ABCD
1Reg NumberApprover Name
2123MacGuyver
3123BA Barakus
4123AC Slater
5321Zach Morris
6321Kelly Kapowski
7
8Req Number
9123MacGuyverBA BarakusAC Slater
10321Zach MorrisKelly Kapowski
Sheet1
Cell Formulas
RangeFormula
A9{=IFERROR(INDEX($A$2:$A$6,MATCH(0,COUNTIF($A$8:$A8,$A$2:$A$6),0)),"")}
B9{=IF($A9="","",IFERROR(INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A9,ROW($A$2:$A$6)-ROW($A$2)+1),COLUMNS($B9:B9))),""))}
Press CTRL+SHIFT+ENTER to enter array formulas.


Copy B9 formula across then copy the entire row down as necessary.

WBD
 
Last edited:
Upvote 0
Oops. That's what happens when you disappear in the middle of answering a question for a coffee break. I wasn't trying to suggest a better answer; they're practically the same anyway!

WBD
 
Upvote 0
THANKS! With some minor modifications to fit my actual spreadsheet, I was able to make this work!

Excel 2010
ABCD
Req NumberApprover Name
MacGuyver
BA Barakus
AC Slater
Zach Morris
Kelly Kapowski
ReqApproverApproverApprover
MacGuyverBA BarakusAC Slater
Zach MorrisKelly Kapowski

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]123[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]123[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]123[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]321[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]321[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"]123[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]321[/TD]

</tbody>
Sheet4

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B10[/TH]
[TD="align: left"]{=IF(COLUMNS($B10:B10)>COUNTIF($A$2:$A$6,$A10),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A10,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B10:B10))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C10[/TH]
[TD="align: left"]{=IF(COLUMNS($B10:C10)>COUNTIF($A$2:$A$6,$A10),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A10,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B10:C10))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D10[/TH]
[TD="align: left"]{=IF(COLUMNS($B10:D10)>COUNTIF($A$2:$A$6,$A10),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A10,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B10:D10))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B11[/TH]
[TD="align: left"]{=IF(COLUMNS($B11:B11)>COUNTIF($A$2:$A$6,$A11),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A11,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B11:B11))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C11[/TH]
[TD="align: left"]{=IF(COLUMNS($B11:C11)>COUNTIF($A$2:$A$6,$A11),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A11,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B11:C11))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D11[/TH]
[TD="align: left"]{=IF(COLUMNS($B11:D11)>COUNTIF($A$2:$A$6,$A11),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=$A11,ROW($B$2:$B$6)-ROW($B$2)+1),COLUMNS($B11:D11))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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