Calculation of the team average MMR is based on the main roster player's ranks. Each rank corresponds to a specific MMR value. The formula for calculating the average MMR of the team:

The sum of MMR for all players in the main roster / Number of players in the main roster

To calculate the MMR of a particular player, the rank of the current season is taken, if the user does not have a rank in the current season, then the rank of the previous season is taken. If the user does not have a rank in the current and previous season, then his MMR = 0 until he gets a rank.