Commit 3134725d authored by GoshaZotov's avatar GoshaZotov

add T.TEST formula

parent e3fd6304
......@@ -1006,11 +1006,37 @@ $( function () {
ws.getRange2( "B9" ).setValue( "17" );
ws.getRange2( "B10" ).setValue( "1" );
oParser = new parserFormula( "TTEST(A2:A10,B2:B10,2,1)", "A1", ws );
oParser = new parserFormula( "TTEST(A2:A10,B2:B10,2,1)", "A1", ws );
ok( oParser.parse(), "TTEST(A2:A10,B2:B10,2,1)" );
strictEqual( oParser.calculate().getValue().toFixed(6) - 0, 0.196016, "TTEST(A2:A10,B2:B10,2,1)" );
} );
test( "Test: \"T.TEST\"", function () {
ws.getRange2( "A2" ).setValue( "3" );
ws.getRange2( "A3" ).setValue( "4" );
ws.getRange2( "A4" ).setValue( "5" );
ws.getRange2( "A5" ).setValue( "8" );
ws.getRange2( "A6" ).setValue( "9" );
ws.getRange2( "A7" ).setValue( "1" );
ws.getRange2( "A8" ).setValue( "2" );
ws.getRange2( "A9" ).setValue( "4" );
ws.getRange2( "A10" ).setValue( "5" );
ws.getRange2( "B2" ).setValue( "6" );
ws.getRange2( "B3" ).setValue( "19" );
ws.getRange2( "B4" ).setValue( "3" );
ws.getRange2( "B5" ).setValue( "2" );
ws.getRange2( "B6" ).setValue( "14" );
ws.getRange2( "B7" ).setValue( "4" );
ws.getRange2( "B8" ).setValue( "5" );
ws.getRange2( "B9" ).setValue( "17" );
ws.getRange2( "B10" ).setValue( "1" );
oParser = new parserFormula( "T.TEST(A2:A10,B2:B10,2,1)", "A1", ws );
ok( oParser.parse(), "T.TEST(A2:A10,B2:B10,2,1)" );
strictEqual( oParser.calculate().getValue().toFixed(5) - 0, 0.19602, "T.TEST(A2:A10,B2:B10,2,1)" );
} );
test( "Test: \"F.DIST\"", function () {
ws.getRange2( "A2" ).setValue( "15.2069" );
......
......@@ -59,7 +59,7 @@
cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY, cFORECAST_ETS_STAT,
cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST, cNORM_INV, cNORM_S_DIST,
cNORM_S_INV, cPERMUTATIONA, cPHI, cSTDEV_P, cSTDEV_S,
cT_TEST, cWEIBULL_DIST, cZ_TEST);
cWEIBULL_DIST, cZ_TEST);
cFormulaFunctionGroup['Financial'] = cFormulaFunctionGroup['Financial'] || [];
cFormulaFunctionGroup['Financial'].push(cPDURATION, cRRI);
cFormulaFunctionGroup['Mathematic'] = cFormulaFunctionGroup['Mathematic'] || [];
......@@ -75,7 +75,7 @@
cF_TEST, cFORECAST_ETS, cFORECAST_ETS_CONFINT, cFORECAST_ETS_SEASONALITY,
cFORECAST_ETS_STAT, cHYPGEOM_DIST, cNEGBINOM_DIST, cNORM_DIST,
cNORM_INV, cNORM_S_DIST, cNORM_S_INV, cPERMUTATIONA, cPHI,
cSTDEV_P, cSTDEV_S, cT_TEST, cWEIBULL_DIST, cZ_TEST, cPDURATION, cRRI, cAGGREGATE, cMUNIT,
cSTDEV_P, cSTDEV_S, cWEIBULL_DIST, cZ_TEST, cPDURATION, cRRI, cAGGREGATE, cMUNIT,
cFORMULATEXT, cISFORMULA, cSHEET, cSHEETS);
/**
......@@ -498,18 +498,6 @@
cSTDEV_S.prototype = Object.create(cBaseFunction.prototype);
cSTDEV_S.prototype.constructor = cSTDEV_S;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cT_TEST() {
cBaseFunction.call(this, "T.TEST");
this.isXLFN = true;
}
cT_TEST.prototype = Object.create(cBaseFunction.prototype);
cT_TEST.prototype.constructor = cT_TEST;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
......@@ -72,8 +72,8 @@
cPERCENTILE_EXC, cPERCENTILE_INC, cPERCENTRANK, cPERCENTRANK_EXC, cPERCENTRANK_INC, cPERMUT, cPOISSON,
cPOISSON_DIST, cPROB, cQUARTILE, cQUARTILE_EXC, cQUARTILE_INC, cRANK, cRANK_AVG, cRANK_EQ, cRSQ, cSKEW, cSKEW_P,
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, cVAR_P, cVAR_S, cVARPA,
cWEIBULL, cZTEST);
cT_DIST_RT, cT_INV, cT_INV_2T, cTINV, cTREND, cTRIMMEAN, cTTEST, cT_TEST, cVAR, cVARA, cVARP, cVAR_P, cVAR_S,
cVARPA, cWEIBULL, cZTEST);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cFTEST, cGROWTH, cLINEST, cLOGEST, cTREND,
......@@ -7547,6 +7547,19 @@
return this.value = this._findArrayInNumberArguments(oArguments, calcTTest);
};
/**
* @constructor
* @extends {cTTEST}
*/
function cT_TEST() {
cTTEST.call(this);
this.name = "T.TEST";
}
cT_TEST.prototype = Object.create(cTTEST.prototype);
cT_TEST.prototype.constructor = cT_TEST;
cT_TEST.prototype.isXLFN = true;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment