• 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.

Create single list from multiple worksheets

jb

Member
Hello Helpers,
I have multiple sheets each having 3 types of list. Refer Group_1, Group_2 and Group_3 sample sheets of testing excel file attached here.

Row number 1 to 10 is reserved for CEO position entry. Row 1 is title and 2 to 10 is for names.
Row number 11 to 20 is reserved for Secretary position entry. Row 11 is title and 12 to 20 is for names.
Row number 21 to 100 is reserved for Member position entry. Row 21 is title and 22 to 100 is for names.

Now, I want to automatically generate consolidated sheet as per the format given in "Consolidated" sheet. I have typed manually.
But actually, data in group sheets keeps on changing. So every time manually generating consolidated sheet is very tedious task.

Kindly help. Formula based answer would be fine. If not possible, VBA will also do.

Thanks.
 

Attachments

  • testing.xlsx
    18.6 KB · Views: 11
Here is a VBA solution. I opened a blank excel sheet and then imported the file into PQ. Be sure to change the path to reflect where your file is located.

Code:
let
    Source = Excel.Workbook(File.Contents("C:\Users\alans\Downloads\testing.xlsx"), null, true),
    #"Expanded Data" = Table.ExpandTableColumn(Source, "Data", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7"}, {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Data",{"Column1"}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Columns", [PromoteAllScalars=true]),
    #"Renamed Columns" = Table.RenameColumns(#"Promoted Headers",{{"Group_1", "Group"}, {"Column2", "Position"}, {"CEO", "Name"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([Position] <> null) and ([Group] <> "consolidated"))
in
    #"Filtered Rows"
 
Academic only, single cell formula in cell J2:
80664
or shorter:
Code:
=LET(a,VSTACK(Group_1:Group_3!A1:H30),FILTER(IF(a="","",a),INDEX(a,,3)<>""))
 

Attachments

  • Chandoo48722testing.xlsx
    20.7 KB · Views: 12
Last edited:
Back
Top