0
votes

I have an excel sheet with 300 duplicates. I need the first table to look like second table.

example tables

I don't know how to use vba.

I thought grouping by names in sql could help. I need guidance on how I could do this in excel.

I've tried with a pivot table but it doesn't exactly give me what I want.

Suggestions on how to achieve this would be great.

1

1 Answers

0
votes

This is quick and easy using (Get & Transform Data).

Make sure your source data is formatted as a table, and give the first column the header "Name". Then you can use a query like:

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Attribute]), "Attribute", "Value", List.Sum)
in
    #"Pivoted Column"

EDIT Here's a a worked example, using your data: https://excel.solutions/53186328/