Excel Re-arranging data - row to column

gituncar

New Member
Joined
Mar 28, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi, I have this data on excel

SCALE_NOSCALE_NAMESIZ
1​
DUAL3942
1​
DUAL4346
1​
DUALL/XL
1​
DUALM/L
1​
DUALS/M
1​
DUALXS/S
2​
ONE SIZEO/S
3​
TALLAL
3​
TALLAM
3​
TALLAS
3​
TALLAXL
3​
TALLAXS
3​
TALLAXXL
3​
TALLAXXS


if possible rearrange with some steps like that
SCALE_NOSCALE_NAMESIZ
1​
DUAL39424346L/XLM/LS/MXS/S
2​
ONE SIZEO/S
3​
TALLALMSXLXSXXLXXS
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
you can try Power Query
SCALE_NOSCALE_NAMESIZSCALE_NOSCALE_NAMESIZ.1SIZ.2SIZ.3SIZ.4SIZ.5SIZ.6SIZ.7
1DUAL39421DUAL39424346L/XLM/LS/MXS/S
1DUAL43462ONE SIZEO/S
1DUALL/XL3TALLALMSXLXSXXLXXS
1DUALM/L
1DUALS/M
1DUALXS/S
2ONE SIZEO/S
3TALLAL
3TALLAM
3TALLAS
3TALLAXL
3TALLAXS
3TALLAXXL
3TALLAXXS

Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"SCALE_NO", "SCALE_NAME"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "SIZ", each [Count][SIZ]),
    Extract = Table.TransformColumns(List, {"SIZ", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    Split = Table.SplitColumn(Extract, "SIZ", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"SIZ.1", "SIZ.2", "SIZ.3", "SIZ.4", "SIZ.5", "SIZ.6", "SIZ.7"})
in
    Split
 
Upvote 0
How about
VBA Code:
Sub gituncar()
   Dim Cl As Range
   
   With CreateObject("scripting.dictionary")
      For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
         If Not .Exists(Cl.Value) Then
            .Add Cl.Value, Cl.Offset(, 1).Value & "|" & Cl.Offset(, 2).Value & "|"
         Else
            .Item(Cl.Value) = .Item(Cl.Value) & Cl.Offset(, 2).Value & "|"
         End If
      Next Cl
      Range("E2").Resize(.Count, 2).Value = Application.Transpose(Array(.Keys, .items))
      Range("F2", Range("F" & Rows.Count).End(xlUp)).TextToColumns Range("F2"), xlDelimited, , , 0, 0, 0, 0, 1, "|"
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,913
Members
449,093
Latest member
dbomb1414

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