Support _xlfn. prefix and add ISFORMULA, MODE.SNGL, STDEV.S, STDEV.P

This change adds support for newer functions that are prefixed
by _xlfn. (#356). The calculation engine has been updated to
recognise these as functions, and drop the _xlfn. part.

It also add a couple of the new functions such as STDEV.S/P,
MODE.SNGL, ISFORMULA.

Fixes #356
Closes #390
This commit is contained in:
Josh Grant
2018-02-24 12:14:48 +00:00
committed by Adrien Crivelli
parent 1adc3a6688
commit 148bee1991
6 changed files with 157 additions and 5 deletions
@@ -102,4 +102,19 @@ class CalculationTest extends TestCase
['tr'],
];
}
public function testDoesHandleXlfnFunctions()
{
$calculation = Calculation::getInstance();
$tree = $calculation->parseFormula('=_xlfn.ISFORMULA(A1)');
self::assertCount(3, $tree);
$function = $tree[2];
self::assertEquals('Function', $function['type']);
$tree = $calculation->parseFormula('=_xlfn.STDEV.S(A1:B2)');
self::assertCount(5, $tree);
$function = $tree[4];
self::assertEquals('Function', $function['type']);
}
}