Bonsoir,
Une solution avec Power Query :
let
Source = Excel.CurrentWorkbook(){[Name = "DonneesDepart"]}[Content],
Type = Table.TransformColumnTypes(
Source,
{{"Matricule", Int64.Type}, {"Nom", type text}, {"Date", type date}}
),
Tri = Table.Sort(Type, {{"Matricule", Order.Ascending}, {"Date", Order.Ascending}}),
Index = Table.AddIndexColumn(Tri, "Index", 0, 1, Int64.Type),
Groups = Table.AddColumn(Index, "Groups", each Number.From([Date]) - [Index]),
Groupage = Table.Group(
Groups,
{"Matricule", "Groups"},
{
{"DateDébut", each List.Min([Date]), type nullable date},
{"DateFin", each List.Max([Date]), type nullable date}
}
),
SupprCol = Table.RemoveColumns(Groupage, {"Groups"})
in
SupprCol
A+