A study of the impact of team-based learning (TBL), an active learning teaching strategy developed by Larry Michaelsen of the University of Oklahoma, was conducted to determine the impact of TBL on students in introductory and upper-level physics courses. The study was designed to use institutional data to determine whether TBL increase retention of physics majors. A survey, the physics TBL survey (PTS), was developed and used to understand student experiences with TBL in the classroom. We found that TBL increased retention of physics majors overall and specifically in the critical freshmen and sophomore years. The results from the study show that students value TBL favorably for both introductory and upper-level physics courses over 8 different measures. Introductory students ranked the learning of physics, the effectiveness of the TBL format for physics courses, and the value of the team experience higher than the upper-level physics students. Finally, students indicate that TBL is a less intimidating classroom format, they appreciate instant feedback because it helps them to learn more quickly and keeps them engaged in class, they find peer explanations of new physics topics to be valuable, and they are find that the readiness assurance process keeps them motivated and accountable.