Group by id using Query function
Sigma BarGoogle Sheets

How to Group Data in Google Sheets, Using QUERY

The QUERY function, groups data based on unique combinations of Employee ID, Name, Rank, and Gender, eliminating duplicate entries and consolidating results for the same employees.