@txnelson is quite right about this. The method I suggested was a lazy option and in hindsight not an approach I would recommend. If you just want a column with correct values you can do a calculation in a loop and not bother with a formula; if the formula is important to you then you need to check that your script has correctly encoded the formula - it's not sufficient for the numbers to appear correct. Script variables will not persist beyond the lifetime of the script, so the formula needs to correctly include column references - this is achieved by using expression-substitution techniques such as the one illustrated by Jim.
... View more