summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--formula/source/core/resource/core_resource.src12
-rw-r--r--include/formula/compiler.hrc4
-rw-r--r--include/formula/opcode.hxx2
-rw-r--r--sc/inc/helpids.h2
-rw-r--r--sc/qa/unit/ucalc.cxx2
-rw-r--r--sc/source/core/tool/interpr4.cxx6
-rw-r--r--sc/source/core/tool/parclass.cxx2
-rw-r--r--sc/source/filter/excel/xlformula.cxx4
-rw-r--r--sc/source/filter/oox/formulabase.cxx4
-rw-r--r--sc/source/ui/src/scfuncs.src48
10 files changed, 81 insertions, 5 deletions
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index c6aec3ac6c26..3ec56c03bd3b 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -184,6 +184,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
String SC_OPCODE_VAR_A { Text = "VARA" ; };
String SC_OPCODE_VAR_P { Text = "VARP" ; };
String SC_OPCODE_VAR_P_A { Text = "VARPA" ; };
+ String SC_OPCODE_VAR_P_MS { Text = "COM.MICROSOFT.VAR.P" ; };
+ String SC_OPCODE_VAR_S { Text = "COM.MICROSOFT.VAR.S" ; };
String SC_OPCODE_ST_DEV { Text = "STDEV" ; };
String SC_OPCODE_ST_DEV_A { Text = "STDEVA" ; };
String SC_OPCODE_ST_DEV_P { Text = "STDEVP" ; };
@@ -536,6 +538,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
String SC_OPCODE_VAR_A { Text = "VARA" ; };
String SC_OPCODE_VAR_P { Text = "VARP" ; };
String SC_OPCODE_VAR_P_A { Text = "VARPA" ; };
+ String SC_OPCODE_VAR_P_MS { Text = "VAR.P" ; };
+ String SC_OPCODE_VAR_S { Text = "VAR.S" ; };
String SC_OPCODE_ST_DEV { Text = "STDEV" ; };
String SC_OPCODE_ST_DEV_A { Text = "STDEVA" ; };
String SC_OPCODE_ST_DEV_P { Text = "STDEVP" ; };
@@ -1295,6 +1299,14 @@ Resource RID_STRLIST_FUNCTION_NAMES
{
Text [ en-US ] = "VARPA" ;
};
+ String SC_OPCODE_VAR_P_MS
+ {
+ Text [ en-US ] = "VAR.P" ;
+ };
+ String SC_OPCODE_VAR_S
+ {
+ Text [ en-US ] = "VAR.S" ;
+ };
String SC_OPCODE_ST_DEV
{
Text [ en-US ] = "STDEV" ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index bb8090007a8a..b9b4f7a40bb7 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -412,8 +412,10 @@
#define SC_OPCODE_COVARIANCE_P 414
#define SC_OPCODE_ST_DEV_P_MS 415
#define SC_OPCODE_ST_DEV_S 416
+#define SC_OPCODE_VAR_P_MS 417
+#define SC_OPCODE_VAR_S 418
-#define SC_OPCODE_STOP_2_PAR 417 /* last function with two or more parameters' OpCode + 1 */
+#define SC_OPCODE_STOP_2_PAR 419 /* last function with two or more parameters' OpCode + 1 */
#define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR /* last function's OpCode + 1 */
#define SC_OPCODE_LAST_OPCODE_ID (SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 79b229c70755..6dd28d3967ce 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -220,6 +220,8 @@ enum OpCodeEnum
ocISPMT = SC_OPCODE_ISPMT,
ocVar = SC_OPCODE_VAR,
ocVarP = SC_OPCODE_VAR_P,
+ ocVarP_MS = SC_OPCODE_VAR_P_MS,
+ ocVarS = SC_OPCODE_VAR_S,
ocStDev = SC_OPCODE_ST_DEV,
ocStDevP = SC_OPCODE_ST_DEV_P,
ocStDevP_MS = SC_OPCODE_ST_DEV_P_MS,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 30b88997fa61..831e2d9acd3f 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -682,5 +682,7 @@
#define HID_FUNC_COVARIANCE_S "SC_HID_FUNC_COVARIANCE_S"
#define HID_FUNC_ST_DEV_P_MS "SC_HID_FUNC_ST_DEV_P_MS"
#define HID_FUNC_ST_DEV_S "SC_HID_FUNC_ST_DEV_S"
+#define HID_FUNC_VAR_P_MS "SC_HID_FUNC_VAR_P_MS"
+#define HID_FUNC_VAR_S "SC_HID_FUNC_VAR_S"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index db82ac470c43..90af819d6184 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2436,6 +2436,8 @@ void Test::testFunctionLists()
"TRIMMEAN",
"TTEST",
"VAR",
+ "VAR.P",
+ "VAR.S",
"VARA",
"VARP",
"VARPA",
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 1a3e13110f1b..daa66c6e4c17 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4009,9 +4009,11 @@ StackVar ScInterpreter::Interpret()
case ocAverageA : ScAverage( true ); break;
case ocCount : ScCount(); break;
case ocCount2 : ScCount2(); break;
- case ocVar : ScVar( false ); break;
+ case ocVar :
+ case ocVarS : ScVar( false ); break;
case ocVarA : ScVar( true ); break;
- case ocVarP : ScVarP( false ); break;
+ case ocVarP :
+ case ocVarP_MS : ScVarP( false ); break;
case ocVarPA : ScVarP( true ); break;
case ocStDev :
case ocStDevS : ScStDev( false ); break;
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 6b5888dd8f71..7f86e6300fa9 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -189,6 +189,8 @@ const ScParameterClassification::RawData ScParameterClassification::pRawData[] =
{ ocVarA, {{ Reference }, 1 }},
{ ocVarP, {{ Reference }, 1 }},
{ ocVarPA, {{ Reference }, 1 }},
+ { ocVarP_MS, {{ Reference }, 1 }},
+ { ocVarS, {{ Reference }, 1 }},
{ ocVLookup, {{ Value, Reference, Value, Value }, 0 }},
{ ocXor, {{ Reference }, 1 }},
{ ocZTest, {{ Reference, Value, Value }, 0 }},
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index dc87d74403f7..025827f73926 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -410,7 +410,9 @@ static const XclFunctionInfo saFuncTable_2010[] =
EXC_FUNCENTRY_V_VA( ocCovarianceP, 2, 2, 0, "COVARIANCE.P" ),
EXC_FUNCENTRY_V_VA( ocCovarianceS, 2, 2, 0, "COVARIANCE.S" ),
EXC_FUNCENTRY_V_RX( ocStDevP_MS, 1, MX, 0, "STDEV.P" ),
- EXC_FUNCENTRY_V_RX( ocStDevS, 1, MX, 0, "STDEV.S" )
+ EXC_FUNCENTRY_V_RX( ocStDevS, 1, MX, 0, "STDEV.S" ),
+ EXC_FUNCENTRY_V_RX( ocVarP_MS, 1, MX, 0, "VAR.P" ),
+ EXC_FUNCENTRY_V_RX( ocVarS, 1, MX, 0, "VAR.S" )
};
/** Functions new in Excel 2013.
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 09ac0668280f..794deff5d32b 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -749,7 +749,9 @@ static const FunctionData saFuncTable2010[] =
{ "COM.MICROSOFT.COVARIANCE.P", "COVARIANCE.P", NOID, NOID, 2, 2, V, { VA }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.COVARIANCE.S", "COVARIANCE.S", NOID, NOID, 2, 2, V, { VA }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.STDEV.P", "STDEV.P", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW },
- { "COM.MICROSOFT.STDEV.S", "STDEV.S", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW }
+ { "COM.MICROSOFT.STDEV.S", "STDEV.S", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW },
+ { "COM.MICROSOFT.VAR.P", "VAR.P" , NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW },
+ { "COM.MICROSOFT.VAR.S", "VAR.S", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW }
};
/** Functions new in Excel 2013.
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 64d14e332781..b6d157fec096 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -5087,6 +5087,30 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which portray a sample of a population." ;
};
};
+ // -=*# Resource for function VAR.S #*=-
+ Resource SC_OPCODE_VAR_S
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Calculates the variance based on a sample." ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_STATISTIC;
+ U2S( HID_FUNC_VAR_S );
+ VAR_ARGS; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "number " ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which portray a sample of a population." ;
+ };
+ };
// -=*# Resource for function VARIANZ #*=-
Resource SC_OPCODE_VAR_A
{
@@ -5135,6 +5159,30 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which represent a population." ;
};
};
+ // -=*# Resource for function VAR.P #*=-
+ Resource SC_OPCODE_VAR_P_MS
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Calculates variance based on the entire population." ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_STATISTIC;
+ U2S( HID_FUNC_VAR_P_MS );
+ VAR_ARGS; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "number " ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which represent a population." ;
+ };
+ };
// -=*# Resource for function VARIANZENA #*=-
Resource SC_OPCODE_VAR_P_A
{