Calculation only works when all fields populated