Now I hope you have been exposed to the concept of weighted average;
If not here is a video
Now lets get our data;
Lets call our element x; Let its existence and abundance be divided in 100 parts
so
Total in this isotope is;
Total atomic mass in this isotope is;
Now total number of mass units
But now the total number of parts
So all that's left is the weighted average;