Spreadsheet: wrong value from formula