SOLVED

Excel data split from multiple column to row

%3CLINGO-SUB%20id%3D%22lingo-sub-2527833%22%20slang%3D%22en-US%22%3EExcel%20data%20split%20from%20multiple%20column%20to%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2527833%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3ECan%20you%20suggest%20how%20I%20can%20move%20data%20from%20multiple%20columns%20to%20rows%20below%20one%20another.%3C%2FP%3E%3CP%3Ebelow%20is%20example%20how%20i%20need%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22Screenshot.JPG%22%20style%3D%22width%3A%20605px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294278i666621ABE4AF1EE9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot.JPG%22%20alt%3D%22sample%20requirement%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Esample%20requirement%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2527833%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2528103%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20data%20split%20from%20multiple%20column%20to%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2528103%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1098609%22%20target%3D%22_blank%22%3E%40Sumit_0505%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlternatively%20with%20Power%20Query.%20Sample%20attached%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2528113%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20data%20split%20from%20multiple%20column%20to%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2528113%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BYou%20are%20correct%20I%20have%20lot%20of%20data%20to%20do%20so%20hence%20need%20something%20which%20will%20make%20it%20easy.%3C%2FP%3E%3CP%3EI%20tried%20formula%20suggested%20however%20something%20is%20not%20correct%20getting%20some%20error%2C%20snapshot%20attached.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot1.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294364iF3EF5B8AE57F70D2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot1.jpg%22%20alt%3D%22Screenshot1.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2528197%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20data%20split%20from%20multiple%20column%20to%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2528197%22%20slang%3D%22en-US%22%3Edo%20you%20have%20latest%20version%20of%20Excel%3F%20Try%20typing%20LET%20and%20see%20if%20Excel%20recognizes%20it.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2528245%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20data%20split%20from%20multiple%20column%20to%20row%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2528245%22%20slang%3D%22en-US%22%3EI%20think%20mine%20version%20is%20not%20latest%2C%20its%20version%202008%20%26amp%3B%20excel%20is%20not%20recognizing%20LET%20%3CLI-EMOJI%20id%3D%22lia_disappointed-face%22%20title%3D%22%3Adisappointed_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi All,

Can you suggest how I can move data from multiple columns to rows below one another.

below is example how i needsample requirementsample requirement

 

16 Replies

@Sumit_0505  If this is a one time thing you can just use the paste options to transpose each row of data.  But I assume this is something you have to do a lot of so you can use this formula:

 

=LET(t,A1:K4,
     c,COLUMNS(t)-1,
     s,SEQUENCE(ROWS(t)*c,,0),
     titles,IF(MOD(s,c),"",INDEX(t,INT(s/c)+1,1)),
     data,INDEX(t,INT(s/c)+1,MOD(s,c)+2),
     CHOOSE({1,2},titles,data)
     )

 

where t is the table of data to convert.  So change A1:K4 to A3:K5 in your sample image assuming the upper left corner with the text "How Data is" is in cell A1

@Sumit_0505 

Alternatively with Power Query. Sample attached

@mtarler You are correct I have lot of data to do so hence need something which will make it easy.

I tried formula suggested however something is not correct getting some error, snapshot attached.Screenshot1.jpg

do you have latest version of Excel? Try typing LET and see if Excel recognizes it.
I think mine version is not latest, its version 2008 & excel is not recognizing LET

@L z. not much familiar with query, can you guide

I have large data in similar form

@Sumit_0505 

I have large data in similar form => PQ well design for this kind of task

not much familiar with query, can you guide:

- Format your range as a Table

- Go to Data tab > From Table/Range (Power Query Editor opens)

- Delete "Change Type" in APPLIED STEPS

- Right-click on column [Resource] > Unpivot Other Columns

- Delete column [Attibute]

- Close & Load (top left of the window)

 

Any problem please attach your workbook

best response confirmed by Sumit_0505 (Occasional Contributor)
Solution

@Sumit_0505 

Here are the formulas in a version you can paste and fill down:

=IF(MOD(ROW()-ROW($D$7),COLUMNS($B$1:$K$4)),"",INDEX($A$1:$A$4,INT((ROW()-ROW($D$7))/COLUMNS($B$1:$K$4))+1,1))
=INDEX($A$1:$K$4,INT((ROW()-ROW($D$7))/COLUMNS($B$1:$K$4))+1,MOD(ROW()-ROW($D$7),COLUMNS($B$1:$K$4))+2)

you can either replace the ranges like $B$1:$K$4 with the correct range in each case or I would recommend replacing it with a named variable (e.g. DATA) then you create in the Name Manager under the Formula menu.  BTW the $D$7 in these formulas are the first cell where the data will go so that ROW()-ROW($D$7) gives you a count.

Thank you!
Thanks for guide it works.
You're welcome. You said "I have lot of data" and finally seem to have opted for a formula solution
Not quite sure what "lot of data" means for you. Anyway, your call
Nice day & Thanks for providing feedback

@L z.  as I said not much use too with PQ.

I tried as per your guide & it's really working well now, thanks again.

 

I just need additional info about PQ, if possible will you help?

what needs to do if I want output like

Capture2.JPG

@mtarler what needs to do if I want output likeCapture2.JPG

@Sumit_0505 

Not quite sure this is doable with the Power Query user interface only or it's going to be complex

 

See attached file with a possible option where I decomposed the steps with hopefully meaningful names

You'll see some steps are very similar. This means the query can we written differently. That would make sense if we were to deal with more than 2 sets of columns (Code, Price) but as you're new to this I kept things "simple"

@Sumit_0505 If you can understand and use PQ as @L z. is helping you with, that is a great skill to have and very powerful and useful.  If you want to modify the equations you just need to modify the ranges they point to.  In attached I change the range for the 1st column to only include the "Code" section to determine the # of rows needed and then the Code and Price columns only point at those regions.