Transpose many columns to rows

KirstenNJ

Board Regular
Joined
Sep 19, 2002
Messages
97
Is there a way to transpose many columns to rows? In my screen example I've got the top section but I want it the way it looks in the bottom section.
Thanks,
Kirsten
example for MrExcel.xls
ABCDEF
1Howitlooksnow:
2ChargeStaff/ObjCD2006P12006P22006P32006P4
3P15299.002Doe,John(ForecastHours)1551550150
4P15299.002Doe,John(ActualHours)146108131135
5P15299.002Smith,Scott.(ForecastHours)1601600150
6P15299.002Smith,Scott.(ActualHours)134152134119
7P15299.003Johnson,ValerieC.(ForecastHours)1601600150
8P15299.003Johnson,ValerieC.(ActualHours)134152134119
9
10
11HowIwantittolook:
12PeriodNameChargeForecastedHoursActualHours
132006P1Doe,JohnP15299.002155146
142006P2Doe,JohnP15299.002155108
152006P3Doe,JohnP15299.0020131
162006P4Doe,JohnP15299.002150135
172006P1Smith,ScottP15299.002160134
182006P2Smith,ScottP15299.002160152
192006P3Smith,ScottP15299.0020134
202006P4Smith,ScottP15299.002150119
212006P1Johnson,ValerieC.P15299.003160134
222006P2Johnson,ValerieC.P15299.003160152
232006P3Johnson,ValerieC.P15299.0030134
242006P4Johnson,ValerieC.P15299.003150119
forecast-1
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Assumptions:

1) Each staff member contains two rows worth of data, Forecast and Actual.

2) For each staff member, the charge number for Forecast is the same as the charge number for Actual.

Formulas:

A13, copied down:

=IF(ROWS($A$13:A13)<=ROWS($A$3:$A$8)/2*COLUMNS($C$2:$F$2),INDEX($C$2:$F$2,MOD(ROW(A13)-ROW($A$13),COLUMNS($C$2:$F$2))+1),"")

B13, copied down:

=TRIM(PROPER(SUBSTITUTE(UPPER(INDEX($B$3:$B$8,(INT((ROW()-ROW($D$13))/COLUMNS($C$2:$F$2))+1)*2-2+1)),"(FORECAST HOURS)","")))

C13, copied down:

=INDEX($A$3:$A$8,(INT((ROW()-ROW($D$13))/COLUMNS($C$2:$F$2))+1)*2-2+1)

D13, copied down:

=INDEX($A$3:$F$8,(INT((ROW()-ROW($D$13))/COLUMNS($C$2:$F$2))+1)*2-2+1,MATCH($A13,$A$2:$F$2,0))

E13, copied down:

=INDEX($A$3:$F$8,(INT((ROW()-ROW($D$13))/COLUMNS($C$2:$F$2))+1)*2-2+2,MATCH($A13,$A$2:$F$2,0))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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