Let the total number of people at the stadium be represented by \( x \).
According to the problem, 20% of the fans in attendance are teenagers. This can be expressed mathematically as:
\[ 0.2x = 40 \]
To find \( x \), we need to solve the equation. We do this by dividing both sides by 0.2:
\[ x = \frac{40}{0.2} \]
Calculating the right side:
\[ x = 40 \div 0.2 = 40 \times 5 = 200 \]
Therefore, the total number of people at the stadium is
\[ \boxed{200} \]