Transposition lookup

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
221
Please help me to bring data from Horizontal array to vertical area.


Horizontal
VolumeProfit
ProductJanFebMarJanFebMar
A1040701205201680
B205080180250720
C306090150180600
Vertical
ProductMonthVolumeProfit
AJan10120
BJan20180
CJan30150
AFeb40520
BFeb50250
CFeb60180
AMar701680
BMar80720
CMar90600
<colgroup><col width="64" style="width: 48pt;" span="8"> <tbody> </tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,424
Office Version
  1. 2019
VBA solution

Code:
Sub k1()
Lastrow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
k = 2
For i = 2 To 4
For j = 4 To Lastrow
k = k + 1
Worksheets("Sheet2").Cells(k, 1) = Worksheets("Sheet1").Cells(j, 1)
Worksheets("Sheet2").Cells(k, 2) = Worksheets("Sheet1").Cells(3, i)
Worksheets("Sheet2").Cells(k, 3) = Worksheets("Sheet1").Cells(j, i)
Worksheets("Sheet2").Cells(k, 4) = Worksheets("Sheet1").Cells(j, i + 4)
Next j
Next i

End Sub

Input on Sheet1 with Horizontal in A1
Output on Sheet2
 

Salamullah

Board Regular
Joined
Mar 28, 2011
Messages
221
Hi Special,

Many thanks and sorry for the late reply I have multi tabs so if excel formula is availble than it will be great !
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,485
Messages
5,831,964
Members
430,098
Latest member
bemmelen

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
Top