summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2018-10-03 18:10:49 +0900
committerEike Rathke <erack@redhat.com>2018-10-15 13:37:42 +0200
commite785c027af8d26b78211b0caa740bae7c0384d3a (patch)
tree6902a03d5609c2cdab0cf9b2e05cf507fd93cc27 /sc
parent0ed250a9ac4f278ce9ecf12fe1fc9e0c7142fbe4 (diff)
sc: Make KURT() return #DIV/0! when <4 arguments are given
as Excel does: <https://support.office.com/en-us/article/kurt-function-bc3a265c-5da4-4dcb-b7fd-c237789095ab> Change-Id: I1059e6e5dd9f01688219492e76af6dbbe97be41a Reviewed-on: https://gerrit.libreoffice.org/61286 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/functions/statistical/fods/kurt.fods8
-rw-r--r--sc/source/core/tool/interpr3.cxx4
2 files changed, 7 insertions, 5 deletions
diff --git a/sc/qa/unit/data/functions/statistical/fods/kurt.fods b/sc/qa/unit/data/functions/statistical/fods/kurt.fods
index 2634ee802da4..c808f9b58b84 100644
--- a/sc/qa/unit/data/functions/statistical/fods/kurt.fods
+++ b/sc/qa/unit/data/functions/statistical/fods/kurt.fods
@@ -4118,12 +4118,12 @@
</table:table-row>
<table:table-row table:style-name="ro9">
<table:table-cell table:formula="of:=KURT([.I1];[.J1];[.J2])" office:value-type="string" office:string-value="" calcext:value-type="error">
- <text:p>#NUM!</text:p>
+ <text:p>#DIV/0!</text:p>
</table:table-cell>
- <table:table-cell office:value-type="string" calcext:value-type="string">
- <text:p>#NUM!</text:p>
+ <table:table-cell table:formula="of:#DIV/0!" office:value-type="string" office:string-value="" calcext:value-type="error">
+ <text:p>#DIV/0!</text:p>
</table:table-cell>
- <table:table-cell table:style-name="ce15" table:formula="of:=ISERROR([.A13])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
+ <table:table-cell table:style-name="ce15" table:formula="of:=ERROR.TYPE([.A13])=2" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
<text:p>TRUE</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce21" table:formula="of:=FORMULA([.A13])" office:value-type="string" office:string-value="=KURT(I1,J1,J2)" calcext:value-type="string">
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 02242d9745bc..ed2dc48f8f7c 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2868,8 +2868,10 @@ void ScInterpreter::ScKurt()
if ( !CalculateSkew(fSum,fCount,vSum,values) )
return;
- if (fCount == 0.0)
+ // ODF 1.2 constraints: # of numbers >= 4
+ if (fCount < 4.0)
{
+ // for interoperability with Excel
PushError( FormulaError::DivisionByZero);
return;
}