PluginProbe
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin / 6.5.1.7
wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin v6.5.1.7
6.5.1.7 6.5.1.6 6.5.1.5 6.5.1.4 6.5.1.3 6.5.1.2 6.5.1.1 6.5.0.9 6.5.0.8 6.5.0.7 6.5.0.6 trunk 3.4.2.40 3.4.2.41 3.4.2.42 3.4.2.43 3.4.2.44 3.4.2.45 3.4.2.46 3.4.2.47 3.4.2.48 3.4.2.49 3.4.2.50 6.3.2 6.3.3.1 All 47 releases
wpdatatables / lib / phpoffice / phpspreadsheet / src / PhpSpreadsheet / Calculation / Database / DStDev.php

DStDev.php in wpDataTables – WordPress Data Table, Dynamic Tables & Table Charts Plugin 6.5.1.7, at lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Database/DStDev.php

48 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace PhpOffice\PhpSpreadsheet\Calculation\Database;
4
5 use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
6 use PhpOffice\PhpSpreadsheet\Calculation\Statistical\StandardDeviations;
7
8 class DStDev extends DatabaseAbstract
9 {
10 /**
11 * DSTDEV.
12 *
13 * Estimates the standard deviation of a population based on a sample by using the numbers in a
14 * column of a list or database that match conditions that you specify.
15 *
16 * Excel Function:
17 * DSTDEV(database,field,criteria)
18 *
19 * @param mixed[] $database The range of cells that makes up the list or database.
20 * A database is a list of related data in which rows of related
21 * information are records, and columns of data are fields. The
22 * first row of the list contains labels for each column.
23 * @param int|string $field Indicates which column is used in the function. Enter the
24 * column label enclosed between double quotation marks, such as
25 * "Age" or "Yield," or a number (without quotation marks) that
26 * represents the position of the column within the list: 1 for
27 * the first column, 2 for the second column, and so on.
28 * @param mixed[] $criteria The range of cells that contains the conditions you specify.
29 * You can use any range for the criteria argument, as long as it
30 * includes at least one column label and at least one cell below
31 * the column label in which you specify a condition for the
32 * column.
33 *
34 * @return float|string
35 */
36 public static function evaluate($database, $field, $criteria)
37 {
38 $field = self::fieldExtract($database, $field);
39 if ($field === null) {
40 return ExcelError::VALUE();
41 }
42
43 return StandardDeviations::STDEV(
44 self::getFilteredColumn($database, $field, $criteria)
45 );
46 }
47 }
48