In light of increasing female labor force participation, womens influence in working teams has increasingly received attention. Papers studying endogenously-formed and exogenously-formed teams find different results. I study how the effect of gender composition of teams on performance, working style, and individuals satisfaction differs between endogenous and exogenous teams. I randomly divide a sample of high school students into two groups: I assign students in one group to teams of varying gender composition using random assignment and I allow the students in the other group to form teams freely. I estimate how team performance changes with gender composition for endogenous and exogenous teams.