• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

repeat range multiple times

Aleksandar

New Member
I have a problem. In column B is list of 5 products. Is there a way to copy each product and paste 5 times in column D? I will need to know this in future with larger data sets. In file I copied each product and pasted manually but I need this to be automated in future.
 

Attachments

  • problem 1.xlsx
    8.8 KB · Views: 9
Possible alternative with Power Query
Code:
let
  Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
  MakeList = Table.AddColumn(Source, "RepeatValues", each List.Repeat({[Product]},5)),
  RemoveFstCol = Table.RemoveColumns(MakeList,{"Product"}),
  ExpandListAsRows = Table.ExpandListColumn(RemoveFstCol, "RepeatValues")
in
  ExpandListAsRows
 

Attachments

  • RepeatValues.xlsx
    16.9 KB · Views: 4
Back
Top