How to count the sum of multiple salaries corresponding to the same ID number in EXCEL?

As shown in the figure:

E2 array formula: = min (if ((countif (e $1:e1,a $2: a $7) = 0) * (a $2: a $7

Function: filter out non-duplicate ids and arrange them in ascending order.

F2 formula: =VLOOKUP(E2, $ a $2: $ c $7,2)

Function: Get the name corresponding to the E column ID.

G2 formula: = sum product (($ a $2: $ a $7 = E2) * ($ c $2: $ c $7))

Function: Summarize all salaries corresponding to E ID column.