The formula mass of a molecule (also known as formula weight) is the sum of the atomic weights of the atoms in the empirical formula of the compound. Formula weight is given in atomic mass units .
NaCl is just the formula that is used to represent sodium chloride though it is not a molecule
.In such compounds, the formula (i.e., NaCl) is used to calculate the formula mass instead of molecular mass.
e.g. Formula mass of sodium chloride = atomic mass of sodium + atomic mass of chlorineatomic mass of chlorine
= 23.0 u + 35.5 u = 58.5 u