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
f4abb0d5
Commit
f4abb0d5
authored
Jun 20, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add RANK.AVG formula
parent
33219f8c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
15 deletions
+52
-15
cell/model/FormulaObjects/_xlfnFunctions.js
cell/model/FormulaObjects/_xlfnFunctions.js
+2
-14
cell/model/FormulaObjects/statisticalFunctions.js
cell/model/FormulaObjects/statisticalFunctions.js
+50
-1
No files found.
cell/model/FormulaObjects/_xlfnFunctions.js
View file @
f4abb0d5
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cFORECAST_LINEAR
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cFORECAST_LINEAR
,
cHYPGEOM_DIST
,
cMODE_MULT
,
cMODE_SNGL
,
cHYPGEOM_DIST
,
cMODE_MULT
,
cMODE_SNGL
,
cNEGBINOM_DIST
,
cNORM_DIST
,
cNORM_INV
,
cNORM_S_DIST
,
cNORM_S_INV
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cNEGBINOM_DIST
,
cNORM_DIST
,
cNORM_INV
,
cNORM_S_DIST
,
cNORM_S_INV
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cPERCENTRANK_EXC
,
cPERCENTRANK_INC
,
cPERMUTATIONA
,
cPHI
,
cPOISSON_DIST
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cRANK_AVG
,
cPERCENTRANK_EXC
,
cPERCENTRANK_INC
,
cPERMUTATIONA
,
cPHI
,
cPOISSON_DIST
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cSKEW_P
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
cVAR_P
,
cSKEW_P
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
cVAR_P
,
cVAR_S
,
cWEIBULL_DIST
,
cZ_TEST
);
cVAR_S
,
cWEIBULL_DIST
,
cZ_TEST
);
cFormulaFunctionGroup
[
'
Financial
'
]
=
cFormulaFunctionGroup
[
'
Financial
'
]
||
[];
cFormulaFunctionGroup
[
'
Financial
'
]
=
cFormulaFunctionGroup
[
'
Financial
'
]
||
[];
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
cCONFIDENCE_NORM
,
cCONFIDENCE_T
,
cCOVARIANCE_P
,
cCOVARIANCE_S
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cCONFIDENCE_NORM
,
cCONFIDENCE_T
,
cCOVARIANCE_P
,
cCOVARIANCE_S
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cFORECAST_LINEAR
,
cHYPGEOM_DIST
,
cMODE_MULT
,
cMODE_SNGL
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cFORECAST_LINEAR
,
cHYPGEOM_DIST
,
cMODE_MULT
,
cMODE_SNGL
,
cNEGBINOM_DIST
,
cNORM_DIST
,
cNORM_INV
,
cNORM_S_DIST
,
cNORM_S_INV
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cNEGBINOM_DIST
,
cNORM_DIST
,
cNORM_INV
,
cNORM_S_DIST
,
cNORM_S_INV
,
cPERCENTILE_EXC
,
cPERCENTILE_INC
,
cPERCENTRANK_EXC
,
cPERCENTRANK_INC
,
cPERMUTATIONA
,
cPHI
,
cPOISSON_DIST
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cRANK_AVG
,
cPERCENTRANK_EXC
,
cPERCENTRANK_INC
,
cPERMUTATIONA
,
cPHI
,
cPOISSON_DIST
,
cQUARTILE_EXC
,
cQUARTILE_INC
,
cSKEW_P
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
cVAR_P
,
cVAR_S
,
cWEIBULL_DIST
,
cZ_TEST
,
cPDURATION
,
cRRI
,
cSKEW_P
,
cSTDEV_P
,
cSTDEV_S
,
cT_TEST
,
cVAR_P
,
cVAR_S
,
cWEIBULL_DIST
,
cZ_TEST
,
cPDURATION
,
cRRI
,
cAGGREGATE
,
cMUNIT
,
cFORMULATEXT
,
cISFORMULA
,
cSHEET
,
cSHEETS
);
cAGGREGATE
,
cMUNIT
,
cFORMULATEXT
,
cISFORMULA
,
cSHEET
,
cSHEETS
);
...
@@ -672,18 +672,6 @@
...
@@ -672,18 +672,6 @@
cQUERYSTRING
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cQUERYSTRING
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cQUERYSTRING
.
prototype
.
constructor
=
cQUERYSTRING
;
cQUERYSTRING
.
prototype
.
constructor
=
cQUERYSTRING
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cRANK_AVG
()
{
cBaseFunction
.
call
(
this
,
"
RANK.AVG
"
);
this
.
isXLFN
=
true
;
}
cRANK_AVG
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cRANK_AVG
.
prototype
.
constructor
=
cRANK_AVG
;
/**
/**
* @constructor
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
* @extends {AscCommonExcel.cBaseFunction}
...
...
cell/model/FormulaObjects/statisticalFunctions.js
View file @
f4abb0d5
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
cGEOMEAN
,
cGROWTH
,
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cLINEST
,
cLOGEST
,
cLOGINV
,
cLOGNORM_DIST
,
cGEOMEAN
,
cGROWTH
,
cHARMEAN
,
cHYPGEOMDIST
,
cINTERCEPT
,
cKURT
,
cLARGE
,
cLINEST
,
cLOGEST
,
cLOGINV
,
cLOGNORM_DIST
,
cLOGNORM_INV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cNEGBINOMDIST
,
cNORMDIST
,
cNORMINV
,
cLOGNORM_INV
,
cLOGNORMDIST
,
cMAX
,
cMAXA
,
cMEDIAN
,
cMIN
,
cMINA
,
cMODE
,
cNEGBINOMDIST
,
cNORMDIST
,
cNORMINV
,
cNORMSDIST
,
cNORMSINV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTRANK
,
cPERMUT
,
cPOISSON
,
cPROB
,
cQUARTILE
,
cRANK
,
cNORMSDIST
,
cNORMSINV
,
cPEARSON
,
cPERCENTILE
,
cPERCENTRANK
,
cPERMUT
,
cPOISSON
,
cPROB
,
cQUARTILE
,
cRANK
,
cRANK_EQ
,
cRSQ
,
cSKEW
,
cSLOPE
,
cSMALL
,
cSTANDARDIZE
,
cSTDEV
,
cSTDEVA
,
cSTDEVP
,
cSTDEVPA
,
cSTEYX
,
cTDIST
,
cRANK_
AVG
,
cRANK_
EQ
,
cRSQ
,
cSKEW
,
cSLOPE
,
cSMALL
,
cSTANDARDIZE
,
cSTDEV
,
cSTDEVA
,
cSTDEVP
,
cSTDEVPA
,
cSTEYX
,
cTDIST
,
cT_DIST
,
cT_DIST_2T
,
cT_DIST_RT
,
cT_INV
,
cT_INV_2T
,
cTINV
,
cTREND
,
cTRIMMEAN
,
cTTEST
,
cVAR
,
cVARA
,
cVARP
,
cT_DIST
,
cT_DIST_2T
,
cT_DIST_RT
,
cT_INV
,
cT_INV_2T
,
cTINV
,
cTREND
,
cTRIMMEAN
,
cTTEST
,
cVAR
,
cVARA
,
cVARP
,
cVARPA
,
cWEIBULL
,
cZTEST
);
cVARPA
,
cWEIBULL
,
cZTEST
);
...
@@ -5597,6 +5597,54 @@
...
@@ -5597,6 +5597,54 @@
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
calcTDist
);
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
calcTDist
);
};
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cRANK_AVG
()
{
cBaseFunction
.
call
(
this
,
"
RANK.AVG
"
);
}
cRANK_AVG
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cRANK_AVG
.
prototype
.
constructor
=
cRANK_AVG
;
cRANK_AVG
.
prototype
.
argumentsMin
=
2
;
cRANK_AVG
.
prototype
.
argumentsMax
=
3
;
cRANK_AVG
.
prototype
.
isXLFN
=
true
;
cRANK_AVG
.
prototype
.
Calculate
=
function
(
arg
)
{
var
oArguments
=
this
.
_prepareArguments
(
arg
,
arguments
[
1
],
true
,
[
null
,
cElementType
.
array
]);
var
argClone
=
oArguments
.
args
;
//1 argument - array
argClone
[
0
]
=
argClone
[
0
].
tocNumber
();
argClone
[
2
]
=
undefined
!==
argClone
[
2
]
?
argClone
[
2
].
tocNumber
()
:
new
cNumber
(
0
);
var
argError
;
if
(
argError
=
this
.
_checkErrorArg
(
argClone
))
{
return
this
.
value
=
argError
;
}
var
calcTDist
=
function
(
argArray
){
var
number
=
argArray
[
0
];
var
ref
=
argArray
[
1
];
var
order
=
argArray
[
2
];
if
(
!
ref
.
length
){
return
new
cError
(
cErrorType
.
wrong_value_type
);
}
var
changedRef
=
[];
for
(
var
i
=
0
;
i
<
ref
.
length
;
i
++
){
if
(
cElementType
.
number
===
ref
[
i
].
type
){
changedRef
.
push
(
ref
[
i
]);
}
}
var
res
=
rank
(
number
,
changedRef
,
order
,
true
);
return
null
!==
res
&&
!
isNaN
(
res
)
?
new
cNumber
(
res
)
:
new
cError
(
cErrorType
.
wrong_value_type
);
};
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
calcTDist
);
};
/**
/**
* @constructor
* @constructor
* @extends {cRANK}
* @extends {cRANK}
...
@@ -5608,6 +5656,7 @@
...
@@ -5608,6 +5656,7 @@
cRANK_EQ
.
prototype
=
Object
.
create
(
cRANK
.
prototype
);
cRANK_EQ
.
prototype
=
Object
.
create
(
cRANK
.
prototype
);
cRANK_EQ
.
prototype
.
constructor
=
cRANK_EQ
;
cRANK_EQ
.
prototype
.
constructor
=
cRANK_EQ
;
cRANK_EQ
.
prototype
.
isXLFN
=
true
;
/**
/**
* @constructor
* @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