Align And Append Data

ranjith2523

Board Regular
Joined
Apr 29, 2014
Messages
137
Office Version
  1. 365
Hi Friends,

I need to copy each EX1, EX2, and EX3 value from cells A2, B2, and C2 then I need to transpose and paste it in column F2.

But the issue here is, when I paste I need to replicate the value three times :(.

The below table is just an example with 2 rows, but actually, I have around 500+ rows that I need to copy transpose paste three times in column H.

Please let me know how can we do this using some Excel formula. Any help or advice is much appreciated.


EX1EX2EX3ClientABCORDER
0F88F08F80F8HS
0G88G08G80F8SS
0F8ES
8F0HS
8F0SS
8F0ES
8F8HS
8F8SS
8F8ES
0G8HS
0G8SS
0G8ES
8G0HS
8G0SS
8G0ES
8G8HS
8G8SS
8G8ES
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Book2
ABCDEFG
1EX1EX2EX3ClientValueCustom
20F88F08F80F8HS
30G88G08G80F8SS
40F8ES
58F0HS
68F0SS
78F0ES
88F8HS
98F8SS
108F8ES
110G8HS
120G8SS
130G8ES
148G0HS
158G0SS
168G0ES
178G8HS
188G8SS
198G8ES
Sheet1


With Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}),
    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Custom", each "HS,SS,ES"),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Custom", {{"Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Custom")
in
    #"Split Column by Delimiter"
 
Upvote 0
How about
Excel Formula:
=TOCOL(IF(SEQUENCE(,3),TOCOL(A2:C10,1)))
 
Upvote 0
Hi Fluff., Good to see your response after a long time. As usual, this formula works as expected, and sorry there is one more requirement.

In G Column, need to repeat the values HS SS ES as shown in the initial post table. I tried something like REPT formula but as usual it didn't work out for me :(

Can you please guide me on this.



Material Group 4
HS
SS
ES
HS
SS
ES


Book2
ABCDEFG
1EX1EX2EX3ClientValueCustom
20F88F08F80F8HS
30G88G08G80F8SS
40F8ES
58F0HS
68F0SS
78F0ES
88F8HS
98F8SS
108F8ES
110G8HS
120G8SS
130G8ES
148G0HS
158G0SS
168G0ES
178G8HS
188G8SS
198G8ES
Sheet1


With Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}),
    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Custom", each "HS,SS,ES"),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Custom", {{"Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Custom")
in
    #"Split Column by Delimiter"
 
Upvote 0
Book2
ABCDEFG
1EX1EX2EX3ClientValueCustom
20F88F08F80F8HS
30G88G08G80F8SS
40F8ES
58F0HS
68F0SS
78F0ES
88F8HS
98F8SS
108F8ES
110G8HS
120G8SS
130G8ES
148G0HS
158G0SS
168G0ES
178G8HS
188G8SS
198G8ES
Sheet1


With Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"}),
    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Custom", each "HS,SS,ES"),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Added Custom", {{"Custom", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Custom")
in
    #"Split Column by Delimiter"
Thank you so much for your response and thanks for your effort to find out the solution. Yes, it works as expected.
 
Upvote 0
How about
Excel Formula:
=LET(a,TOCOL(IF(SEQUENCE(,3),TOCOL(A2:C10,1))),HSTACK(a,TOCOL(IF(SEQUENCE(,ROWS(a)/3),{"HS";"SS";"ES"}),,1)))
 
Upvote 0
Solution
How about
Excel Formula:
=LET(a,TOCOL(IF(SEQUENCE(,3),TOCOL(A2:C10,1))),HSTACK(a,TOCOL(IF(SEQUENCE(,ROWS(a)/3),{"HS";"SS";"ES"}),,1)))
OMG !!! Unbelievable, my head is just started rotating after seeing this formula and not sure from where you learned all those things :) Genius..
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,945
Messages
6,175,555
Members
452,652
Latest member
eduedu

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