Extract different values, names and the number from a data table related to different IDs

Hello, everyone,

here’s the problem.

I have the following DataTable.

image

I want to extract the number of users and the name of the trainers for each event (Event ID) and add them to a new Data Table.

The new table should look like this:

Using nested for each and if statments and a counter I tried to extract the different values and add them to the new data table but without success.

Maybe the experts in the forum know how to best achieve this goal.