excel_learnerz

Board Regular
Joined
Dec 12, 2018
Messages
73
Hey guys,

so basically I have a list on the left of companys (company a, company b as example) and list of products for each company (P1, P2, P3) and the revenue
Now I need something like the right hand side where all the products for each company are in a single cell (or even how to have them horizontally and I can concatenate them after) I can use a subtotal on the revenue anyway so I know how to do that bit,

Would anyone know how to get the products horizontally, my list is several thousand lines long,
Thanks in advance,


NameProductRevenueNameAll productsTotal Revenue
Company AP1200Company A P1, P2, P3600
Company AP2100Company B P1, P2, P31200
Company AP3300
Company BP1100
Company BP2800
Company BP3300

<colgroup><col><col span="3"><col><col><col></colgroup><tbody>
</tbody>


<colgroup><col></colgroup><tbody>
</tbody>

<colgroup><col></colgroup><tbody>
</tbody>
<strike></strike>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Re: Help with company name list

try this


Book1
ABCDEFGHIJ
1NameProductRevenueNameAll products
2Company AP1200Company AP1P2P3P4
3Company AP2100Company BP1P2P3
4Company AP3300
5Company BP1100
6Company BP2800
7Company BP3300
8Company AP4300
Sheet4
Cell Formulas
RangeFormula
F2{=IFERROR(INDEX($B$2:$B$8,SMALL(IF($A$2:$A$8=$E2,ROW($A$2:$A$8)-ROW($B$1)),COLUMN(F$1)-COLUMN($E$1))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Re: Help with company name list

you can try PowerQuery (Get&Transform)

NameProductRevenueNameAll ProductsTotal Revenue
Company AP1
200​
Company AP1, P2, P3
600​
Company AP2
100​
Company BP1, P2, P3
1200​
Company AP3
300​
Company BP1
100​
Company BP2
800​
Company BP3
300​

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Group = Table.Group(Source, {"Name"}, {{"Count", each _, type table}, {"Total Revenue", each List.Sum([Revenue]), type number}}),
    List = Table.AddColumn(Group, "All Products", each List.Distinct(Table.Column([Count],"Product"))),
    Extract = Table.TransformColumns(List, {"All Products", each Text.Combine(List.Transform(_, Text.From), ", "), type text}),
    Reorder = Table.ReorderColumns(Extract,{"Name", "Count", "All Products", "Total Revenue"})
in
    Reorder[/SIZE]
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

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