I would like to customize a table so that it counts the number of times a person's name (or ID since it's unique) appears on the list e.g.
ID Name Dept Dept Name Count
111 John 41 41 John 2
111 John 41 Peter 1
113 Sarah 55 Total: 3
113 Sarah 55
201 Peter 41 49 Mike 2
251 Jack 55 Total: 2
341 Mike 49
341 Mike 49 55 Sarah 2
Jack 1
Total: 3
The list on the left is how it is currently displayed but want to format the table so that it looks like the list on the left where it sort via dept, count the number of times the users appears on the list on the left and have a total per dept.
Can I do this in a DataTable or can I only format it into excel. Which would work better?