Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-270

error evaluating some statistical formulas

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.0.0
    • 2.5.0, 3.0.0 RC
    • ZSS Component

      problem description:

      error evaluating formulas:
      AVERAGEIF, AVERAGEIFS

      java.lang.AssertionError: =AVERAGEIF(B12:E12,"<23000") failed, at row 11 in xsheet: formula-statistical
      Expected: "14000"
           but: was "Error evaluating cell 'formula-statistical'!B11"
      
      

      Exception stack trace:

       >>org.zkoss.poi.ss.formula.eval.NotImplementedException: Error evaluating cell 'formula-statistical'!B11
      >>org.zkoss.poi.ss.formula.eval.NotImplementedException: AVERAGEIF
      >>	at org.zkoss.poi.ss.formula.atp.AnalysisToolPak$NotImplemented.evaluate(AnalysisToolPak.java:40)
      >>	at org.zkoss.poi.ss.formula.UserDefinedFunction.evaluate(UserDefinedFunction.java:65)
      >>	at org.zkoss.poi.ss.formula.OperationEvaluatorFactory.evaluate(OperationEvaluatorFactory.java:129)
      >>	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:539)
      >>	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:316)
      >>	at org.zkoss.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:255)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluateFormulaCellValue(XSSFFormulaEvaluator.java:266)
      >>	at org.zkoss.poi.xssf.usermodel.XSSFFormulaEvaluator.evaluate(XSSFFormulaEvaluator.java:119)
      >>	at org.zkoss.zss.model.sys.impl.BookHelper.evaluate(BookHelper.java:476)
      >>	at org.zkoss.zss.model.sys.impl.BookHelper.getFormatText(BookHelper.java:1018)
      >>	at org.zkoss.zss.ui.impl.XUtils.getFormatText(XUtils.java:355)
      >>	at org.zkoss.zss.ui.impl.CellFormatHelper.getHtmlStyle(CellFormatHelper.java:89)
      >>	at org.zkoss.zss.ui.Spreadsheet$ExtraCtrl.getCellAttr(Spreadsheet.java:3066)
      >>	at org.zkoss.zss.ui.Spreadsheet$ExtraCtrl.getRangeAttrs(Spreadsheet.java:2940)
      >>	at org.zkoss.zss.ui.Spreadsheet.updateSheetAttributes(Spreadsheet.java:859)
      >>	at org.zkoss.zss.ui.Spreadsheet.setSelectedSheetDirectly(Spreadsheet.java:798)
      >>	at org.zkoss.zss.ui.Spreadsheet.access$40(Spreadsheet.java:776)
      >>	at org.zkoss.zss.ui.Spreadsheet$ExtraCtrl.setSelectedSheetDirectly(Spreadsheet.java:3520)
      >>	at org.zkoss.zss.ui.au.in.SelectSheetCommand.process(SelectSheetCommand.java:87)
      >>	at org.zkoss.zss.ui.Spreadsheet.service(Spreadsheet.java:4721)
      
      

      not found formula:
      BETADIST, BETAINV, CHITEST, CONFIDENCE, CORREL, COVAR, CRITBINOM, FISHER, FISHERINV, FORECAST, FREQUENCY, FTEST, GROWTH, INTERCEPT, LINEST, LOGINV, LOGNORMDIST, NEGBINOMDIST, NORMINV, NORMSDIST, NORMSINV, PEARSON, PERCENTILE, PERCENTRANK, PERMUT, PROB, QUARTILE, RSQ, STANDARDIZE, STDEVA, STDEVPA, STEYX, TREND, TRIMMEAN, TTEST, VARA, VARPA, ZTEST

      wrong evaluation result:
      FDIST, FINV, GAMMADIST, HARMEAN, STDEVP,TDIST , TINV

      java.lang.AssertionError: =FDIST(15.2068,6,4) failed, at row 59 in xsheet: formula-statistical
      Expected: "0.01"
           but: was "0.99"
      
      java.lang.AssertionError: =FINV(0.01,6,4) failed, at row 61 in xsheet: formula-statistical
      Expected: "15.21"
           but: was "0.11"
      
      java.lang.AssertionError: =GAMMADIST(10,9,2,FALSE) failed, at row 76 in xsheet: formula-statistical
      Expected: "0.03"
           but: was "-1.00"
      
      java.lang.AssertionError: =HARMEAN(B90:H90) failed, at row 89 in xsheet: formula-statistical
      Expected: "5.03"
           but: was "0.39"
      
      
      java.lang.AssertionError: =STDEVP(B165:K165) failed, at row 168 in xsheet: formula-statistical
      Expected: "26.05"
           but: was "#NUM!"
      
      java.lang.AssertionError: =TDIST(1.959999,60,2) failed, at row 175 in xsheet: formula-statistical
      Expected: "0.05"
           but: was "0.03"
      
      java.lang.AssertionError: =TINV(0.054644927,60) failed, at row 177 in xsheet: formula-statistical
      Expected: "1.96"
           but: was "1.63"
      	
      

      reproducing steps

      run automatic test case FormulaTest of the project zss.test of zkspreadsheet or attached file

            hawk hawk
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: