将工作表中每行的第5个值转换为另一个工作表中的列

时间:2018-06-08 12:46:51

标签: xml excel indexing offset worksheet

学徒表示例:

Apprentice Sheet Example

摘要表示例:

Summary Sheet Example

我正在尝试从连续的学徒表中获取信息(从B3的起始单元格的每第4列开始)并将其转置到我的摘要表中。理想情况下,学徒表中的信息(分类和费率)应总结为摘要表中的相应列。

我尝试过OFFSET和INDEX函数,但我只返回一个值或错误的值。

2 个答案:

答案 0 :(得分:0)

类似这样的内容,在Power Query中:

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Removed Columns" = Table.RemoveColumns(#"Transposed Table",{"Column2"}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Removed Columns", [PromoteAllScalars=true]),
    #"Renamed Columns" = Table.RenameColumns(#"Promoted Headers",{{"Column1", "Name"}, {"Column2", "Class"}, {"Column3", "Type"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each [Type] <> null and [Type] <> ""),
    #"Filled Down" = Table.FillDown(#"Filtered Rows",{"Name"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Filled Down", {"Name", "Class", "Type"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Type]), "Type", "Value", List.Sum),
    #"Filtered Rows1" = Table.SelectRows(#"Pivoted Column", each ([Attribute] = "Base Rate Payroll"))
in
    #"Filtered Rows1"

答案 1 :(得分:0)

没有理由INDEX不起作用。如果“Dennis Akin”在Apprentice工作表的B3中,并且您希望在摘要工作表的B3中使用“Dennis Akin”,请在摘要工作表中使用这些公式:

EMP NAME:

=INDEX(Apprentice!$B$3:$U$8,1,(ROW()-ROW($B$3))*4+1)

CLASS:

=INDEX(Apprentice!$B$3:$U$8,3,(ROW()-ROW($B$3))*4+1)

ST

=INDEX(Apprentice!$B$3:$U$8,5,(ROW()-ROW($B$3))*4+1)

OT:

=INDEX(Apprentice!$B$3:$U$8,5,(ROW()-ROW($B$3))*4+2)

DT:

=INDEX(Apprentice!$B$3:$U$8,5,(ROW()-ROW($B$3))*4+3)