I use this for 2 column data
Option Explicit
Sub SumUnique()
Dim col As New Collection
Dim Rc As Range, Rf As Range, R As Range
Dim cel As Range
Dim Srce1 As Range, Srce2 As Range, Tgt As Range
Dim Col1 As Long, Col2 As Long, i As Long
Set Srce1 = Application.InputBox("Select cell in Duplicate column", "Select Source", Type:=8)
Set Srce2 = Application.InputBox("Select cell in Value column", "Select Data", Type:=8)
Col1 = Srce1.Column: Col2 = Srce2.Column
Set Tgt = Application.InputBox("Select target cell", "Select Target", Type:=8)
Set Rc = Srce1.EntireColumn.SpecialCells(xlCellTypeConstants)
Set Rf = Srce1.EntireColumn.SpecialCells(xlCellTypeConstants)
Set R = Union(Rc, Rf)
On Error Resume Next
For Each cel In R
col.Add cel, cel
Next
For i = 1 To col.Count
Tgt.Offset(i - 1) = col(i)
Tgt.Offset(i - 1, 1).FormulaR1C1 = "=SUMIF(C" & Col1 & ",RC[-1],C" & Col2 & ")"
Next
Tgt.Offset(col.Count).FormulaR1C1 = "=SUM(C" & Col2 & ")"
Tgt.Offset(col.Count, 1).FormulaR1C1 = "=SUM(R1C:R[-1]C)"
End Sub