Marge rows if specific conditions are met

pitaszek

Board Regular
Joined
Jul 20, 2012
Messages
85
Hi Guys,

It's is hard to describe what I need in subjects title. Maybe let me start with dataset:

PROB000101.02.2019Marco PoloWIPDescription1
PROB000204.05.2018Vaso da BoscoAssignedDescription2
PROB000206.07.2018Marco PoloWIPDescription3
PROB000206.07.2018Katarina ValentinaWIPDescription4
PROB000304.09.2019Louis de PingpongWIPDescription5
PROB000404.01.2018Vaso da BoscoWIPDescription6
PROB000407.03.2018Louis de PingpongAssignedDescription7
PROB000407.03.2018Louis de PingpongWIPDescription8

<tbody>
</tbody>

Ideal expected result:
PROB000101.02.2019Marco PoloWIPDescription1
PROB000204.05.2018Vaso da BoscoAssignedDescription2
PROB000206.07.2018Marco Polo; Katarina ValentinaWIP; WIPDescription3; Description4;
PROB000304.09.2019Louis de PingpongWIPDescription5
PROB000404.01.2018Vaso da BoscoWIPDescription6
PROB000407.03.2018Louis de Pingpong; Louis de PingpongAssigned; WIPDescription7; Description8

<tbody>
</tbody>

If for specific Problem ID the same date appears certain amount of times, it should marge the values for all columns. So first it looks if the problem ID is the same and than looks for dates that occur more then once to merge it.

The wider which I need that for is to create appointments for specific date for specific problem.

Thank you in advance!

Regards,
Witek
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Wouldn't a simple pivot table do this for you?
 
Upvote 0
try PowerQuery

Column1Column2CustomCustom.1Custom.2
PROB0001
01/02/2019​
Marco PoloWIPDescription1
PROB0002
04/05/2018​
Vaso da BoscoAssignedDescription2
PROB0002
06/07/2018​
Marco Polo;Katarina ValentinaWIP;WIPDescription3;Description4
PROB0003
04/09/2019​
Louis de PingpongWIPDescription5
PROB0004
04/01/2018​
Vaso da BoscoWIPDescription6
PROB0004
07/03/2018​
Louis de Pingpong;Louis de PingpongAssigned;WIPDescription7;Description8

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type date}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1", "Column2"}, {{"Count", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.Column([Count],"Column3")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.Column([Count],"Column4")),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.2", each Table.Column([Count],"Column5")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom2", {"Custom", each Text.Combine(List.Transform(_, Text.From), ";"), type text}),
    #"Extracted Values1" = Table.TransformColumns(#"Extracted Values", {"Custom.1", each Text.Combine(List.Transform(_, Text.From), ";"), type text}),
    #"Extracted Values2" = Table.TransformColumns(#"Extracted Values1", {"Custom.2", each Text.Combine(List.Transform(_, Text.From), ";"), type text})
in
    #"Extracted Values2"[/SIZE]
 
Upvote 0

Forum statistics

Threads
1,215,588
Messages
6,125,691
Members
449,250
Latest member
azur3

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