Files
PhpSpreadsheet/tests/data/Calculation/Statistical/COUNTIF.php
Mark Baker 08673b5820 Initial experiments using the new Database query logic with Conditional Statistical Functions (#1880)
- Refactoring of the Statistical Conditional functions (`AVERAGEIF()`, `AVERAGEIFS()`, `COUNTIF()`, `COUNTIFS()`, `MAXIFS()` and `MINIFS()` to use the new Database functions codebase.
- Extended unit testing
- Fix handling for null values
- Fixes to wildcard text searches

There's still scope for further improvements to memory usage and performance; but for now the code is stable with all unit tests passing
2021-02-27 18:26:12 +01:00

78 lines
1.3 KiB
PHP

<?php
return [
[
2,
['apples', 'oranges', 'peaches', 'apples'],
'apples',
],
[
2,
['ApPlEs', 'oranges', 'peaches', 'APPles'],
'aPpLeS',
],
[
2,
[32, 54, 75, 86],
'>55',
],
[
3,
[32, 54, 75, 86],
'<=75',
],
[
2,
[6, 3, 4, 'X', '', null],
'<=4',
],
[
2,
[6, 3, 4, 31, 'X', '', null],
'<="4"',
],
[
2,
[0, 1, 1, 2, 3, 5, 8, 0, 13, 21],
0,
],
[
3,
[true, false, false, true, false, true, false, false],
true,
],
[
5,
[true, false, false, true, false, true, false, false],
'<>true',
],
[
4,
['apples', 'oranges', 'peaches', 'apples'],
'*',
],
[
3,
['apples', 'oranges', 'peaches', 'apples'],
'*p*s*',
],
[
4,
[
['apples', 'oranges', 'peaches', 'apples'],
['bananas', 'mangoes', 'grapes', 'cherries'],
],
'*p*e*',
],
[
2,
['apples', 'oranges', 'peaches', 'apples'],
'?????es',
],
[
2,
['great * ratings', 'bad * ratings', 'films * wars', 'films * trek', 'music * radio'],
'*~* ra*s',
],
];