The atomic weight of an element depends on the abundance of its isotopes. If you know the mass of the isotopes and the fractional abundance of the isotopes, you can calculate the element's atomic weight. The atomic weight is calculated by adding the mass of each isotope multiplied by its fractional abundance. For example, for an element with 2 isotopes:
atomic weight = massa x fracta + massb x fractb
If there were three isotopes, you would add a 'c' entry. If there were four isotopes, you'd add a 'd', etc.
If chlorine has two naturally-occurring isotopes where:
Cl-35 mass is 34.968852 and fract is 0.7577
Cl-37 mass is 36.965303 and fract is 0.2423
atomic weight = massa x fracta + massb x fracb
atomic weight = 34.968852 x 0.7577 + 36.965303 x 0.2423
atomic weight = 26.496 amu + 8.9566 amu
atomic weight = 35.45 amu
The sum of the fractional abundance values must equal 1.
Be sure to use the mass or weight of each isotope and not its mass number.