Add a header above the data, then use a Pivot table.
Execute the macro below in your sample file.
Andreas.
Sub Test()
Range("A1").EntireRow.Insert
Range("A1") = "Date"
Range("B1") = "Name"
Range("C1") = "Days"
Range("D1") = "Remain"
ActiveSheet.ListObjects.Add(xlSrcRange, Range("A1").CurrentRegion, , xlYes).Name = "MyTable"
Range("MyTable[Days]").Replace What:=" Days", Replacement:=""
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="MyTable").CreatePivotTable _
TableDestination:=Range("A25").Address(ReferenceStyle:=xlR1C1), TableName:="MyPivot"
With ActiveSheet.PivotTables("MyPivot")
With .PivotFields("Name")
.Orientation = xlColumnField
.Position = 1
End With
.AddDataField .PivotFields("Days"), "Sum of Days", xlSum
.AddDataField .PivotFields("Remain"), "Sum of Remain", xlSum
With .DataPivotField
.Orientation = xlRowField
.Position = 1
End With
With .PivotFields("Date")
.Orientation = xlPageField
.Position = 1
End With
End With
End Sub