Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
c472a511
Commit
c472a511
authored
Jul 03, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add VAR.S formula
parent
d9ebb000
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
18 deletions
+83
-18
cell/model/FormulaObjects/_xlfnFunctions.js
cell/model/FormulaObjects/_xlfnFunctions.js
+2
-14
cell/model/FormulaObjects/statisticalFunctions.js
cell/model/FormulaObjects/statisticalFunctions.js
+81
-4
No files found.
cell/model/FormulaObjects/_xlfnFunctions.js
View file @
c472a511
...
...
@@ -60,7 +60,7 @@
cCOVARIANCE_S
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cHYPGEOM_DIST
,
cMODE_MULT
,
cMODE_SNGL
,
cNEGBINOM_DIST
,
cNORM_DIST
,
cNORM_INV
,
cNORM_S_DIST
,
cNORM_S_INV
,
cPERMUTATIONA
,
cPHI
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
c
VAR_S
,
c
WEIBULL_DIST
,
cZ_TEST
);
cT_TEST
,
cWEIBULL_DIST
,
cZ_TEST
);
cFormulaFunctionGroup
[
'
Financial
'
]
=
cFormulaFunctionGroup
[
'
Financial
'
]
||
[];
cFormulaFunctionGroup
[
'
Financial
'
].
push
(
cPDURATION
,
cRRI
);
cFormulaFunctionGroup
[
'
Mathematic
'
]
=
cFormulaFunctionGroup
[
'
Mathematic
'
]
||
[];
...
...
@@ -76,7 +76,7 @@
cCOVARIANCE_P
,
cCOVARIANCE_S
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cHYPGEOM_DIST
,
cMODE_MULT
,
cMODE_SNGL
,
cNEGBINOM_DIST
,
cNORM_DIST
,
cNORM_INV
,
cNORM_S_DIST
,
cNORM_S_INV
,
cPERMUTATIONA
,
cPHI
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
c
VAR_S
,
c
WEIBULL_DIST
,
cZ_TEST
,
cPDURATION
,
cRRI
,
cAGGREGATE
,
cMUNIT
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
cWEIBULL_DIST
,
cZ_TEST
,
cPDURATION
,
cRRI
,
cAGGREGATE
,
cMUNIT
,
cFORMULATEXT
,
cISFORMULA
,
cSHEET
,
cSHEETS
);
/**
...
...
@@ -619,18 +619,6 @@
cUNICODE
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cUNICODE
.
prototype
.
constructor
=
cUNICODE
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cVAR_S
()
{
cBaseFunction
.
call
(
this
,
"
VAR.S
"
);
this
.
isXLFN
=
true
;
}
cVAR_S
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cVAR_S
.
prototype
.
constructor
=
cVAR_S
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
c472a511
...
...
@@ -69,10 +69,10 @@
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cLINEST
,
cLOGEST
,
cLOGINV
,
cLOGNORM_DIST
,
cLOGNORM_INV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cNEGBINOMDIST
,
cNORMDIST
,
cNORMINV
,
cNORMSDIST
,
cNORMSINV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cPERCENTRANK
,
cPERCENTRANK_EXC
,
cPERCENTRANK_INC
,
cPERMUT
,
cPOISSON
,
cPOISSON_DIST
,
cPROB
,
cQUARTILE
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cRANK
,
cRANK_AVG
,
cRANK_EQ
,
cR
SQ
,
cSKEW
,
cSKEW_P
,
cSLOPE
,
cSMALL
,
cSTANDARDIZE
,
cSTDEV
,
cSTDEVA
,
cSTDEVP
,
cSTDEVPA
,
cSTEYX
,
cTDIST
,
cT_DIST
,
c
T_DIST_2T
,
cT_DIST_RT
,
cT_INV
,
cT_INV_2T
,
cTINV
,
cTREND
,
cTRIMMEAN
,
cTTEST
,
cVAR
,
cVARA
,
cVARP
,
cVAR_P
,
cVARPA
,
cWEIBULL
,
cZTEST
);
cPERCENTRANK_INC
,
cPERMUT
,
cPOISSON
,
cPOISSON_DIST
,
cPROB
,
cQUARTILE
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cRANK
,
cR
ANK_AVG
,
cRANK_EQ
,
cRSQ
,
cSKEW
,
cSKEW_P
,
cSLOPE
,
cSMALL
,
cSTANDARDIZE
,
cSTDEV
,
cSTDEVA
,
cSTDEVP
,
cSTDEVPA
,
c
STEYX
,
cTDIST
,
cT_DIST
,
cT_DIST_2T
,
cT_DIST_RT
,
cT_INV
,
cT_INV_2T
,
cTINV
,
cTREND
,
cTRIMMEAN
,
cTTEST
,
cVAR
,
c
VARA
,
cVARP
,
cVAR_P
,
cVAR_S
,
cVARPA
,
c
WEIBULL
,
cZTEST
);
cFormulaFunctionGroup
[
'
NotRealised
'
]
=
cFormulaFunctionGroup
[
'
NotRealised
'
]
||
[];
cFormulaFunctionGroup
[
'
NotRealised
'
].
push
(
cCHITEST
,
cFTEST
,
cGROWTH
,
cLINEST
,
cLOGEST
,
cTREND
,
...
...
@@ -7289,6 +7289,83 @@
cVAR_P
.
prototype
.
constructor
=
cVAR_P
;
cVAR_P
.
prototype
.
isXLFN
=
true
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cVAR_S
()
{
this
.
name
=
"
VAR.S
"
;
this
.
value
=
null
;
this
.
argumentsCurrent
=
0
;
}
cVAR_S
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cVAR_S
.
prototype
.
constructor
=
cVAR_S
;
cVAR_S
.
prototype
.
argumentsMin
=
1
;
cVAR_S
.
prototype
.
isXLFN
=
true
;
cVAR_S
.
prototype
.
Calculate
=
function
(
arg
)
{
function
_var
(
x
)
{
if
(
x
.
length
<=
1
)
{
return
new
cError
(
cErrorType
.
division_by_zero
);
}
var
tA
=
[],
sumSQRDeltaX
=
0
,
_x
=
0
,
xLength
=
0
,
i
;
for
(
i
=
0
;
i
<
x
.
length
;
i
++
)
{
if
(
cElementType
.
number
===
x
[
i
].
type
)
{
_x
+=
x
[
i
].
getValue
();
tA
.
push
(
x
[
i
].
getValue
());
xLength
++
;
}
else
if
(
cElementType
.
error
===
x
[
i
].
type
)
{
return
x
[
i
];
}
}
_x
/=
xLength
;
for
(
i
=
0
;
i
<
x
.
length
;
i
++
)
{
sumSQRDeltaX
+=
(
tA
[
i
]
-
_x
)
*
(
tA
[
i
]
-
_x
);
}
return
new
cNumber
(
sumSQRDeltaX
/
(
xLength
-
1
));
}
var
element
,
arr0
=
[];
for
(
var
j
=
0
;
j
<
arg
.
length
;
j
++
)
{
element
=
arg
[
j
];
if
(
cElementType
.
cellsRange
===
element
.
type
||
cElementType
.
cellsRange3D
===
element
.
type
)
{
var
_arrVal
=
element
.
getValue
(
this
.
checkExclude
,
this
.
excludeHiddenRows
);
_arrVal
.
forEach
(
function
(
elem
)
{
if
(
cElementType
.
number
===
elem
.
type
||
cElementType
.
error
===
elem
.
type
)
{
arr0
.
push
(
elem
);
}
});
}
else
if
(
cElementType
.
cell
===
element
.
type
||
cElementType
.
cell3D
===
element
.
type
)
{
if
(
!
this
.
checkExclude
||
!
element
.
isHidden
(
this
.
excludeHiddenRows
))
{
var
a
=
element
.
getValue
();
if
(
cElementType
.
number
===
a
.
type
||
cElementType
.
error
===
a
.
type
)
{
arr0
.
push
(
a
);
}
}
}
else
if
(
cElementType
.
array
===
element
.
type
)
{
element
.
foreach
(
function
(
elem
)
{
if
(
cElementType
.
number
===
elem
.
type
||
cElementType
.
error
===
elem
.
type
)
{
arr0
.
push
(
elem
);
}
});
}
else
if
(
cElementType
.
number
===
element
.
type
||
cElementType
.
bool
===
element
.
type
)
{
arr0
.
push
(
element
.
tocNumber
());
}
else
if
(
cElementType
.
string
===
element
.
type
||
cElementType
.
empty
===
element
.
type
)
{
arr0
.
push
(
new
cNumber
(
0
));
}
else
{
return
this
.
value
=
new
cError
(
cErrorType
.
wrong_value_type
);
}
}
return
this
.
value
=
_var
(
arr0
);
};
/**
* @constructor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment