Calculation of mass or volume in a solution