Minor fixes

Script no longer updates the formula if it's already correct for each entry. (Speeds up formula 2x).
Fixed issue where it missed the final row.