Index / Match - convert data in rows to data in columns

HughT

Board Regular
Joined
Jan 6, 2012
Messages
113
Office Version
  1. 365
Platform
  1. Windows
A colleague has created a table with data headers in alternate rows. I need to convert this to data in separate columns to create a chart. So data is in alternate rows Fred/Dave Fred/Dave Fred/Dave etc. I need to extract the data into a column for Fred and a column for Dave. So in effect a formula to do a copy - paste/transpose. Many thanks.

From this:To This:
FredDaveFredDaveFredDaveFredDave
Fred7712154694739
Dave12
Fred15
Dave4
Fred69
Dave47
Fred3
Dave9
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi HughT,

You could select cells A3 to B10 then in the formula entry type =TRANSPOSE(C2:J3) using Ctrl-Shift-Enter as it's an array formula.

Book1
ABCDEFGHIJ
1From this:To This:
2FredDaveFredDaveFredDaveFredDave
3Fred7712154694739
4Dave12
5Fred15
6Dave4
7Fred69
8Dave47
9Fred3
10Dave9
Sheet1
Cell Formulas
RangeFormula
A3:B10A3=TRANSPOSE(C2:J3)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Use this formula at first cell and Press ALT+CTRL+ENTER and then drag it right and down
Book1
ABCDEF
1FredDave
2Fred5512
3Dave121519
4Fred15915
5Dave192020
6Fred91212
7Dave15115
8Fred20  
9Dave20  
10Fred12  
11Dave12  
12Fred11  
13Dave5  
14
Sheet1
Cell Formulas
RangeFormula
D2:E13D2=IFERROR(INDEX($B$2:$B$13,SMALL(IF($A$2:$A$13=D$1,ROW($A$2:$A$13)-ROW(INDEX($A$2:$A$13,1,1))+1),ROWS($D$1:D1))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
...or if you don't want to use an array formula:

HughT.xlsx
ABCDEFGHIJ
1From this:To This:
2FredDaveFredDaveFredDaveFredDave
3Fred7712154694739
4Dave12
5Fred15
6Dave4
7Fred69
8Dave47
9Fred3
10Dave9
Sheet1 (2)
Cell Formulas
RangeFormula
A3:A10A3=IFERROR(INDEX($C$2:$ZZ$2,AGGREGATE(15,6,COLUMN($C$2:$ZZ$2)-COLUMN($B$1)/($C$2:$ZZ$2<>""),ROW()-ROW($A$2))),"")
B3:B10B3=IFERROR(INDEX($C$3:$ZZ$3,AGGREGATE(15,6,COLUMN($C$2:$ZZ$2)-COLUMN($B$1)/($C$2:$ZZ$2<>""),ROW()-ROW($A$2))),"")
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,040
Members
449,063
Latest member
ak94

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