Recent

Author Topic: frspread - formula  (Read 1061 times)

kjteng

  • Full Member
  • ***
  • Posts: 161
frspread - formula
« on: February 25, 2019, 07:30:30 am »
In Excel, A1+A2+A3+A4+A5 will return #value if one of these cell contains non numeric data.
fpspread seems to behave differently and only give #value when the last cell is not numeric? 


kjteng

  • Full Member
  • ***
  • Posts: 161
Re: frspread - formula
« Reply #1 on: February 25, 2019, 07:33:13 am »
attached excel file

wp

  • Hero Member
  • *****
  • Posts: 6158
Re: frspread - formula
« Reply #2 on: February 25, 2019, 09:39:07 am »
They are pretty inconsistent because SUM(C2:C6) does not yield the #VALUE error value, but simply ignores the non-numeric cells, i.e. adds them as being 0.

The real problem for fpspreadsheet I think is that, even when C2+C3+C4+C5+C6 were allowed to ignore the non-numeric cells, the sum is not correct: cell C7 should show 14, but not 12! I'll have a look.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

wp

  • Hero Member
  • *****
  • Posts: 6158
Re: frspread - formula
« Reply #3 on: February 26, 2019, 10:05:35 am »
Should be fixed in the current revision 6019 in fpspreadsheet-svn.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

kjteng

  • Full Member
  • ***
  • Posts: 161
Re: frspread - formula
« Reply #4 on: February 26, 2019, 10:59:54 am »
Yeap. Download and tested. TQ.