Sub Rearrange()
Dim d As Object
Dim a As Variant
Dim i As Long
Dim s As String
Set d = CreateObject("Scripting.Dictionary")
a = Range("A2", Range("E" & Rows.Count).End(xlUp)).Value
For i = 1 To UBound(a)
s = Join(Application.Index(a, i, Array(1, 2, 3)), ";") & ";"
If Not d.exists(s) Then d(s) = s & ";0"
d(s) = s & Split(d(s), ";")(3) & "," & a(i, 4) & ";" & (Split(d(s), ";")(4) + a(i, 5))
Next i
Application.ScreenUpdating = False
With Range("G2").Resize(d.Count)
.Value = Application.Transpose(d.items)
.TextToColumns DataType:=xlDelimited, Semicolon:=True, Comma:=False, Space:=False
.Offset(, 3).TextToColumns DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 9), Array(1, 1))
.CurrentRegion.Columns.AutoFit
End With
Application.ScreenUpdating = True
End Sub