apply the formulas to all the rows