Data consolidation with permanent cell and IF statement

dmelnik

New Member
Joined
Apr 27, 2020
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hello,
im having trouble with coming up with a formula for the following case:
We have sheet with data about different products:
ProductQuantityLocation
Product 151-1-1
Product 1101-1-1
Product 151-1-2
Product 2101-1-2
Product 351-1-2
Product 3101-1-3

Our goal is to consolidate the table by Product with suming up the quantities, but keeping the Location information similar to 1-1-1 / 1-1-1 / 1-1-2. So after the require manipulations the table should look like this:
ProductQuantityLocation
Product 1201-1-1 / 1-1-1 / 1-1-2
Product 2101-1-2
Product 3151-1-2 / 1-1-3
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
you can try with Power Query aka Get&Transform
grp.png

Rich (BB code):
// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Quantity", Int64.Type}, {"Location", type text}}),
    Group = Table.Group(Type, {"Product"}, {{"Quantity", each List.Sum([Quantity]), type number}, {"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Location", each [Count][Location]),
    Extract = Table.TransformColumns(List, {"Location", each Text.Combine(List.Transform(_, Text.From), "/"), type text})
in
    Extract
-------------------
more about PowerQuery aka Get&Transform
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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