A camera to follow a player smoothly for a side-scrolling platformer can be done in one event using:
Set Scroll X - lerp(scrollX,playerobject.X,0.2) This will give you a smooth horizontal scroll using linear interpolation. You can adjust the speed by tweaking the 3rd number to a value between 0 and 1.
For more than one player I have attached an example that, as you mentioned, finds the midpoint between the first and last player and then applies the same logic as the single player scroll. There are blocking objects placed at the left and right edges of the viewport to prevent a player from disappearing off-screen.
The method also encourages moving right as the farthest right player will move the camera up until the point that the farthest left player is touching the screen edge. If the farthest left player then moves right, the camera will continue to move forward until it reaches its intended position.
I have included a method for using families (if you have a license) and for not using families.
Let me know if you have any questions :)
1drv.ms/u/s!AkmrWgxeuxlKhIc3pPm0W1AeqXZWZA