parent
8217b5a7ce
commit
2ac9d01257
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
abstract class Category
|
||||
{
|
||||
// Function categories
|
||||
const CATEGORY_CUBE = 'Cube';
|
||||
const CATEGORY_DATABASE = 'Database';
|
||||
const CATEGORY_DATE_AND_TIME = 'Date and Time';
|
||||
const CATEGORY_ENGINEERING = 'Engineering';
|
||||
const CATEGORY_FINANCIAL = 'Financial';
|
||||
const CATEGORY_INFORMATION = 'Information';
|
||||
const CATEGORY_LOGICAL = 'Logical';
|
||||
const CATEGORY_LOOKUP_AND_REFERENCE = 'Lookup and Reference';
|
||||
const CATEGORY_MATH_AND_TRIG = 'Math and Trig';
|
||||
const CATEGORY_STATISTICAL = 'Statistical';
|
||||
const CATEGORY_TEXT_AND_DATA = 'Text and Data';
|
||||
const CATEGORY_WEB = 'Web';
|
||||
}
|
@ -1,608 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
class Database
|
||||
{
|
||||
/**
|
||||
* fieldExtract.
|
||||
*
|
||||
* Extracts the column ID to use for the data field.
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param mixed $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
private static function fieldExtract($database, $field)
|
||||
{
|
||||
$field = strtoupper(Functions::flattenSingleValue($field));
|
||||
$fieldNames = array_map('strtoupper', array_shift($database));
|
||||
|
||||
if (is_numeric($field)) {
|
||||
$keys = array_keys($fieldNames);
|
||||
|
||||
return $keys[$field - 1];
|
||||
}
|
||||
$key = array_search($field, $fieldNames);
|
||||
|
||||
return ($key) ? $key : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* filter.
|
||||
*
|
||||
* Parses the selection criteria, extracts the database rows that match those criteria, and
|
||||
* returns that subset of rows.
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return array of mixed
|
||||
*/
|
||||
private static function filter($database, $criteria)
|
||||
{
|
||||
$fieldNames = array_shift($database);
|
||||
$criteriaNames = array_shift($criteria);
|
||||
|
||||
// Convert the criteria into a set of AND/OR conditions with [:placeholders]
|
||||
$testConditions = $testValues = [];
|
||||
$testConditionsCount = 0;
|
||||
foreach ($criteriaNames as $key => $criteriaName) {
|
||||
$testCondition = [];
|
||||
$testConditionCount = 0;
|
||||
foreach ($criteria as $row => $criterion) {
|
||||
if ($criterion[$key] > '') {
|
||||
$testCondition[] = '[:' . $criteriaName . ']' . Functions::ifCondition($criterion[$key]);
|
||||
++$testConditionCount;
|
||||
}
|
||||
}
|
||||
if ($testConditionCount > 1) {
|
||||
$testConditions[] = 'OR(' . implode(',', $testCondition) . ')';
|
||||
++$testConditionsCount;
|
||||
} elseif ($testConditionCount == 1) {
|
||||
$testConditions[] = $testCondition[0];
|
||||
++$testConditionsCount;
|
||||
}
|
||||
}
|
||||
|
||||
if ($testConditionsCount > 1) {
|
||||
$testConditionSet = 'AND(' . implode(',', $testConditions) . ')';
|
||||
} elseif ($testConditionsCount == 1) {
|
||||
$testConditionSet = $testConditions[0];
|
||||
}
|
||||
|
||||
// Loop through each row of the database
|
||||
foreach ($database as $dataRow => $dataValues) {
|
||||
// Substitute actual values from the database row for our [:placeholders]
|
||||
$testConditionList = $testConditionSet;
|
||||
foreach ($criteriaNames as $key => $criteriaName) {
|
||||
$k = array_search($criteriaName, $fieldNames);
|
||||
if (isset($dataValues[$k])) {
|
||||
$dataValue = $dataValues[$k];
|
||||
$dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
|
||||
$testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList);
|
||||
}
|
||||
}
|
||||
// evaluate the criteria against the row data
|
||||
$result = Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList);
|
||||
// If the row failed to meet the criteria, remove it from the database
|
||||
if (!$result) {
|
||||
unset($database[$dataRow]);
|
||||
}
|
||||
}
|
||||
|
||||
return $database;
|
||||
}
|
||||
|
||||
private static function getFilteredColumn($database, $field, $criteria)
|
||||
{
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::filter($database, $criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = [];
|
||||
foreach ($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
return $colData;
|
||||
}
|
||||
|
||||
/**
|
||||
* DAVERAGE.
|
||||
*
|
||||
* Averages the values in a column of a list or database that match conditions you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DAVERAGE(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float|string
|
||||
*/
|
||||
public static function DAVERAGE($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::AVERAGE(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DCOUNT.
|
||||
*
|
||||
* Counts the cells that contain numbers in a column of a list or database that match conditions
|
||||
* that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DCOUNT(database,[field],criteria)
|
||||
*
|
||||
* Excel Function:
|
||||
* DAVERAGE(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the
|
||||
* database that match the criteria.
|
||||
*/
|
||||
public static function DCOUNT($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::COUNT(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DCOUNTA.
|
||||
*
|
||||
* Counts the nonblank cells in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DCOUNTA(database,[field],criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @TODO The field argument is optional. If field is omitted, DCOUNTA counts all records in the
|
||||
* database that match the criteria.
|
||||
*/
|
||||
public static function DCOUNTA($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// reduce the database to a set of rows that match all the criteria
|
||||
$database = self::filter($database, $criteria);
|
||||
// extract an array of values for the requested column
|
||||
$colData = [];
|
||||
foreach ($database as $row) {
|
||||
$colData[] = $row[$field];
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::COUNTA(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DGET.
|
||||
*
|
||||
* Extracts a single value from a column of a list or database that matches conditions that you
|
||||
* specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DGET(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function DGET($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
$colData = self::getFilteredColumn($database, $field, $criteria);
|
||||
if (count($colData) > 1) {
|
||||
return Functions::NAN();
|
||||
}
|
||||
|
||||
return $colData[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* DMAX.
|
||||
*
|
||||
* Returns the largest number in a column of a list or database that matches conditions you that
|
||||
* specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DMAX(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public static function DMAX($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::MAX(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DMIN.
|
||||
*
|
||||
* Returns the smallest number in a column of a list or database that matches conditions you that
|
||||
* specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DMIN(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public static function DMIN($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::MIN(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DPRODUCT.
|
||||
*
|
||||
* Multiplies the values in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DPRODUCT(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public static function DPRODUCT($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return MathTrig::PRODUCT(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DSTDEV.
|
||||
*
|
||||
* Estimates the standard deviation of a population based on a sample by using the numbers in a
|
||||
* column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DSTDEV(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float|string
|
||||
*/
|
||||
public static function DSTDEV($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::STDEV(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DSTDEVP.
|
||||
*
|
||||
* Calculates the standard deviation of a population based on the entire population by using the
|
||||
* numbers in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DSTDEVP(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float|string
|
||||
*/
|
||||
public static function DSTDEVP($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::STDEVP(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DSUM.
|
||||
*
|
||||
* Adds the numbers in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DSUM(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public static function DSUM($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return MathTrig::SUM(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DVAR.
|
||||
*
|
||||
* Estimates the variance of a population based on a sample by using the numbers in a column
|
||||
* of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DVAR(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float|string (string if result is an error)
|
||||
*/
|
||||
public static function DVAR($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::VARFunc(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* DVARP.
|
||||
*
|
||||
* Calculates the variance of a population based on the entire population by using the numbers
|
||||
* in a column of a list or database that match conditions that you specify.
|
||||
*
|
||||
* Excel Function:
|
||||
* DVARP(database,field,criteria)
|
||||
*
|
||||
* @param mixed[] $database The range of cells that makes up the list or database.
|
||||
* A database is a list of related data in which rows of related
|
||||
* information are records, and columns of data are fields. The
|
||||
* first row of the list contains labels for each column.
|
||||
* @param int|string $field Indicates which column is used in the function. Enter the
|
||||
* column label enclosed between double quotation marks, such as
|
||||
* "Age" or "Yield," or a number (without quotation marks) that
|
||||
* represents the position of the column within the list: 1 for
|
||||
* the first column, 2 for the second column, and so on.
|
||||
* @param mixed[] $criteria The range of cells that contains the conditions you specify.
|
||||
* You can use any range for the criteria argument, as long as it
|
||||
* includes at least one column label and at least one cell below
|
||||
* the column label in which you specify a condition for the
|
||||
* column.
|
||||
*
|
||||
* @return float|string (string if result is an error)
|
||||
*/
|
||||
public static function DVARP($database, $field, $criteria)
|
||||
{
|
||||
$field = self::fieldExtract($database, $field);
|
||||
if ($field === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Return
|
||||
return Statistical::VARP(
|
||||
self::getFilteredColumn($database, $field, $criteria)
|
||||
);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation\Engine;
|
||||
|
||||
class CyclicReferenceStack
|
||||
{
|
||||
/**
|
||||
* The call stack for calculated cells.
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
private $stack = [];
|
||||
|
||||
/**
|
||||
* Return the number of entries on the stack.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a new entry onto the stack.
|
||||
*
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function push($value): void
|
||||
{
|
||||
$this->stack[$value] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pop the last entry from the stack.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function pop()
|
||||
{
|
||||
return array_pop($this->stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to see if a specified entry exists on the stack.
|
||||
*
|
||||
* @param mixed $value The value to test
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onStack($value)
|
||||
{
|
||||
return isset($this->stack[$value]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the stack.
|
||||
*/
|
||||
public function clear(): void
|
||||
{
|
||||
$this->stack = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of all entries on the stack.
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function showStack()
|
||||
{
|
||||
return $this->stack;
|
||||
}
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation\Engine;
|
||||
|
||||
class Logger
|
||||
{
|
||||
/**
|
||||
* Flag to determine whether a debug log should be generated by the calculation engine
|
||||
* If true, then a debug log will be generated
|
||||
* If false, then a debug log will not be generated.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $writeDebugLog = false;
|
||||
|
||||
/**
|
||||
* Flag to determine whether a debug log should be echoed by the calculation engine
|
||||
* If true, then a debug log will be echoed
|
||||
* If false, then a debug log will not be echoed
|
||||
* A debug log can only be echoed if it is generated.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $echoDebugLog = false;
|
||||
|
||||
/**
|
||||
* The debug log generated by the calculation engine.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
private $debugLog = [];
|
||||
|
||||
/**
|
||||
* The calculation engine cell reference stack.
|
||||
*
|
||||
* @var CyclicReferenceStack
|
||||
*/
|
||||
private $cellStack;
|
||||
|
||||
/**
|
||||
* Instantiate a Calculation engine logger.
|
||||
*/
|
||||
public function __construct(CyclicReferenceStack $stack)
|
||||
{
|
||||
$this->cellStack = $stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/Disable Calculation engine logging.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*/
|
||||
public function setWriteDebugLog($pValue): void
|
||||
{
|
||||
$this->writeDebugLog = $pValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether calculation engine logging is enabled or disabled.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getWriteDebugLog()
|
||||
{
|
||||
return $this->writeDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/Disable echoing of debug log information.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*/
|
||||
public function setEchoDebugLog($pValue): void
|
||||
{
|
||||
$this->echoDebugLog = $pValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether echoing of debug log information is enabled or disabled.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getEchoDebugLog()
|
||||
{
|
||||
return $this->echoDebugLog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an entry to the calculation engine debug log.
|
||||
*/
|
||||
public function writeDebugLog(...$args): void
|
||||
{
|
||||
// Only write the debug log if logging is enabled
|
||||
if ($this->writeDebugLog) {
|
||||
$message = implode('', $args);
|
||||
$cellReference = implode(' -> ', $this->cellStack->showStack());
|
||||
if ($this->echoDebugLog) {
|
||||
echo $cellReference,
|
||||
($this->cellStack->count() > 0 ? ' => ' : ''),
|
||||
$message,
|
||||
PHP_EOL;
|
||||
}
|
||||
$this->debugLog[] = $cellReference .
|
||||
($this->cellStack->count() > 0 ? ' => ' : '') .
|
||||
$message;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a series of entries to the calculation engine debug log.
|
||||
*
|
||||
* @param string[] $args
|
||||
*/
|
||||
public function mergeDebugLog(array $args): void
|
||||
{
|
||||
if ($this->writeDebugLog) {
|
||||
foreach ($args as $entry) {
|
||||
$this->writeDebugLog($entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the calculation engine debug log.
|
||||
*/
|
||||
public function clearLog(): void
|
||||
{
|
||||
$this->debugLog = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the calculation engine debug log.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getLog()
|
||||
{
|
||||
return $this->debugLog;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
|
||||
|
||||
class Exception extends PhpSpreadsheetException
|
||||
{
|
||||
/**
|
||||
* Error handler callback.
|
||||
*
|
||||
* @param mixed $code
|
||||
* @param mixed $string
|
||||
* @param mixed $file
|
||||
* @param mixed $line
|
||||
* @param mixed $context
|
||||
*/
|
||||
public static function errorHandlerCallback($code, $string, $file, $line, $context): void
|
||||
{
|
||||
$e = new self($string, $code);
|
||||
$e->line = $line;
|
||||
$e->file = $file;
|
||||
|
||||
throw $e;
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
class ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* Register errorhandler.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
set_error_handler([Exception::class, 'errorHandlerCallback'], E_ALL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister errorhandler.
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
restore_error_handler();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,631 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
/**
|
||||
* PARTLY BASED ON:
|
||||
* Copyright (c) 2007 E. W. Bachtal, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* The software is provided "as is", without warranty of any kind, express or implied, including but not
|
||||
* limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
|
||||
* no event shall the authors or copyright holders be liable for any claim, damages or other liability,
|
||||
* whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
|
||||
* software or the use or other dealings in the software.
|
||||
*
|
||||
* https://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
|
||||
* https://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
|
||||
*/
|
||||
class FormulaParser
|
||||
{
|
||||
// Character constants
|
||||
const QUOTE_DOUBLE = '"';
|
||||
const QUOTE_SINGLE = '\'';
|
||||
const BRACKET_CLOSE = ']';
|
||||
const BRACKET_OPEN = '[';
|
||||
const BRACE_OPEN = '{';
|
||||
const BRACE_CLOSE = '}';
|
||||
const PAREN_OPEN = '(';
|
||||
const PAREN_CLOSE = ')';
|
||||
const SEMICOLON = ';';
|
||||
const WHITESPACE = ' ';
|
||||
const COMMA = ',';
|
||||
const ERROR_START = '#';
|
||||
|
||||
const OPERATORS_SN = '+-';
|
||||
const OPERATORS_INFIX = '+-*/^&=><';
|
||||
const OPERATORS_POSTFIX = '%';
|
||||
|
||||
/**
|
||||
* Formula.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $formula;
|
||||
|
||||
/**
|
||||
* Tokens.
|
||||
*
|
||||
* @var FormulaToken[]
|
||||
*/
|
||||
private $tokens = [];
|
||||
|
||||
/**
|
||||
* Create a new FormulaParser.
|
||||
*
|
||||
* @param string $pFormula Formula to parse
|
||||
*/
|
||||
public function __construct($pFormula = '')
|
||||
{
|
||||
// Check parameters
|
||||
if ($pFormula === null) {
|
||||
throw new Exception('Invalid parameter passed: formula');
|
||||
}
|
||||
|
||||
// Initialise values
|
||||
$this->formula = trim($pFormula);
|
||||
// Parse!
|
||||
$this->parseToTokens();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Formula.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormula()
|
||||
{
|
||||
return $this->formula;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Token.
|
||||
*
|
||||
* @param int $pId Token id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getToken($pId = 0)
|
||||
{
|
||||
if (isset($this->tokens[$pId])) {
|
||||
return $this->tokens[$pId];
|
||||
}
|
||||
|
||||
throw new Exception("Token with id $pId does not exist.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Token count.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTokenCount()
|
||||
{
|
||||
return count($this->tokens);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tokens.
|
||||
*
|
||||
* @return FormulaToken[]
|
||||
*/
|
||||
public function getTokens()
|
||||
{
|
||||
return $this->tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse to tokens.
|
||||
*/
|
||||
private function parseToTokens(): void
|
||||
{
|
||||
// No attempt is made to verify formulas; assumes formulas are derived from Excel, where
|
||||
// they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions.
|
||||
|
||||
// Check if the formula has a valid starting =
|
||||
$formulaLength = strlen($this->formula);
|
||||
if ($formulaLength < 2 || $this->formula[0] != '=') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Helper variables
|
||||
$tokens1 = $tokens2 = $stack = [];
|
||||
$inString = $inPath = $inRange = $inError = false;
|
||||
$token = $previousToken = $nextToken = null;
|
||||
|
||||
$index = 1;
|
||||
$value = '';
|
||||
|
||||
$ERRORS = ['#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A'];
|
||||
$COMPARATORS_MULTI = ['>=', '<=', '<>'];
|
||||
|
||||
while ($index < $formulaLength) {
|
||||
// state-dependent character evaluation (order is important)
|
||||
|
||||
// double-quoted strings
|
||||
// embeds are doubled
|
||||
// end marks token
|
||||
if ($inString) {
|
||||
if ($this->formula[$index] == self::QUOTE_DOUBLE) {
|
||||
if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_DOUBLE)) {
|
||||
$value .= self::QUOTE_DOUBLE;
|
||||
++$index;
|
||||
} else {
|
||||
$inString = false;
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND, FormulaToken::TOKEN_SUBTYPE_TEXT);
|
||||
$value = '';
|
||||
}
|
||||
} else {
|
||||
$value .= $this->formula[$index];
|
||||
}
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// single-quoted strings (links)
|
||||
// embeds are double
|
||||
// end does not mark a token
|
||||
if ($inPath) {
|
||||
if ($this->formula[$index] == self::QUOTE_SINGLE) {
|
||||
if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_SINGLE)) {
|
||||
$value .= self::QUOTE_SINGLE;
|
||||
++$index;
|
||||
} else {
|
||||
$inPath = false;
|
||||
}
|
||||
} else {
|
||||
$value .= $this->formula[$index];
|
||||
}
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// bracked strings (R1C1 range index or linked workbook name)
|
||||
// no embeds (changed to "()" by Excel)
|
||||
// end does not mark a token
|
||||
if ($inRange) {
|
||||
if ($this->formula[$index] == self::BRACKET_CLOSE) {
|
||||
$inRange = false;
|
||||
}
|
||||
$value .= $this->formula[$index];
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// error values
|
||||
// end marks a token, determined from absolute list of values
|
||||
if ($inError) {
|
||||
$value .= $this->formula[$index];
|
||||
++$index;
|
||||
if (in_array($value, $ERRORS)) {
|
||||
$inError = false;
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND, FormulaToken::TOKEN_SUBTYPE_ERROR);
|
||||
$value = '';
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// scientific notation check
|
||||
if (strpos(self::OPERATORS_SN, $this->formula[$index]) !== false) {
|
||||
if (strlen($value) > 1) {
|
||||
if (preg_match('/^[1-9]{1}(\\.\\d+)?E{1}$/', $this->formula[$index]) != 0) {
|
||||
$value .= $this->formula[$index];
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// independent character evaluation (order not important)
|
||||
|
||||
// establish state-dependent character evaluations
|
||||
if ($this->formula[$index] == self::QUOTE_DOUBLE) {
|
||||
if (strlen($value) > 0) {
|
||||
// unexpected
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
|
||||
$value = '';
|
||||
}
|
||||
$inString = true;
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->formula[$index] == self::QUOTE_SINGLE) {
|
||||
if (strlen($value) > 0) {
|
||||
// unexpected
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
|
||||
$value = '';
|
||||
}
|
||||
$inPath = true;
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->formula[$index] == self::BRACKET_OPEN) {
|
||||
$inRange = true;
|
||||
$value .= self::BRACKET_OPEN;
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->formula[$index] == self::ERROR_START) {
|
||||
if (strlen($value) > 0) {
|
||||
// unexpected
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
|
||||
$value = '';
|
||||
}
|
||||
$inError = true;
|
||||
$value .= self::ERROR_START;
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// mark start and end of arrays and array rows
|
||||
if ($this->formula[$index] == self::BRACE_OPEN) {
|
||||
if (strlen($value) > 0) {
|
||||
// unexpected
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$tmp = new FormulaToken('ARRAY', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
|
||||
$tokens1[] = $tmp;
|
||||
$stack[] = clone $tmp;
|
||||
|
||||
$tmp = new FormulaToken('ARRAYROW', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
|
||||
$tokens1[] = $tmp;
|
||||
$stack[] = clone $tmp;
|
||||
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->formula[$index] == self::SEMICOLON) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
$tokens1[] = $tmp;
|
||||
|
||||
$tmp = new FormulaToken(',', FormulaToken::TOKEN_TYPE_ARGUMENT);
|
||||
$tokens1[] = $tmp;
|
||||
|
||||
$tmp = new FormulaToken('ARRAYROW', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
|
||||
$tokens1[] = $tmp;
|
||||
$stack[] = clone $tmp;
|
||||
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->formula[$index] == self::BRACE_CLOSE) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
$tokens1[] = $tmp;
|
||||
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
$tokens1[] = $tmp;
|
||||
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// trim white-space
|
||||
if ($this->formula[$index] == self::WHITESPACE) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
$tokens1[] = new FormulaToken('', FormulaToken::TOKEN_TYPE_WHITESPACE);
|
||||
++$index;
|
||||
while (($this->formula[$index] == self::WHITESPACE) && ($index < $formulaLength)) {
|
||||
++$index;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// multi-character comparators
|
||||
if (($index + 2) <= $formulaLength) {
|
||||
if (in_array(substr($this->formula, $index, 2), $COMPARATORS_MULTI)) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
$tokens1[] = new FormulaToken(substr($this->formula, $index, 2), FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_LOGICAL);
|
||||
$index += 2;
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// standard infix operators
|
||||
if (strpos(self::OPERATORS_INFIX, $this->formula[$index]) !== false) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
$tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORINFIX);
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// standard postfix operators (only one)
|
||||
if (strpos(self::OPERATORS_POSTFIX, $this->formula[$index]) !== false) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
$tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// start subexpression or function
|
||||
if ($this->formula[$index] == self::PAREN_OPEN) {
|
||||
if (strlen($value) > 0) {
|
||||
$tmp = new FormulaToken($value, FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
|
||||
$tokens1[] = $tmp;
|
||||
$stack[] = clone $tmp;
|
||||
$value = '';
|
||||
} else {
|
||||
$tmp = new FormulaToken('', FormulaToken::TOKEN_TYPE_SUBEXPRESSION, FormulaToken::TOKEN_SUBTYPE_START);
|
||||
$tokens1[] = $tmp;
|
||||
$stack[] = clone $tmp;
|
||||
}
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// function, subexpression, or array parameters, or operand unions
|
||||
if ($this->formula[$index] == self::COMMA) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
$stack[] = $tmp;
|
||||
|
||||
if ($tmp->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) {
|
||||
$tokens1[] = new FormulaToken(',', FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_UNION);
|
||||
} else {
|
||||
$tokens1[] = new FormulaToken(',', FormulaToken::TOKEN_TYPE_ARGUMENT);
|
||||
}
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// stop subexpression
|
||||
if ($this->formula[$index] == self::PAREN_CLOSE) {
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$tmp = array_pop($stack);
|
||||
$tmp->setValue('');
|
||||
$tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
|
||||
$tokens1[] = $tmp;
|
||||
|
||||
++$index;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// token accumulation
|
||||
$value .= $this->formula[$index];
|
||||
++$index;
|
||||
}
|
||||
|
||||
// dump remaining accumulation
|
||||
if (strlen($value) > 0) {
|
||||
$tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
|
||||
}
|
||||
|
||||
// move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections
|
||||
$tokenCount = count($tokens1);
|
||||
for ($i = 0; $i < $tokenCount; ++$i) {
|
||||
$token = $tokens1[$i];
|
||||
if (isset($tokens1[$i - 1])) {
|
||||
$previousToken = $tokens1[$i - 1];
|
||||
} else {
|
||||
$previousToken = null;
|
||||
}
|
||||
if (isset($tokens1[$i + 1])) {
|
||||
$nextToken = $tokens1[$i + 1];
|
||||
} else {
|
||||
$nextToken = null;
|
||||
}
|
||||
|
||||
if ($token === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($token->getTokenType() != FormulaToken::TOKEN_TYPE_WHITESPACE) {
|
||||
$tokens2[] = $token;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($previousToken === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
!(
|
||||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
|
||||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
|
||||
($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($nextToken === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
!(
|
||||
(($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) ||
|
||||
(($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) ||
|
||||
($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
|
||||
)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$tokens2[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_INTERSECTION);
|
||||
}
|
||||
|
||||
// move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators
|
||||
// to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names
|
||||
$this->tokens = [];
|
||||
|
||||
$tokenCount = count($tokens2);
|
||||
for ($i = 0; $i < $tokenCount; ++$i) {
|
||||
$token = $tokens2[$i];
|
||||
if (isset($tokens2[$i - 1])) {
|
||||
$previousToken = $tokens2[$i - 1];
|
||||
} else {
|
||||
$previousToken = null;
|
||||
}
|
||||
if (isset($tokens2[$i + 1])) {
|
||||
$nextToken = $tokens2[$i + 1];
|
||||
} else {
|
||||
$nextToken = null;
|
||||
}
|
||||
|
||||
if ($token === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '-') {
|
||||
if ($i == 0) {
|
||||
$token->setTokenType(FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
|
||||
} elseif (
|
||||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) &&
|
||||
($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
|
||||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) &&
|
||||
($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
|
||||
($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
|
||||
($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
|
||||
) {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
|
||||
} else {
|
||||
$token->setTokenType(FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
|
||||
}
|
||||
|
||||
$this->tokens[] = $token;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '+') {
|
||||
if ($i == 0) {
|
||||
continue;
|
||||
} elseif (
|
||||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) &&
|
||||
($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
|
||||
(($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) &&
|
||||
($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
|
||||
($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
|
||||
($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
|
||||
) {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->tokens[] = $token;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
$token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX &&
|
||||
$token->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_NOTHING
|
||||
) {
|
||||
if (strpos('<>=', substr($token->getValue(), 0, 1)) !== false) {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_LOGICAL);
|
||||
} elseif ($token->getValue() == '&') {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_CONCATENATION);
|
||||
} else {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
|
||||
}
|
||||
|
||||
$this->tokens[] = $token;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
$token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND &&
|
||||
$token->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_NOTHING
|
||||
) {
|
||||
if (!is_numeric($token->getValue())) {
|
||||
if (strtoupper($token->getValue()) == 'TRUE' || strtoupper($token->getValue()) == 'FALSE') {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_LOGICAL);
|
||||
} else {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_RANGE);
|
||||
}
|
||||
} else {
|
||||
$token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_NUMBER);
|
||||
}
|
||||
|
||||
$this->tokens[] = $token;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) {
|
||||
if (strlen($token->getValue()) > 0) {
|
||||
if (substr($token->getValue(), 0, 1) == '@') {
|
||||
$token->setValue(substr($token->getValue(), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->tokens[] = $token;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,150 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
/**
|
||||
* PARTLY BASED ON:
|
||||
* Copyright (c) 2007 E. W. Bachtal, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* The software is provided "as is", without warranty of any kind, express or implied, including but not
|
||||
* limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
|
||||
* no event shall the authors or copyright holders be liable for any claim, damages or other liability,
|
||||
* whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
|
||||
* software or the use or other dealings in the software.
|
||||
*
|
||||
* https://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
|
||||
* https://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
|
||||
*/
|
||||
class FormulaToken
|
||||
{
|
||||
// Token types
|
||||
const TOKEN_TYPE_NOOP = 'Noop';
|
||||
const TOKEN_TYPE_OPERAND = 'Operand';
|
||||
const TOKEN_TYPE_FUNCTION = 'Function';
|
||||
const TOKEN_TYPE_SUBEXPRESSION = 'Subexpression';
|
||||
const TOKEN_TYPE_ARGUMENT = 'Argument';
|
||||
const TOKEN_TYPE_OPERATORPREFIX = 'OperatorPrefix';
|
||||
const TOKEN_TYPE_OPERATORINFIX = 'OperatorInfix';
|
||||
const TOKEN_TYPE_OPERATORPOSTFIX = 'OperatorPostfix';
|
||||
const TOKEN_TYPE_WHITESPACE = 'Whitespace';
|
||||
const TOKEN_TYPE_UNKNOWN = 'Unknown';
|
||||
|
||||
// Token subtypes
|
||||
const TOKEN_SUBTYPE_NOTHING = 'Nothing';
|
||||
const TOKEN_SUBTYPE_START = 'Start';
|
||||
const TOKEN_SUBTYPE_STOP = 'Stop';
|
||||
const TOKEN_SUBTYPE_TEXT = 'Text';
|
||||
const TOKEN_SUBTYPE_NUMBER = 'Number';
|
||||
const TOKEN_SUBTYPE_LOGICAL = 'Logical';
|
||||
const TOKEN_SUBTYPE_ERROR = 'Error';
|
||||
const TOKEN_SUBTYPE_RANGE = 'Range';
|
||||
const TOKEN_SUBTYPE_MATH = 'Math';
|
||||
const TOKEN_SUBTYPE_CONCATENATION = 'Concatenation';
|
||||
const TOKEN_SUBTYPE_INTERSECTION = 'Intersection';
|
||||
const TOKEN_SUBTYPE_UNION = 'Union';
|
||||
|
||||
/**
|
||||
* Value.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* Token Type (represented by TOKEN_TYPE_*).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $tokenType;
|
||||
|
||||
/**
|
||||
* Token SubType (represented by TOKEN_SUBTYPE_*).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $tokenSubType;
|
||||
|
||||
/**
|
||||
* Create a new FormulaToken.
|
||||
*
|
||||
* @param string $pValue
|
||||
* @param string $pTokenType Token type (represented by TOKEN_TYPE_*)
|
||||
* @param string $pTokenSubType Token Subtype (represented by TOKEN_SUBTYPE_*)
|
||||
*/
|
||||
public function __construct($pValue, $pTokenType = self::TOKEN_TYPE_UNKNOWN, $pTokenSubType = self::TOKEN_SUBTYPE_NOTHING)
|
||||
{
|
||||
// Initialise values
|
||||
$this->value = $pValue;
|
||||
$this->tokenType = $pTokenType;
|
||||
$this->tokenSubType = $pTokenSubType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Value.
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function setValue($value): void
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Token Type (represented by TOKEN_TYPE_*).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTokenType()
|
||||
{
|
||||
return $this->tokenType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Token Type (represented by TOKEN_TYPE_*).
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function setTokenType($value): void
|
||||
{
|
||||
$this->tokenType = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Token SubType (represented by TOKEN_SUBTYPE_*).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTokenSubType()
|
||||
{
|
||||
return $this->tokenSubType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Token SubType (represented by TOKEN_SUBTYPE_*).
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function setTokenSubType($value): void
|
||||
{
|
||||
$this->tokenSubType = $value;
|
||||
}
|
||||
}
|
@ -1,658 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
|
||||
class Functions
|
||||
{
|
||||
const PRECISION = 8.88E-016;
|
||||
|
||||
/**
|
||||
* 2 / PI.
|
||||
*/
|
||||
const M_2DIVPI = 0.63661977236758134307553505349006;
|
||||
|
||||
/** constants */
|
||||
const COMPATIBILITY_EXCEL = 'Excel';
|
||||
const COMPATIBILITY_GNUMERIC = 'Gnumeric';
|
||||
const COMPATIBILITY_OPENOFFICE = 'OpenOfficeCalc';
|
||||
|
||||
const RETURNDATE_PHP_NUMERIC = 'P';
|
||||
const RETURNDATE_UNIX_TIMESTAMP = 'P';
|
||||
const RETURNDATE_PHP_OBJECT = 'O';
|
||||
const RETURNDATE_PHP_DATETIME_OBJECT = 'O';
|
||||
const RETURNDATE_EXCEL = 'E';
|
||||
|
||||
/**
|
||||
* Compatibility mode to use for error checking and responses.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $compatibilityMode = self::COMPATIBILITY_EXCEL;
|
||||
|
||||
/**
|
||||
* Data Type to use when returning date values.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $returnDateType = self::RETURNDATE_EXCEL;
|
||||
|
||||
/**
|
||||
* List of error codes.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $errorCodes = [
|
||||
'null' => '#NULL!',
|
||||
'divisionbyzero' => '#DIV/0!',
|
||||
'value' => '#VALUE!',
|
||||
'reference' => '#REF!',
|
||||
'name' => '#NAME?',
|
||||
'num' => '#NUM!',
|
||||
'na' => '#N/A',
|
||||
'gettingdata' => '#GETTING_DATA',
|
||||
];
|
||||
|
||||
/**
|
||||
* Set the Compatibility Mode.
|
||||
*
|
||||
* @param string $compatibilityMode Compatibility Mode
|
||||
* Permitted values are:
|
||||
* Functions::COMPATIBILITY_EXCEL 'Excel'
|
||||
* Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
|
||||
* Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
|
||||
*
|
||||
* @return bool (Success or Failure)
|
||||
*/
|
||||
public static function setCompatibilityMode($compatibilityMode)
|
||||
{
|
||||
if (
|
||||
($compatibilityMode == self::COMPATIBILITY_EXCEL) ||
|
||||
($compatibilityMode == self::COMPATIBILITY_GNUMERIC) ||
|
||||
($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)
|
||||
) {
|
||||
self::$compatibilityMode = $compatibilityMode;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Compatibility Mode.
|
||||
*
|
||||
* @return string Compatibility Mode
|
||||
* Possible Return values are:
|
||||
* Functions::COMPATIBILITY_EXCEL 'Excel'
|
||||
* Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
|
||||
* Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
|
||||
*/
|
||||
public static function getCompatibilityMode()
|
||||
{
|
||||
return self::$compatibilityMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).
|
||||
*
|
||||
* @param string $returnDateType Return Date Format
|
||||
* Permitted values are:
|
||||
* Functions::RETURNDATE_UNIX_TIMESTAMP 'P'
|
||||
* Functions::RETURNDATE_PHP_DATETIME_OBJECT 'O'
|
||||
* Functions::RETURNDATE_EXCEL 'E'
|
||||
*
|
||||
* @return bool Success or failure
|
||||
*/
|
||||
public static function setReturnDateType($returnDateType)
|
||||
{
|
||||
if (
|
||||
($returnDateType == self::RETURNDATE_UNIX_TIMESTAMP) ||
|
||||
($returnDateType == self::RETURNDATE_PHP_DATETIME_OBJECT) ||
|
||||
($returnDateType == self::RETURNDATE_EXCEL)
|
||||
) {
|
||||
self::$returnDateType = $returnDateType;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).
|
||||
*
|
||||
* @return string Return Date Format
|
||||
* Possible Return values are:
|
||||
* Functions::RETURNDATE_UNIX_TIMESTAMP 'P'
|
||||
* Functions::RETURNDATE_PHP_DATETIME_OBJECT 'O'
|
||||
* Functions::RETURNDATE_EXCEL 'E'
|
||||
*/
|
||||
public static function getReturnDateType()
|
||||
{
|
||||
return self::$returnDateType;
|
||||
}
|
||||
|
||||
/**
|
||||
* DUMMY.
|
||||
*
|
||||
* @return string #Not Yet Implemented
|
||||
*/
|
||||
public static function DUMMY()
|
||||
{
|
||||
return '#Not Yet Implemented';
|
||||
}
|
||||
|
||||
/**
|
||||
* DIV0.
|
||||
*
|
||||
* @return string #Not Yet Implemented
|
||||
*/
|
||||
public static function DIV0()
|
||||
{
|
||||
return self::$errorCodes['divisionbyzero'];
|
||||
}
|
||||
|
||||
/**
|
||||
* NA.
|
||||
*
|
||||
* Excel Function:
|
||||
* =NA()
|
||||
*
|
||||
* Returns the error value #N/A
|
||||
* #N/A is the error value that means "no value is available."
|
||||
*
|
||||
* @return string #N/A!
|
||||
*/
|
||||
public static function NA()
|
||||
{
|
||||
return self::$errorCodes['na'];
|
||||
}
|
||||
|
||||
/**
|
||||
* NaN.
|
||||
*
|
||||
* Returns the error value #NUM!
|
||||
*
|
||||
* @return string #NUM!
|
||||
*/
|
||||
public static function NAN()
|
||||
{
|
||||
return self::$errorCodes['num'];
|
||||
}
|
||||
|
||||
/**
|
||||
* NAME.
|
||||
*
|
||||
* Returns the error value #NAME?
|
||||
*
|
||||
* @return string #NAME?
|
||||
*/
|
||||
public static function NAME()
|
||||
{
|
||||
return self::$errorCodes['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* REF.
|
||||
*
|
||||
* Returns the error value #REF!
|
||||
*
|
||||
* @return string #REF!
|
||||
*/
|
||||
public static function REF()
|
||||
{
|
||||
return self::$errorCodes['reference'];
|
||||
}
|
||||
|
||||
/**
|
||||
* NULL.
|
||||
*
|
||||
* Returns the error value #NULL!
|
||||
*
|
||||
* @return string #NULL!
|
||||
*/
|
||||
public static function null()
|
||||
{
|
||||
return self::$errorCodes['null'];
|
||||
}
|
||||
|
||||
/**
|
||||
* VALUE.
|
||||
*
|
||||
* Returns the error value #VALUE!
|
||||
*
|
||||
* @return string #VALUE!
|
||||
*/
|
||||
public static function VALUE()
|
||||
{
|
||||
return self::$errorCodes['value'];
|
||||
}
|
||||
|
||||
public static function isMatrixValue($idx)
|
||||
{
|
||||
return (substr_count($idx, '.') <= 1) || (preg_match('/\.[A-Z]/', $idx) > 0);
|
||||
}
|
||||
|
||||
public static function isValue($idx)
|
||||
{
|
||||
return substr_count($idx, '.') == 0;
|
||||
}
|
||||
|
||||
public static function isCellValue($idx)
|
||||
{
|
||||
return substr_count($idx, '.') > 1;
|
||||
}
|
||||
|
||||
public static function ifCondition($condition)
|
||||
{
|
||||
$condition = self::flattenSingleValue($condition);
|
||||
|
||||
if ($condition === '') {
|
||||
$condition = '=""';
|
||||
}
|
||||
|
||||
if (!is_string($condition) || !in_array($condition[0], ['>', '<', '='])) {
|
||||
if (!is_numeric($condition)) {
|
||||
$condition = Calculation::wrapResult(strtoupper($condition));
|
||||
}
|
||||
|
||||
return str_replace('""""', '""', '=' . $condition);
|
||||
}
|
||||
preg_match('/(=|<[>=]?|>=?)(.*)/', $condition, $matches);
|
||||
[, $operator, $operand] = $matches;
|
||||
|
||||
if (is_numeric(trim($operand, '"'))) {
|
||||
$operand = trim($operand, '"');
|
||||
} elseif (!is_numeric($operand)) {
|
||||
$operand = str_replace('"', '""', $operand);
|
||||
$operand = Calculation::wrapResult(strtoupper($operand));
|
||||
}
|
||||
|
||||
return str_replace('""""', '""', $operator . $operand);
|
||||
}
|
||||
|
||||
/**
|
||||
* ERROR_TYPE.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function errorType($value = '')
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
$i = 1;
|
||||
foreach (self::$errorCodes as $errorCode) {
|
||||
if ($value === $errorCode) {
|
||||
return $i;
|
||||
}
|
||||
++$i;
|
||||
}
|
||||
|
||||
return self::NA();
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_BLANK.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isBlank($value = null)
|
||||
{
|
||||
if ($value !== null) {
|
||||
$value = self::flattenSingleValue($value);
|
||||
}
|
||||
|
||||
return $value === null;
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_ERR.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isErr($value = '')
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
return self::isError($value) && (!self::isNa(($value)));
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_ERROR.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isError($value = '')
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
if (!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return in_array($value, self::$errorCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_NA.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isNa($value = '')
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
return $value === self::NA();
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_EVEN.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public static function isEven($value = null)
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
if ($value === null) {
|
||||
return self::NAME();
|
||||
} elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
|
||||
return self::VALUE();
|
||||
}
|
||||
|
||||
return $value % 2 == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_ODD.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public static function isOdd($value = null)
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
if ($value === null) {
|
||||
return self::NAME();
|
||||
} elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
|
||||
return self::VALUE();
|
||||
}
|
||||
|
||||
return abs($value) % 2 == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_NUMBER.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isNumber($value = null)
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
if (is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return is_numeric($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_LOGICAL.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isLogical($value = null)
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
return is_bool($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_TEXT.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isText($value = null)
|
||||
{
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
return is_string($value) && !self::isError($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* IS_NONTEXT.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isNonText($value = null)
|
||||
{
|
||||
return !self::isText($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* N.
|
||||
*
|
||||
* Returns a value converted to a number
|
||||
*
|
||||
* @param null|mixed $value The value you want converted
|
||||
*
|
||||
* @return number N converts values listed in the following table
|
||||
* If value is or refers to N returns
|
||||
* A number That number
|
||||
* A date The serial number of that date
|
||||
* TRUE 1
|
||||
* FALSE 0
|
||||
* An error value The error value
|
||||
* Anything else 0
|
||||
*/
|
||||
public static function n($value = null)
|
||||
{
|
||||
while (is_array($value)) {
|
||||
$value = array_shift($value);
|
||||
}
|
||||
|
||||
switch (gettype($value)) {
|
||||
case 'double':
|
||||
case 'float':
|
||||
case 'integer':
|
||||
return $value;
|
||||
case 'boolean':
|
||||
return (int) $value;
|
||||
case 'string':
|
||||
// Errors
|
||||
if ((strlen($value) > 0) && ($value[0] == '#')) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* TYPE.
|
||||
*
|
||||
* Returns a number that identifies the type of a value
|
||||
*
|
||||
* @param null|mixed $value The value you want tested
|
||||
*
|
||||
* @return number N converts values listed in the following table
|
||||
* If value is or refers to N returns
|
||||
* A number 1
|
||||
* Text 2
|
||||
* Logical Value 4
|
||||
* An error value 16
|
||||
* Array or Matrix 64
|
||||
*/
|
||||
public static function TYPE($value = null)
|
||||
{
|
||||
$value = self::flattenArrayIndexed($value);
|
||||
if (is_array($value) && (count($value) > 1)) {
|
||||
end($value);
|
||||
$a = key($value);
|
||||
// Range of cells is an error
|
||||
if (self::isCellValue($a)) {
|
||||
return 16;
|
||||
// Test for Matrix
|
||||
} elseif (self::isMatrixValue($a)) {
|
||||
return 64;
|
||||
}
|
||||
} elseif (empty($value)) {
|
||||
// Empty Cell
|
||||
return 1;
|
||||
}
|
||||
$value = self::flattenSingleValue($value);
|
||||
|
||||
if (($value === null) || (is_float($value)) || (is_int($value))) {
|
||||
return 1;
|
||||
} elseif (is_bool($value)) {
|
||||
return 4;
|
||||
} elseif (is_array($value)) {
|
||||
return 64;
|
||||
} elseif (is_string($value)) {
|
||||
// Errors
|
||||
if ((strlen($value) > 0) && ($value[0] == '#')) {
|
||||
return 16;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a multi-dimensional array to a simple 1-dimensional array.
|
||||
*
|
||||
* @param array $array Array to be flattened
|
||||
*
|
||||
* @return array Flattened array
|
||||
*/
|
||||
public static function flattenArray($array)
|
||||
{
|
||||
if (!is_array($array)) {
|
||||
return (array) $array;
|
||||
}
|
||||
|
||||
$arrayValues = [];
|
||||
foreach ($array as $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $val) {
|
||||
if (is_array($val)) {
|
||||
foreach ($val as $v) {
|
||||
$arrayValues[] = $v;
|
||||
}
|
||||
} else {
|
||||
$arrayValues[] = $val;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$arrayValues[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $arrayValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
|
||||
*
|
||||
* @param array $array Array to be flattened
|
||||
*
|
||||
* @return array Flattened array
|
||||
*/
|
||||
public static function flattenArrayIndexed($array)
|
||||
{
|
||||
if (!is_array($array)) {
|
||||
return (array) $array;
|
||||
}
|
||||
|
||||
$arrayValues = [];
|
||||
foreach ($array as $k1 => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $k2 => $val) {
|
||||
if (is_array($val)) {
|
||||
foreach ($val as $k3 => $v) {
|
||||
$arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v;
|
||||
}
|
||||
} else {
|
||||
$arrayValues[$k1 . '.' . $k2] = $val;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$arrayValues[$k1] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $arrayValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an array to a single scalar value by extracting the first element.
|
||||
*
|
||||
* @param mixed $value Array or scalar value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function flattenSingleValue($value = '')
|
||||
{
|
||||
while (is_array($value)) {
|
||||
$value = array_shift($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* ISFORMULA.
|
||||
*
|
||||
* @param mixed $cellReference The cell to check
|
||||
* @param Cell $pCell The current cell (containing this formula)
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public static function isFormula($cellReference = '', ?Cell $pCell = null)
|
||||
{
|
||||
if ($pCell === null) {
|
||||
return self::REF();
|
||||
}
|
||||
|
||||
preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches);
|
||||
|
||||
$cellReference = $matches[6] . $matches[7];
|
||||
$worksheetName = str_replace("''", "'", trim($matches[2], "'"));
|
||||
|
||||
$worksheet = (!empty($worksheetName))
|
||||
? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName)
|
||||
: $pCell->getWorksheet();
|
||||
|
||||
return $worksheet->getCell($cellReference)->isFormula();
|
||||
}
|
||||
}
|
@ -1,390 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
class Logical
|
||||
{
|
||||
/**
|
||||
* TRUE.
|
||||
*
|
||||
* Returns the boolean TRUE.
|
||||
*
|
||||
* Excel Function:
|
||||
* =TRUE()
|
||||
*
|
||||
* @return bool True
|
||||
*/
|
||||
public static function true()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* FALSE.
|
||||
*
|
||||
* Returns the boolean FALSE.
|
||||
*
|
||||
* Excel Function:
|
||||
* =FALSE()
|
||||
*
|
||||
* @return bool False
|
||||
*/
|
||||
public static function false()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function countTrueValues(array $args)
|
||||
{
|
||||
$returnValue = 0;
|
||||
|
||||
foreach ($args as $arg) {
|
||||
// Is it a boolean value?
|
||||
if (is_bool($arg)) {
|
||||
$returnValue += $arg;
|
||||
} elseif ((is_numeric($arg)) && (!is_string($arg))) {
|
||||
$returnValue += ((int) $arg != 0);
|
||||
} elseif (is_string($arg)) {
|
||||
$arg = strtoupper($arg);
|
||||
if (($arg == 'TRUE') || ($arg == Calculation::getTRUE())) {
|
||||
$arg = true;
|
||||
} elseif (($arg == 'FALSE') || ($arg == Calculation::getFALSE())) {
|
||||
$arg = false;
|
||||
} else {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
$returnValue += ($arg != 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* LOGICAL_AND.
|
||||
*
|
||||
* Returns boolean TRUE if all its arguments are TRUE; returns FALSE if one or more argument is FALSE.
|
||||
*
|
||||
* Excel Function:
|
||||
* =AND(logical1[,logical2[, ...]])
|
||||
*
|
||||
* The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
|
||||
* or references that contain logical values.
|
||||
*
|
||||
* Boolean arguments are treated as True or False as appropriate
|
||||
* Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
|
||||
* If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
|
||||
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
|
||||
*
|
||||
* @param mixed ...$args Data values
|
||||
*
|
||||
* @return bool|string the logical AND of the arguments
|
||||
*/
|
||||
public static function logicalAnd(...$args)
|
||||
{
|
||||
$args = Functions::flattenArray($args);
|
||||
|
||||
if (count($args) == 0) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
$args = array_filter($args, function ($value) {
|
||||
return $value !== null || (is_string($value) && trim($value) == '');
|
||||
});
|
||||
$argCount = count($args);
|
||||
|
||||
$returnValue = self::countTrueValues($args);
|
||||
if (is_string($returnValue)) {
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
return ($returnValue > 0) && ($returnValue == $argCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* LOGICAL_OR.
|
||||
*
|
||||
* Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
|
||||
*
|
||||
* Excel Function:
|
||||
* =OR(logical1[,logical2[, ...]])
|
||||
*
|
||||
* The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
|
||||
* or references that contain logical values.
|
||||
*
|
||||
* Boolean arguments are treated as True or False as appropriate
|
||||
* Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
|
||||
* If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
|
||||
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
|
||||
*
|
||||
* @param mixed $args Data values
|
||||
*
|
||||
* @return bool|string the logical OR of the arguments
|
||||
*/
|
||||
public static function logicalOr(...$args)
|
||||
{
|
||||
$args = Functions::flattenArray($args);
|
||||
|
||||
if (count($args) == 0) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
$args = array_filter($args, function ($value) {
|
||||
return $value !== null || (is_string($value) && trim($value) == '');
|
||||
});
|
||||
|
||||
$returnValue = self::countTrueValues($args);
|
||||
if (is_string($returnValue)) {
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
return $returnValue > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* LOGICAL_XOR.
|
||||
*
|
||||
* Returns the Exclusive Or logical operation for one or more supplied conditions.
|
||||
* i.e. the Xor function returns TRUE if an odd number of the supplied conditions evaluate to TRUE, and FALSE otherwise.
|
||||
*
|
||||
* Excel Function:
|
||||
* =XOR(logical1[,logical2[, ...]])
|
||||
*
|
||||
* The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
|
||||
* or references that contain logical values.
|
||||
*
|
||||
* Boolean arguments are treated as True or False as appropriate
|
||||
* Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
|
||||
* If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
|
||||
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
|
||||
*
|
||||
* @param mixed $args Data values
|
||||
*
|
||||
* @return bool|string the logical XOR of the arguments
|
||||
*/
|
||||
public static function logicalXor(...$args)
|
||||
{
|
||||
$args = Functions::flattenArray($args);
|
||||
|
||||
if (count($args) == 0) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
$args = array_filter($args, function ($value) {
|
||||
return $value !== null || (is_string($value) && trim($value) == '');
|
||||
});
|
||||
|
||||
$returnValue = self::countTrueValues($args);
|
||||
if (is_string($returnValue)) {
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
return $returnValue % 2 == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* NOT.
|
||||
*
|
||||
* Returns the boolean inverse of the argument.
|
||||
*
|
||||
* Excel Function:
|
||||
* =NOT(logical)
|
||||
*
|
||||
* The argument must evaluate to a logical value such as TRUE or FALSE
|
||||
*
|
||||
* Boolean arguments are treated as True or False as appropriate
|
||||
* Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
|
||||
* If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
|
||||
* the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
|
||||
*
|
||||
* @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE
|
||||
*
|
||||
* @return bool|string the boolean inverse of the argument
|
||||
*/
|
||||
public static function NOT($logical = false)
|
||||
{
|
||||
$logical = Functions::flattenSingleValue($logical);
|
||||
|
||||
if (is_string($logical)) {
|
||||
$logical = strtoupper($logical);
|
||||
if (($logical == 'TRUE') || ($logical == Calculation::getTRUE())) {
|
||||
return false;
|
||||
} elseif (($logical == 'FALSE') || ($logical == Calculation::getFALSE())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
return !$logical;
|
||||
}
|
||||
|
||||
/**
|
||||
* STATEMENT_IF.
|
||||
*
|
||||
* Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
|
||||
*
|
||||
* Excel Function:
|
||||
* =IF(condition[,returnIfTrue[,returnIfFalse]])
|
||||
*
|
||||
* Condition is any value or expression that can be evaluated to TRUE or FALSE.
|
||||
* For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
|
||||
* the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
|
||||
* This argument can use any comparison calculation operator.
|
||||
* ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
|
||||
* For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
|
||||
* then the IF function returns the text "Within budget"
|
||||
* If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
|
||||
* the logical value TRUE for this argument.
|
||||
* ReturnIfTrue can be another formula.
|
||||
* ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
|
||||
* For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
|
||||
* then the IF function returns the text "Over budget".
|
||||
* If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
|
||||
* If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
|
||||
* ReturnIfFalse can be another formula.
|
||||
*
|
||||
* @param mixed $condition Condition to evaluate
|
||||
* @param mixed $returnIfTrue Value to return when condition is true
|
||||
* @param mixed $returnIfFalse Optional value to return when condition is false
|
||||
*
|
||||
* @return mixed The value of returnIfTrue or returnIfFalse determined by condition
|
||||
*/
|
||||
public static function statementIf($condition = true, $returnIfTrue = 0, $returnIfFalse = false)
|
||||
{
|
||||
if (Functions::isError($condition)) {
|
||||
return $condition;
|
||||
}
|
||||
|
||||
$condition = ($condition === null) ? true : (bool) Functions::flattenSingleValue($condition);
|
||||
$returnIfTrue = ($returnIfTrue === null) ? 0 : Functions::flattenSingleValue($returnIfTrue);
|
||||
$returnIfFalse = ($returnIfFalse === null) ? false : Functions::flattenSingleValue($returnIfFalse);
|
||||
|
||||
return ($condition) ? $returnIfTrue : $returnIfFalse;
|
||||
}
|
||||
|
||||
/**
|
||||
* STATEMENT_SWITCH.
|
||||
*
|
||||
* Returns corresponding with first match (any data type such as a string, numeric, date, etc).
|
||||
*
|
||||
* Excel Function:
|
||||
* =SWITCH (expression, value1, result1, value2, result2, ... value_n, result_n [, default])
|
||||
*
|
||||
* Expression
|
||||
* The expression to compare to a list of values.
|
||||
* value1, value2, ... value_n
|
||||
* A list of values that are compared to expression. The SWITCH function is looking for the first value that matches the expression.
|
||||
* result1, result2, ... result_n
|
||||
* A list of results. The SWITCH function returns the corresponding result when a value matches expression.
|
||||
* default
|
||||
* Optional. It is the default to return if expression does not match any of the values (value1, value2, ... value_n).
|
||||
*
|
||||
* @param mixed $arguments Statement arguments
|
||||
*
|
||||
* @return mixed The value of matched expression
|
||||
*/
|
||||
public static function statementSwitch(...$arguments)
|
||||
{
|
||||
$result = Functions::VALUE();
|
||||
|
||||
if (count($arguments) > 0) {
|
||||
$targetValue = Functions::flattenSingleValue($arguments[0]);
|
||||
$argc = count($arguments) - 1;
|
||||
$switchCount = floor($argc / 2);
|
||||
$switchSatisfied = false;
|
||||
$hasDefaultClause = $argc % 2 !== 0;
|
||||
$defaultClause = $argc % 2 === 0 ? null : $arguments[count($arguments) - 1];
|
||||
|
||||
if ($switchCount) {
|
||||
for ($index = 0; $index < $switchCount; ++$index) {
|
||||
if ($targetValue == $arguments[$index * 2 + 1]) {
|
||||
$result = $arguments[$index * 2 + 2];
|
||||
$switchSatisfied = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$switchSatisfied) {
|
||||
$result = $hasDefaultClause ? $defaultClause : Functions::NA();
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* IFERROR.
|
||||
*
|
||||
* Excel Function:
|
||||
* =IFERROR(testValue,errorpart)
|
||||
*
|
||||
* @param mixed $testValue Value to check, is also the value returned when no error
|
||||
* @param mixed $errorpart Value to return when testValue is an error condition
|
||||
*
|
||||
* @return mixed The value of errorpart or testValue determined by error condition
|
||||
*/
|
||||
public static function IFERROR($testValue = '', $errorpart = '')
|
||||
{
|
||||
$testValue = ($testValue === null) ? '' : Functions::flattenSingleValue($testValue);
|
||||
$errorpart = ($errorpart === null) ? '' : Functions::flattenSingleValue($errorpart);
|
||||
|
||||
return self::statementIf(Functions::isError($testValue), $errorpart, $testValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* IFNA.
|
||||
*
|
||||
* Excel Function:
|
||||
* =IFNA(testValue,napart)
|
||||
*
|
||||
* @param mixed $testValue Value to check, is also the value returned when not an NA
|
||||
* @param mixed $napart Value to return when testValue is an NA condition
|
||||
*
|
||||
* @return mixed The value of errorpart or testValue determined by error condition
|
||||
*/
|
||||
public static function IFNA($testValue = '', $napart = '')
|
||||
{
|
||||
$testValue = ($testValue === null) ? '' : Functions::flattenSingleValue($testValue);
|
||||
$napart = ($napart === null) ? '' : Functions::flattenSingleValue($napart);
|
||||
|
||||
return self::statementIf(Functions::isNa($testValue), $napart, $testValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* IFS.
|
||||
*
|
||||
* Excel Function:
|
||||
* =IFS(testValue1;returnIfTrue1;testValue2;returnIfTrue2;...;testValue_n;returnIfTrue_n)
|
||||
*
|
||||
* testValue1 ... testValue_n
|
||||
* Conditions to Evaluate
|
||||
* returnIfTrue1 ... returnIfTrue_n
|
||||
* Value returned if corresponding testValue (nth) was true
|
||||
*
|
||||
* @param mixed ...$arguments Statement arguments
|
||||
*
|
||||
* @return mixed|string The value of returnIfTrue_n, if testValue_n was true. #N/A if none of testValues was true
|
||||
*/
|
||||
public static function IFS(...$arguments)
|
||||
{
|
||||
if (count($arguments) % 2 != 0) {
|
||||
return Functions::NA();
|
||||
}
|
||||
// We use instance of Exception as a falseValue in order to prevent string collision with value in cell
|
||||
$falseValueException = new Exception();
|
||||
for ($i = 0; $i < count($arguments); $i += 2) {
|
||||
$testValue = ($arguments[$i] === null) ? '' : Functions::flattenSingleValue($arguments[$i]);
|
||||
$returnIfTrue = ($arguments[$i + 1] === null) ? '' : Functions::flattenSingleValue($arguments[$i + 1]);
|
||||
$result = self::statementIf($testValue, $returnIfTrue, $falseValueException);
|
||||
|
||||
if ($result !== $falseValueException) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return Functions::NA();
|
||||
}
|
||||
}
|
@ -1,968 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class LookupRef
|
||||
{
|
||||
/**
|
||||
* CELL_ADDRESS.
|
||||
*
|
||||
* Creates a cell address as text, given specified row and column numbers.
|
||||
*
|
||||
* Excel Function:
|
||||
* =ADDRESS(row, column, [relativity], [referenceStyle], [sheetText])
|
||||
*
|
||||
* @param mixed $row Row number to use in the cell reference
|
||||
* @param mixed $column Column number to use in the cell reference
|
||||
* @param int $relativity Flag indicating the type of reference to return
|
||||
* 1 or omitted Absolute
|
||||
* 2 Absolute row; relative column
|
||||
* 3 Relative row; absolute column
|
||||
* 4 Relative
|
||||
* @param bool $referenceStyle A logical value that specifies the A1 or R1C1 reference style.
|
||||
* TRUE or omitted CELL_ADDRESS returns an A1-style reference
|
||||
* FALSE CELL_ADDRESS returns an R1C1-style reference
|
||||
* @param string $sheetText Optional Name of worksheet to use
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function cellAddress($row, $column, $relativity = 1, $referenceStyle = true, $sheetText = '')
|
||||
{
|
||||
$row = Functions::flattenSingleValue($row);
|
||||
$column = Functions::flattenSingleValue($column);
|
||||
$relativity = Functions::flattenSingleValue($relativity);
|
||||
$sheetText = Functions::flattenSingleValue($sheetText);
|
||||
|
||||
if (($row < 1) || ($column < 1)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if ($sheetText > '') {
|
||||
if (strpos($sheetText, ' ') !== false) {
|
||||
$sheetText = "'" . $sheetText . "'";
|
||||
}
|
||||
$sheetText .= '!';
|
||||
}
|
||||
if ((!is_bool($referenceStyle)) || $referenceStyle) {
|
||||
$rowRelative = $columnRelative = '$';
|
||||
$column = Coordinate::stringFromColumnIndex($column);
|
||||
if (($relativity == 2) || ($relativity == 4)) {
|
||||
$columnRelative = '';
|
||||
}
|
||||
if (($relativity == 3) || ($relativity == 4)) {
|
||||
$rowRelative = '';
|
||||
}
|
||||
|
||||
return $sheetText . $columnRelative . $column . $rowRelative . $row;
|
||||
}
|
||||
if (($relativity == 2) || ($relativity == 4)) {
|
||||
$column = '[' . $column . ']';
|
||||
}
|
||||
if (($relativity == 3) || ($relativity == 4)) {
|
||||
$row = '[' . $row . ']';
|
||||
}
|
||||
|
||||
return $sheetText . 'R' . $row . 'C' . $column;
|
||||
}
|
||||
|
||||
/**
|
||||
* COLUMN.
|
||||
*
|
||||
* Returns the column number of the given cell reference
|
||||
* If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array.
|
||||
* If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
|
||||
* reference of the cell in which the COLUMN function appears; otherwise this function returns 0.
|
||||
*
|
||||
* Excel Function:
|
||||
* =COLUMN([cellAddress])
|
||||
*
|
||||
* @param null|array|string $cellAddress A reference to a range of cells for which you want the column numbers
|
||||
*
|
||||
* @return int|int[]
|
||||
*/
|
||||
public static function COLUMN($cellAddress = null)
|
||||
{
|
||||
if ($cellAddress === null || trim($cellAddress) === '') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_array($cellAddress)) {
|
||||
foreach ($cellAddress as $columnKey => $value) {
|
||||
$columnKey = preg_replace('/[^a-z]/i', '', $columnKey);
|
||||
|
||||
return (int) Coordinate::columnIndexFromString($columnKey);
|
||||
}
|
||||
} else {
|
||||
[$sheet, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
|
||||
if (strpos($cellAddress, ':') !== false) {
|
||||
[$startAddress, $endAddress] = explode(':', $cellAddress);
|
||||
$startAddress = preg_replace('/[^a-z]/i', '', $startAddress);
|
||||
$endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
|
||||
$returnValue = [];
|
||||
do {
|
||||
$returnValue[] = (int) Coordinate::columnIndexFromString($startAddress);
|
||||
} while ($startAddress++ != $endAddress);
|
||||
|
||||
return $returnValue;
|
||||
}
|
||||
$cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
|
||||
|
||||
return (int) Coordinate::columnIndexFromString($cellAddress);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* COLUMNS.
|
||||
*
|
||||
* Returns the number of columns in an array or reference.
|
||||
*
|
||||
* Excel Function:
|
||||
* =COLUMNS(cellAddress)
|
||||
*
|
||||
* @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns
|
||||
*
|
||||
* @return int|string The number of columns in cellAddress, or a string if arguments are invalid
|
||||
*/
|
||||
public static function COLUMNS($cellAddress = null)
|
||||
{
|
||||
if ($cellAddress === null || $cellAddress === '') {
|
||||
return 1;
|
||||
} elseif (!is_array($cellAddress)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
reset($cellAddress);
|
||||
$isMatrix = (is_numeric(key($cellAddress)));
|
||||
[$columns, $rows] = Calculation::getMatrixDimensions($cellAddress);
|
||||
|
||||
if ($isMatrix) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* ROW.
|
||||
*
|
||||
* Returns the row number of the given cell reference
|
||||
* If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array.
|
||||
* If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
|
||||
* reference of the cell in which the ROW function appears; otherwise this function returns 0.
|
||||
*
|
||||
* Excel Function:
|
||||
* =ROW([cellAddress])
|
||||
*
|
||||
* @param null|array|string $cellAddress A reference to a range of cells for which you want the row numbers
|
||||
*
|
||||
* @return int|mixed[]|string
|
||||
*/
|
||||
public static function ROW($cellAddress = null)
|
||||
{
|
||||
if ($cellAddress === null || trim($cellAddress) === '') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_array($cellAddress)) {
|
||||
foreach ($cellAddress as $columnKey => $rowValue) {
|
||||
foreach ($rowValue as $rowKey => $cellValue) {
|
||||
return (int) preg_replace('/\D/', '', $rowKey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
[$sheet, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
|
||||
if (strpos($cellAddress, ':') !== false) {
|
||||
[$startAddress, $endAddress] = explode(':', $cellAddress);
|
||||
$startAddress = preg_replace('/\D/', '', $startAddress);
|
||||
$endAddress = preg_replace('/\D/', '', $endAddress);
|
||||
$returnValue = [];
|
||||
do {
|
||||
$returnValue[][] = (int) $startAddress;
|
||||
} while ($startAddress++ != $endAddress);
|
||||
|
||||
return $returnValue;
|
||||
}
|
||||
[$cellAddress] = explode(':', $cellAddress);
|
||||
|
||||
return (int) preg_replace('/\D/', '', $cellAddress);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ROWS.
|
||||
*
|
||||
* Returns the number of rows in an array or reference.
|
||||
*
|
||||
* Excel Function:
|
||||
* =ROWS(cellAddress)
|
||||
*
|
||||
* @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
|
||||
*
|
||||
* @return int|string The number of rows in cellAddress, or a string if arguments are invalid
|
||||
*/
|
||||
public static function ROWS($cellAddress = null)
|
||||
{
|
||||
if ($cellAddress === null || $cellAddress === '') {
|
||||
return 1;
|
||||
} elseif (!is_array($cellAddress)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
reset($cellAddress);
|
||||
$isMatrix = (is_numeric(key($cellAddress)));
|
||||
[$columns, $rows] = Calculation::getMatrixDimensions($cellAddress);
|
||||
|
||||
if ($isMatrix) {
|
||||
return $columns;
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* HYPERLINK.
|
||||
*
|
||||
* Excel Function:
|
||||
* =HYPERLINK(linkURL,displayName)
|
||||
*
|
||||
* @param string $linkURL Value to check, is also the value returned when no error
|
||||
* @param string $displayName Value to return when testValue is an error condition
|
||||
* @param Cell $pCell The cell to set the hyperlink in
|
||||
*
|
||||
* @return mixed The value of $displayName (or $linkURL if $displayName was blank)
|
||||
*/
|
||||
public static function HYPERLINK($linkURL = '', $displayName = null, ?Cell $pCell = null)
|
||||
{
|
||||
$linkURL = ($linkURL === null) ? '' : Functions::flattenSingleValue($linkURL);
|
||||
$displayName = ($displayName === null) ? '' : Functions::flattenSingleValue($displayName);
|
||||
|
||||
if ((!is_object($pCell)) || (trim($linkURL) == '')) {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
if ((is_object($displayName)) || trim($displayName) == '') {
|
||||
$displayName = $linkURL;
|
||||
}
|
||||
|
||||
$pCell->getHyperlink()->setUrl($linkURL);
|
||||
$pCell->getHyperlink()->setTooltip($displayName);
|
||||
|
||||
return $displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* INDIRECT.
|
||||
*
|
||||
* Returns the reference specified by a text string.
|
||||
* References are immediately evaluated to display their contents.
|
||||
*
|
||||
* Excel Function:
|
||||
* =INDIRECT(cellAddress)
|
||||
*
|
||||
* NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010
|
||||
*
|
||||
* @param null|array|string $cellAddress $cellAddress The cell address of the current cell (containing this formula)
|
||||
* @param Cell $pCell The current cell (containing this formula)
|
||||
*
|
||||
* @return mixed The cells referenced by cellAddress
|
||||
*
|
||||
* @TODO Support for the optional a1 parameter introduced in Excel 2010
|
||||
*/
|
||||
public static function INDIRECT($cellAddress = null, ?Cell $pCell = null)
|
||||
{
|
||||
$cellAddress = Functions::flattenSingleValue($cellAddress);
|
||||
if ($cellAddress === null || $cellAddress === '') {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
$cellAddress1 = $cellAddress;
|
||||
$cellAddress2 = null;
|
||||
if (strpos($cellAddress, ':') !== false) {
|
||||
[$cellAddress1, $cellAddress2] = explode(':', $cellAddress);
|
||||
}
|
||||
|
||||
if (
|
||||
(!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress1, $matches)) ||
|
||||
(($cellAddress2 !== null) && (!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress2, $matches)))
|
||||
) {
|
||||
if (!preg_match('/^' . Calculation::CALCULATION_REGEXP_DEFINEDNAME . '$/i', $cellAddress1, $matches)) {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
if (strpos($cellAddress, '!') !== false) {
|
||||
[$sheetName, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
|
||||
$sheetName = trim($sheetName, "'");
|
||||
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
||||
} else {
|
||||
$pSheet = $pCell->getWorksheet();
|
||||
}
|
||||
|
||||
return Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
|
||||
}
|
||||
|
||||
if (strpos($cellAddress, '!') !== false) {
|
||||
[$sheetName, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
|
||||
$sheetName = trim($sheetName, "'");
|
||||
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
||||
} else {
|
||||
$pSheet = $pCell->getWorksheet();
|
||||
}
|
||||
|
||||
return Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* OFFSET.
|
||||
*
|
||||
* Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells.
|
||||
* The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and
|
||||
* the number of columns to be returned.
|
||||
*
|
||||
* Excel Function:
|
||||
* =OFFSET(cellAddress, rows, cols, [height], [width])
|
||||
*
|
||||
* @param null|string $cellAddress The reference from which you want to base the offset. Reference must refer to a cell or
|
||||
* range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.
|
||||
* @param mixed $rows The number of rows, up or down, that you want the upper-left cell to refer to.
|
||||
* Using 5 as the rows argument specifies that the upper-left cell in the reference is
|
||||
* five rows below reference. Rows can be positive (which means below the starting reference)
|
||||
* or negative (which means above the starting reference).
|
||||
* @param mixed $columns The number of columns, to the left or right, that you want the upper-left cell of the result
|
||||
* to refer to. Using 5 as the cols argument specifies that the upper-left cell in the
|
||||
* reference is five columns to the right of reference. Cols can be positive (which means
|
||||
* to the right of the starting reference) or negative (which means to the left of the
|
||||
* starting reference).
|
||||
* @param mixed $height The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
|
||||
* @param mixed $width The width, in number of columns, that you want the returned reference to be. Width must be a positive number.
|
||||
*
|
||||
* @return string A reference to a cell or range of cells
|
||||
*/
|
||||
public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, ?Cell $pCell = null)
|
||||
{
|
||||
$rows = Functions::flattenSingleValue($rows);
|
||||
$columns = Functions::flattenSingleValue($columns);
|
||||
$height = Functions::flattenSingleValue($height);
|
||||
$width = Functions::flattenSingleValue($width);
|
||||
if ($cellAddress === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!is_object($pCell)) {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
$sheetName = null;
|
||||
if (strpos($cellAddress, '!')) {
|
||||
[$sheetName, $cellAddress] = Worksheet::extractSheetTitle($cellAddress, true);
|
||||
$sheetName = trim($sheetName, "'");
|
||||
}
|
||||
if (strpos($cellAddress, ':')) {
|
||||
[$startCell, $endCell] = explode(':', $cellAddress);
|
||||
} else {
|
||||
$startCell = $endCell = $cellAddress;
|
||||
}
|
||||
[$startCellColumn, $startCellRow] = Coordinate::coordinateFromString($startCell);
|
||||
[$endCellColumn, $endCellRow] = Coordinate::coordinateFromString($endCell);
|
||||
|
||||
$startCellRow += $rows;
|
||||
$startCellColumn = Coordinate::columnIndexFromString($startCellColumn) - 1;
|
||||
$startCellColumn += $columns;
|
||||
|
||||
if (($startCellRow <= 0) || ($startCellColumn < 0)) {
|
||||
return Functions::REF();
|
||||
}
|
||||
$endCellColumn = Coordinate::columnIndexFromString($endCellColumn) - 1;
|
||||
if (($width != null) && (!is_object($width))) {
|
||||
$endCellColumn = $startCellColumn + $width - 1;
|
||||
} else {
|
||||
$endCellColumn += $columns;
|
||||
}
|
||||
$startCellColumn = Coordinate::stringFromColumnIndex($startCellColumn + 1);
|
||||
|
||||
if (($height != null) && (!is_object($height))) {
|
||||
$endCellRow = $startCellRow + $height - 1;
|
||||
} else {
|
||||
$endCellRow += $rows;
|
||||
}
|
||||
|
||||
if (($endCellRow <= 0) || ($endCellColumn < 0)) {
|
||||
return Functions::REF();
|
||||
}
|
||||
$endCellColumn = Coordinate::stringFromColumnIndex($endCellColumn + 1);
|
||||
|
||||
$cellAddress = $startCellColumn . $startCellRow;
|
||||
if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) {
|
||||
$cellAddress .= ':' . $endCellColumn . $endCellRow;
|
||||
}
|
||||
|
||||
if ($sheetName !== null) {
|
||||
$pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
|
||||
} else {
|
||||
$pSheet = $pCell->getWorksheet();
|
||||
}
|
||||
|
||||
return Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* CHOOSE.
|
||||
*
|
||||
* Uses lookup_value to return a value from the list of value arguments.
|
||||
* Use CHOOSE to select one of up to 254 values based on the lookup_value.
|
||||
*
|
||||
* Excel Function:
|
||||
* =CHOOSE(index_num, value1, [value2], ...)
|
||||
*
|
||||
* @return mixed The selected value
|
||||
*/
|
||||
public static function CHOOSE(...$chooseArgs)
|
||||
{
|
||||
$chosenEntry = Functions::flattenArray(array_shift($chooseArgs));
|
||||
$entryCount = count($chooseArgs) - 1;
|
||||
|
||||
if (is_array($chosenEntry)) {
|
||||
$chosenEntry = array_shift($chosenEntry);
|
||||
}
|
||||
if ((is_numeric($chosenEntry)) && (!is_bool($chosenEntry))) {
|
||||
--$chosenEntry;
|
||||
} else {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
$chosenEntry = floor($chosenEntry);
|
||||
if (($chosenEntry < 0) || ($chosenEntry > $entryCount)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if (is_array($chooseArgs[$chosenEntry])) {
|
||||
return Functions::flattenArray($chooseArgs[$chosenEntry]);
|
||||
}
|
||||
|
||||
return $chooseArgs[$chosenEntry];
|
||||
}
|
||||
|
||||
/**
|
||||
* MATCH.
|
||||
*
|
||||
* The MATCH function searches for a specified item in a range of cells
|
||||
*
|
||||
* Excel Function:
|
||||
* =MATCH(lookup_value, lookup_array, [match_type])
|
||||
*
|
||||
* @param mixed $lookupValue The value that you want to match in lookup_array
|
||||
* @param mixed $lookupArray The range of cells being searched
|
||||
* @param mixed $matchType The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below.
|
||||
* If match_type is 1 or -1, the list has to be ordered.
|
||||
*
|
||||
* @return int|string The relative position of the found item
|
||||
*/
|
||||
public static function MATCH($lookupValue, $lookupArray, $matchType = 1)
|
||||
{
|
||||
$lookupArray = Functions::flattenArray($lookupArray);
|
||||
$lookupValue = Functions::flattenSingleValue($lookupValue);
|
||||
$matchType = ($matchType === null) ? 1 : (int) Functions::flattenSingleValue($matchType);
|
||||
|
||||
// MATCH is not case sensitive, so we convert lookup value to be lower cased in case it's string type.
|
||||
if (is_string($lookupValue)) {
|
||||
$lookupValue = StringHelper::strToLower($lookupValue);
|
||||
}
|
||||
|
||||
// Lookup_value type has to be number, text, or logical values
|
||||
if ((!is_numeric($lookupValue)) && (!is_string($lookupValue)) && (!is_bool($lookupValue))) {
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
// Match_type is 0, 1 or -1
|
||||
if (($matchType !== 0) && ($matchType !== -1) && ($matchType !== 1)) {
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
// Lookup_array should not be empty
|
||||
$lookupArraySize = count($lookupArray);
|
||||
if ($lookupArraySize <= 0) {
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
if ($matchType == 1) {
|
||||
// If match_type is 1 the list has to be processed from last to first
|
||||
|
||||
$lookupArray = array_reverse($lookupArray);
|
||||
$keySet = array_reverse(array_keys($lookupArray));
|
||||
}
|
||||
|
||||
// Lookup_array should contain only number, text, or logical values, or empty (null) cells
|
||||
foreach ($lookupArray as $i => $lookupArrayValue) {
|
||||
// check the type of the value
|
||||
if (
|
||||
(!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) &&
|
||||
(!is_bool($lookupArrayValue)) && ($lookupArrayValue !== null)
|
||||
) {
|
||||
return Functions::NA();
|
||||
}
|
||||
// Convert strings to lowercase for case-insensitive testing
|
||||
if (is_string($lookupArrayValue)) {
|
||||
$lookupArray[$i] = StringHelper::strToLower($lookupArrayValue);
|
||||
}
|
||||
if (($lookupArrayValue === null) && (($matchType == 1) || ($matchType == -1))) {
|
||||
unset($lookupArray[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
// **
|
||||
// find the match
|
||||
// **
|
||||
|
||||
if ($matchType === 0 || $matchType === 1) {
|
||||
foreach ($lookupArray as $i => $lookupArrayValue) {
|
||||
$typeMatch = ((gettype($lookupValue) === gettype($lookupArrayValue)) || (is_numeric($lookupValue) && is_numeric($lookupArrayValue)));
|
||||
$exactTypeMatch = $typeMatch && $lookupArrayValue === $lookupValue;
|
||||
$nonOnlyNumericExactMatch = !$typeMatch && $lookupArrayValue === $lookupValue;
|
||||
$exactMatch = $exactTypeMatch || $nonOnlyNumericExactMatch;
|
||||
|
||||
if ($matchType === 0) {
|
||||
if ($typeMatch && is_string($lookupValue) && (bool) preg_match('/([\?\*])/', $lookupValue)) {
|
||||
$splitString = $lookupValue;
|
||||
$chars = array_map(function ($i) use ($splitString) {
|
||||
return mb_substr($splitString, $i, 1);
|
||||
}, range(0, mb_strlen($splitString) - 1));
|
||||
|
||||
$length = count($chars);
|
||||
$pattern = '/^';
|
||||
for ($j = 0; $j < $length; ++$j) {
|
||||
if ($chars[$j] === '~') {
|
||||
if (isset($chars[$j + 1])) {
|
||||
if ($chars[$j + 1] === '*') {
|
||||
$pattern .= preg_quote($chars[$j + 1], '/');
|
||||
++$j;
|
||||
} elseif ($chars[$j + 1] === '?') {
|
||||
$pattern .= preg_quote($chars[$j + 1], '/');
|
||||
++$j;
|
||||
}
|
||||
} else {
|
||||
$pattern .= preg_quote($chars[$j], '/');
|
||||
}
|
||||
} elseif ($chars[$j] === '*') {
|
||||
$pattern .= '.*';
|
||||
} elseif ($chars[$j] === '?') {
|
||||
$pattern .= '.{1}';
|
||||
} else {
|
||||
$pattern .= preg_quote($chars[$j], '/');
|
||||
}
|
||||
}
|
||||
|
||||
$pattern .= '$/';
|
||||
if ((bool) preg_match($pattern, $lookupArrayValue)) {
|
||||
// exact match
|
||||
return $i + 1;
|
||||
}
|
||||
} elseif ($exactMatch) {
|
||||
// exact match
|
||||
return $i + 1;
|
||||
}
|
||||
} elseif (($matchType === 1) && $typeMatch && ($lookupArrayValue <= $lookupValue)) {
|
||||
$i = array_search($i, $keySet);
|
||||
|
||||
// The current value is the (first) match
|
||||
return $i + 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$maxValueKey = null;
|
||||
|
||||
// The basic algorithm is:
|
||||
// Iterate and keep the highest match until the next element is smaller than the searched value.
|
||||
// Return immediately if perfect match is found
|
||||
foreach ($lookupArray as $i => $lookupArrayValue) {
|
||||
$typeMatch = gettype($lookupValue) === gettype($lookupArrayValue);
|
||||
$exactTypeMatch = $typeMatch && $lookupArrayValue === $lookupValue;
|
||||
$nonOnlyNumericExactMatch = !$typeMatch && $lookupArrayValue === $lookupValue;
|
||||
$exactMatch = $exactTypeMatch || $nonOnlyNumericExactMatch;
|
||||
|
||||
if ($exactMatch) {
|
||||
// Another "special" case. If a perfect match is found,
|
||||
// the algorithm gives up immediately
|
||||
return $i + 1;
|
||||
} elseif ($typeMatch & $lookupArrayValue >= $lookupValue) {
|
||||
$maxValueKey = $i + 1;
|
||||
} elseif ($typeMatch & $lookupArrayValue < $lookupValue) {
|
||||
//Excel algorithm gives up immediately if the first element is smaller than the searched value
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($maxValueKey !== null) {
|
||||
return $maxValueKey;
|
||||
}
|
||||
}
|
||||
|
||||
// Unsuccessful in finding a match, return #N/A error value
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
/**
|
||||
* INDEX.
|
||||
*
|
||||
* Uses an index to choose a value from a reference or array
|
||||
*
|
||||
* Excel Function:
|
||||
* =INDEX(range_array, row_num, [column_num])
|
||||
*
|
||||
* @param mixed $arrayValues A range of cells or an array constant
|
||||
* @param mixed $rowNum The row in array from which to return a value. If row_num is omitted, column_num is required.
|
||||
* @param mixed $columnNum The column in array from which to return a value. If column_num is omitted, row_num is required.
|
||||
*
|
||||
* @return mixed the value of a specified cell or array of cells
|
||||
*/
|
||||
public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0)
|
||||
{
|
||||
$rowNum = Functions::flattenSingleValue($rowNum);
|
||||
$columnNum = Functions::flattenSingleValue($columnNum);
|
||||
|
||||
if (($rowNum < 0) || ($columnNum < 0)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if (!is_array($arrayValues) || ($rowNum > count($arrayValues))) {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
$rowKeys = array_keys($arrayValues);
|
||||
$columnKeys = @array_keys($arrayValues[$rowKeys[0]]);
|
||||
|
||||
if ($columnNum > count($columnKeys)) {
|
||||
return Functions::VALUE();
|
||||
} elseif ($columnNum == 0) {
|
||||
if ($rowNum == 0) {
|
||||
return $arrayValues;
|
||||
}
|
||||
$rowNum = $rowKeys[--$rowNum];
|
||||
$returnArray = [];
|
||||
foreach ($arrayValues as $arrayColumn) {
|
||||
if (is_array($arrayColumn)) {
|
||||
if (isset($arrayColumn[$rowNum])) {
|
||||
$returnArray[] = $arrayColumn[$rowNum];
|
||||
} else {
|
||||
return [$rowNum => $arrayValues[$rowNum]];
|
||||
}
|
||||
} else {
|
||||
return $arrayValues[$rowNum];
|
||||
}
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
$columnNum = $columnKeys[--$columnNum];
|
||||
if ($rowNum > count($rowKeys)) {
|
||||
return Functions::VALUE();
|
||||
} elseif ($rowNum == 0) {
|
||||
return $arrayValues[$columnNum];
|
||||
}
|
||||
$rowNum = $rowKeys[--$rowNum];
|
||||
|
||||
return $arrayValues[$rowNum][$columnNum];
|
||||
}
|
||||
|
||||
/**
|
||||
* TRANSPOSE.
|
||||
*
|
||||
* @param array $matrixData A matrix of values
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix
|
||||
*/
|
||||
public static function TRANSPOSE($matrixData)
|
||||
{
|
||||
$returnMatrix = [];
|
||||
if (!is_array($matrixData)) {
|
||||
$matrixData = [[$matrixData]];
|
||||
}
|
||||
|
||||
$column = 0;
|
||||
foreach ($matrixData as $matrixRow) {
|
||||
$row = 0;
|
||||
foreach ($matrixRow as $matrixCell) {
|
||||
$returnMatrix[$row][$column] = $matrixCell;
|
||||
++$row;
|
||||
}
|
||||
++$column;
|
||||
}
|
||||
|
||||
return $returnMatrix;
|
||||
}
|
||||
|
||||
private static function vlookupSort($a, $b)
|
||||
{
|
||||
reset($a);
|
||||
$firstColumn = key($a);
|
||||
$aLower = StringHelper::strToLower($a[$firstColumn]);
|
||||
$bLower = StringHelper::strToLower($b[$firstColumn]);
|
||||
if ($aLower == $bLower) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($aLower < $bLower) ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* VLOOKUP
|
||||
* The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.
|
||||
*
|
||||
* @param mixed $lookup_value The value that you want to match in lookup_array
|
||||
* @param mixed $lookup_array The range of cells being searched
|
||||
* @param mixed $index_number The column number in table_array from which the matching value must be returned. The first column is 1.
|
||||
* @param mixed $not_exact_match determines if you are looking for an exact match based on lookup_value
|
||||
*
|
||||
* @return mixed The value of the found cell
|
||||
*/
|
||||
public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
|
||||
{
|
||||
$lookup_value = Functions::flattenSingleValue($lookup_value);
|
||||
$index_number = Functions::flattenSingleValue($index_number);
|
||||
$not_exact_match = Functions::flattenSingleValue($not_exact_match);
|
||||
|
||||
// index_number must be greater than or equal to 1
|
||||
if ($index_number < 1) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
// index_number must be less than or equal to the number of columns in lookup_array
|
||||
if ((!is_array($lookup_array)) || (empty($lookup_array))) {
|
||||
return Functions::REF();
|
||||
}
|
||||
$f = array_keys($lookup_array);
|
||||
$firstRow = array_pop($f);
|
||||
if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
|
||||
return Functions::REF();
|
||||
}
|
||||
$columnKeys = array_keys($lookup_array[$firstRow]);
|
||||
$returnColumn = $columnKeys[--$index_number];
|
||||
$firstColumn = array_shift($columnKeys);
|
||||
|
||||
if (!$not_exact_match) {
|
||||
uasort($lookup_array, ['self', 'vlookupSort']);
|
||||
}
|
||||
|
||||
$lookupLower = StringHelper::strToLower($lookup_value);
|
||||
$rowNumber = $rowValue = false;
|
||||
foreach ($lookup_array as $rowKey => $rowData) {
|
||||
$firstLower = StringHelper::strToLower($rowData[$firstColumn]);
|
||||
|
||||
// break if we have passed possible keys
|
||||
if (
|
||||
(is_numeric($lookup_value) && is_numeric($rowData[$firstColumn]) && ($rowData[$firstColumn] > $lookup_value)) ||
|
||||
(!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && ($firstLower > $lookupLower))
|
||||
) {
|
||||
break;
|
||||
}
|
||||
// remember the last key, but only if datatypes match
|
||||
if (
|
||||
(is_numeric($lookup_value) && is_numeric($rowData[$firstColumn])) ||
|
||||
(!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]))
|
||||
) {
|
||||
if ($not_exact_match) {
|
||||
$rowNumber = $rowKey;
|
||||
|
||||
continue;
|
||||
} elseif (
|
||||
($firstLower == $lookupLower)
|
||||
// Spreadsheets software returns first exact match,
|
||||
// we have sorted and we might have broken key orders
|
||||
// we want the first one (by its initial index)
|
||||
&& (($rowNumber == false) || ($rowKey < $rowNumber))
|
||||
) {
|
||||
$rowNumber = $rowKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($rowNumber !== false) {
|
||||
// return the appropriate value
|
||||
return $lookup_array[$rowNumber][$returnColumn];
|
||||
}
|
||||
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
/**
|
||||
* HLOOKUP
|
||||
* The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.
|
||||
*
|
||||
* @param mixed $lookup_value The value that you want to match in lookup_array
|
||||
* @param mixed $lookup_array The range of cells being searched
|
||||
* @param mixed $index_number The row number in table_array from which the matching value must be returned. The first row is 1.
|
||||
* @param mixed $not_exact_match determines if you are looking for an exact match based on lookup_value
|
||||
*
|
||||
* @return mixed The value of the found cell
|
||||
*/
|
||||
public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
|
||||
{
|
||||
$lookup_value = Functions::flattenSingleValue($lookup_value);
|
||||
$index_number = Functions::flattenSingleValue($index_number);
|
||||
$not_exact_match = Functions::flattenSingleValue($not_exact_match);
|
||||
|
||||
// index_number must be greater than or equal to 1
|
||||
if ($index_number < 1) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
// index_number must be less than or equal to the number of columns in lookup_array
|
||||
if ((!is_array($lookup_array)) || (empty($lookup_array))) {
|
||||
return Functions::REF();
|
||||
}
|
||||
$f = array_keys($lookup_array);
|
||||
$firstRow = reset($f);
|
||||
if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array))) {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
$firstkey = $f[0] - 1;
|
||||
$returnColumn = $firstkey + $index_number;
|
||||
$firstColumn = array_shift($f);
|
||||
$rowNumber = null;
|
||||
foreach ($lookup_array[$firstColumn] as $rowKey => $rowData) {
|
||||
// break if we have passed possible keys
|
||||
$bothNumeric = is_numeric($lookup_value) && is_numeric($rowData);
|
||||
$bothNotNumeric = !is_numeric($lookup_value) && !is_numeric($rowData);
|
||||
$lookupLower = StringHelper::strToLower($lookup_value);
|
||||
$rowDataLower = StringHelper::strToLower($rowData);
|
||||
|
||||
if (
|
||||
$not_exact_match && (
|
||||
($bothNumeric && $rowData > $lookup_value) ||
|
||||
($bothNotNumeric && $rowDataLower > $lookupLower)
|
||||
)
|
||||
) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Remember the last key, but only if datatypes match (as in VLOOKUP)
|
||||
if ($bothNumeric || $bothNotNumeric) {
|
||||
if ($not_exact_match) {
|
||||
$rowNumber = $rowKey;
|
||||
|
||||
continue;
|
||||
} elseif (
|
||||
$rowDataLower === $lookupLower
|
||||
&& ($rowNumber === null || $rowKey < $rowNumber)
|
||||
) {
|
||||
$rowNumber = $rowKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($rowNumber !== null) {
|
||||
// otherwise return the appropriate value
|
||||
return $lookup_array[$returnColumn][$rowNumber];
|
||||
}
|
||||
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
/**
|
||||
* LOOKUP
|
||||
* The LOOKUP function searches for value either from a one-row or one-column range or from an array.
|
||||
*
|
||||
* @param mixed $lookup_value The value that you want to match in lookup_array
|
||||
* @param mixed $lookup_vector The range of cells being searched
|
||||
* @param null|mixed $result_vector The column from which the matching value must be returned
|
||||
*
|
||||
* @return mixed The value of the found cell
|
||||
*/
|
||||
public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null)
|
||||
{
|
||||
$lookup_value = Functions::flattenSingleValue($lookup_value);
|
||||
|
||||
if (!is_array($lookup_vector)) {
|
||||
return Functions::NA();
|
||||
}
|
||||
$hasResultVector = isset($result_vector);
|
||||
$lookupRows = count($lookup_vector);
|
||||
$l = array_keys($lookup_vector);
|
||||
$l = array_shift($l);
|
||||
$lookupColumns = count($lookup_vector[$l]);
|
||||
// we correctly orient our results
|
||||
if (($lookupRows === 1 && $lookupColumns > 1) || (!$hasResultVector && $lookupRows === 2 && $lookupColumns !== 2)) {
|
||||
$lookup_vector = self::TRANSPOSE($lookup_vector);
|
||||
$lookupRows = count($lookup_vector);
|
||||
$l = array_keys($lookup_vector);
|
||||
$lookupColumns = count($lookup_vector[array_shift($l)]);
|
||||
}
|
||||
|
||||
if ($result_vector === null) {
|
||||
$result_vector = $lookup_vector;
|
||||
}
|
||||
$resultRows = count($result_vector);
|
||||
$l = array_keys($result_vector);
|
||||
$l = array_shift($l);
|
||||
$resultColumns = count($result_vector[$l]);
|
||||
// we correctly orient our results
|
||||
if ($resultRows === 1 && $resultColumns > 1) {
|
||||
$result_vector = self::TRANSPOSE($result_vector);
|
||||
$resultRows = count($result_vector);
|
||||
$r = array_keys($result_vector);
|
||||
$resultColumns = count($result_vector[array_shift($r)]);
|
||||
}
|
||||
|
||||
if ($lookupRows === 2 && !$hasResultVector) {
|
||||
$result_vector = array_pop($lookup_vector);
|
||||
$lookup_vector = array_shift($lookup_vector);
|
||||
}
|
||||
|
||||
if ($lookupColumns !== 2) {
|
||||
foreach ($lookup_vector as &$value) {
|
||||
if (is_array($value)) {
|
||||
$k = array_keys($value);
|
||||
$key1 = $key2 = array_shift($k);
|
||||
++$key2;
|
||||
$dataValue1 = $value[$key1];
|
||||
} else {
|
||||
$key1 = 0;
|
||||
$key2 = 1;
|
||||
$dataValue1 = $value;
|
||||
}
|
||||
$dataValue2 = array_shift($result_vector);
|
||||
if (is_array($dataValue2)) {
|
||||
$dataValue2 = array_shift($dataValue2);
|
||||
}
|
||||
$value = [$key1 => $dataValue1, $key2 => $dataValue2];
|
||||
}
|
||||
unset($value);
|
||||
}
|
||||
|
||||
return self::VLOOKUP($lookup_value, $lookup_vector, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* FORMULATEXT.
|
||||
*
|
||||
* @param mixed $cellReference The cell to check
|
||||
* @param Cell $pCell The current cell (containing this formula)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function FORMULATEXT($cellReference = '', ?Cell $pCell = null)
|
||||
{
|
||||
if ($pCell === null) {
|
||||
return Functions::REF();
|
||||
}
|
||||
|
||||
preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches);
|
||||
|
||||
$cellReference = $matches[6] . $matches[7];
|
||||
$worksheetName = trim($matches[3], "'");
|
||||
$worksheet = (!empty($worksheetName))
|
||||
? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName)
|
||||
: $pCell->getWorksheet();
|
||||
|
||||
if (!$worksheet->getCell($cellReference)->isFormula()) {
|
||||
return Functions::NA();
|
||||
}
|
||||
|
||||
return $worksheet->getCell($cellReference)->getValue();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,675 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
use DateTimeInterface;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class TextData
|
||||
{
|
||||
private static $invalidChars;
|
||||
|
||||
private static function unicodeToOrd($character)
|
||||
{
|
||||
return unpack('V', iconv('UTF-8', 'UCS-4LE', $character))[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* CHARACTER.
|
||||
*
|
||||
* @param string $character Value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function CHARACTER($character)
|
||||
{
|
||||
$character = Functions::flattenSingleValue($character);
|
||||
|
||||
if ((!is_numeric($character)) || ($character < 0)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if (function_exists('iconv')) {
|
||||
return iconv('UCS-4LE', 'UTF-8', pack('V', $character));
|
||||
}
|
||||
|
||||
return mb_convert_encoding('&#' . (int) $character . ';', 'UTF-8', 'HTML-ENTITIES');
|
||||
}
|
||||
|
||||
/**
|
||||
* TRIMNONPRINTABLE.
|
||||
*
|
||||
* @param mixed $stringValue Value to check
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function TRIMNONPRINTABLE($stringValue = '')
|
||||
{
|
||||
$stringValue = Functions::flattenSingleValue($stringValue);
|
||||
|
||||
if (is_bool($stringValue)) {
|
||||
return ($stringValue) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
if (self::$invalidChars === null) {
|
||||
self::$invalidChars = range(chr(0), chr(31));
|
||||
}
|
||||
|
||||
if (is_string($stringValue) || is_numeric($stringValue)) {
|
||||
return str_replace(self::$invalidChars, '', trim($stringValue, "\x00..\x1F"));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* TRIMSPACES.
|
||||
*
|
||||
* @param mixed $stringValue Value to check
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function TRIMSPACES($stringValue = '')
|
||||
{
|
||||
$stringValue = Functions::flattenSingleValue($stringValue);
|
||||
if (is_bool($stringValue)) {
|
||||
return ($stringValue) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
if (is_string($stringValue) || is_numeric($stringValue)) {
|
||||
return trim(preg_replace('/ +/', ' ', trim($stringValue, ' ')), ' ');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static function convertBooleanValue($value)
|
||||
{
|
||||
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
return ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
/**
|
||||
* ASCIICODE.
|
||||
*
|
||||
* @param string $characters Value
|
||||
*
|
||||
* @return int|string A string if arguments are invalid
|
||||
*/
|
||||
public static function ASCIICODE($characters)
|
||||
{
|
||||
if (($characters === null) || ($characters === '')) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
$characters = Functions::flattenSingleValue($characters);
|
||||
if (is_bool($characters)) {
|
||||
$characters = self::convertBooleanValue($characters);
|
||||
}
|
||||
|
||||
$character = $characters;
|
||||
if (mb_strlen($characters, 'UTF-8') > 1) {
|
||||
$character = mb_substr($characters, 0, 1, 'UTF-8');
|
||||
}
|
||||
|
||||
return self::unicodeToOrd($character);
|
||||
}
|
||||
|
||||
/**
|
||||
* CONCATENATE.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function CONCATENATE(...$args)
|
||||
{
|
||||
$returnValue = '';
|
||||
|
||||
// Loop through arguments
|
||||
$aArgs = Functions::flattenArray($args);
|
||||
foreach ($aArgs as $arg) {
|
||||
if (is_bool($arg)) {
|
||||
$arg = self::convertBooleanValue($arg);
|
||||
}
|
||||
$returnValue .= $arg;
|
||||
}
|
||||
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOLLAR.
|
||||
*
|
||||
* This function converts a number to text using currency format, with the decimals rounded to the specified place.
|
||||
* The format used is $#,##0.00_);($#,##0.00)..
|
||||
*
|
||||
* @param float $value The value to format
|
||||
* @param int $decimals The number of digits to display to the right of the decimal point.
|
||||
* If decimals is negative, number is rounded to the left of the decimal point.
|
||||
* If you omit decimals, it is assumed to be 2
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function DOLLAR($value = 0, $decimals = 2)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$decimals = $decimals === null ? 0 : Functions::flattenSingleValue($decimals);
|
||||
|
||||
// Validate parameters
|
||||
if (!is_numeric($value) || !is_numeric($decimals)) {
|
||||
return Functions::NAN();
|
||||
}
|
||||
$decimals = floor($decimals);
|
||||
|
||||
$mask = '$#,##0';
|
||||
if ($decimals > 0) {
|
||||
$mask .= '.' . str_repeat('0', $decimals);
|
||||
} else {
|
||||
$round = 10 ** abs($decimals);
|
||||
if ($value < 0) {
|
||||
$round = 0 - $round;
|
||||
}
|
||||
$value = MathTrig::MROUND($value, $round);
|
||||
}
|
||||
|
||||
return NumberFormat::toFormattedString($value, $mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* SEARCHSENSITIVE.
|
||||
*
|
||||
* @param string $needle The string to look for
|
||||
* @param string $haystack The string in which to look
|
||||
* @param int $offset Offset within $haystack
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1)
|
||||
{
|
||||
$needle = Functions::flattenSingleValue($needle);
|
||||
$haystack = Functions::flattenSingleValue($haystack);
|
||||
$offset = Functions::flattenSingleValue($offset);
|
||||
|
||||
if (!is_bool($needle)) {
|
||||
if (is_bool($haystack)) {
|
||||
$haystack = ($haystack) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
if (($offset > 0) && (StringHelper::countCharacters($haystack) > $offset)) {
|
||||
if (StringHelper::countCharacters($needle) === 0) {
|
||||
return $offset;
|
||||
}
|
||||
|
||||
$pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8');
|
||||
if ($pos !== false) {
|
||||
return ++$pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
/**
|
||||
* SEARCHINSENSITIVE.
|
||||
*
|
||||
* @param string $needle The string to look for
|
||||
* @param string $haystack The string in which to look
|
||||
* @param int $offset Offset within $haystack
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1)
|
||||
{
|
||||
$needle = Functions::flattenSingleValue($needle);
|
||||
$haystack = Functions::flattenSingleValue($haystack);
|
||||
$offset = Functions::flattenSingleValue($offset);
|
||||
|
||||
if (!is_bool($needle)) {
|
||||
if (is_bool($haystack)) {
|
||||
$haystack = ($haystack) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
if (($offset > 0) && (StringHelper::countCharacters($haystack) > $offset)) {
|
||||
if (StringHelper::countCharacters($needle) === 0) {
|
||||
return $offset;
|
||||
}
|
||||
|
||||
$pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8');
|
||||
if ($pos !== false) {
|
||||
return ++$pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
/**
|
||||
* FIXEDFORMAT.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
* @param int $decimals
|
||||
* @param bool $no_commas
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$decimals = Functions::flattenSingleValue($decimals);
|
||||
$no_commas = Functions::flattenSingleValue($no_commas);
|
||||
|
||||
// Validate parameters
|
||||
if (!is_numeric($value) || !is_numeric($decimals)) {
|
||||
return Functions::NAN();
|
||||
}
|
||||
$decimals = (int) floor($decimals);
|
||||
|
||||
$valueResult = round($value, $decimals);
|
||||
if ($decimals < 0) {
|
||||
$decimals = 0;
|
||||
}
|
||||
if (!$no_commas) {
|
||||
$valueResult = number_format(
|
||||
$valueResult,
|
||||
$decimals,
|
||||
StringHelper::getDecimalSeparator(),
|
||||
StringHelper::getThousandsSeparator()
|
||||
);
|
||||
}
|
||||
|
||||
return (string) $valueResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* LEFT.
|
||||
*
|
||||
* @param string $value Value
|
||||
* @param int $chars Number of characters
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function LEFT($value = '', $chars = 1)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$chars = Functions::flattenSingleValue($chars);
|
||||
|
||||
if ($chars < 0) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if (is_bool($value)) {
|
||||
$value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
return mb_substr($value, 0, $chars, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* MID.
|
||||
*
|
||||
* @param string $value Value
|
||||
* @param int $start Start character
|
||||
* @param int $chars Number of characters
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function MID($value = '', $start = 1, $chars = null)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$start = Functions::flattenSingleValue($start);
|
||||
$chars = Functions::flattenSingleValue($chars);
|
||||
|
||||
if (($start < 1) || ($chars < 0)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if (is_bool($value)) {
|
||||
$value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
if (empty($chars)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return mb_substr($value, --$start, $chars, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* RIGHT.
|
||||
*
|
||||
* @param string $value Value
|
||||
* @param int $chars Number of characters
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function RIGHT($value = '', $chars = 1)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$chars = Functions::flattenSingleValue($chars);
|
||||
|
||||
if ($chars < 0) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
if (is_bool($value)) {
|
||||
$value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* STRINGLENGTH.
|
||||
*
|
||||
* @param string $value Value
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function STRINGLENGTH($value = '')
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
|
||||
if (is_bool($value)) {
|
||||
$value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
return mb_strlen($value, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* LOWERCASE.
|
||||
*
|
||||
* Converts a string value to upper case.
|
||||
*
|
||||
* @param string $mixedCaseString
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function LOWERCASE($mixedCaseString)
|
||||
{
|
||||
$mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
|
||||
|
||||
if (is_bool($mixedCaseString)) {
|
||||
$mixedCaseString = ($mixedCaseString) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
return StringHelper::strToLower($mixedCaseString);
|
||||
}
|
||||
|
||||
/**
|
||||
* UPPERCASE.
|
||||
*
|
||||
* Converts a string value to upper case.
|
||||
*
|
||||
* @param string $mixedCaseString
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function UPPERCASE($mixedCaseString)
|
||||
{
|
||||
$mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
|
||||
|
||||
if (is_bool($mixedCaseString)) {
|
||||
$mixedCaseString = ($mixedCaseString) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
return StringHelper::strToUpper($mixedCaseString);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROPERCASE.
|
||||
*
|
||||
* Converts a string value to upper case.
|
||||
*
|
||||
* @param string $mixedCaseString
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function PROPERCASE($mixedCaseString)
|
||||
{
|
||||
$mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
|
||||
|
||||
if (is_bool($mixedCaseString)) {
|
||||
$mixedCaseString = ($mixedCaseString) ? Calculation::getTRUE() : Calculation::getFALSE();
|
||||
}
|
||||
|
||||
return StringHelper::strToTitle($mixedCaseString);
|
||||
}
|
||||
|
||||
/**
|
||||
* REPLACE.
|
||||
*
|
||||
* @param string $oldText String to modify
|
||||
* @param int $start Start character
|
||||
* @param int $chars Number of characters
|
||||
* @param string $newText String to replace in defined position
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function REPLACE($oldText, $start, $chars, $newText)
|
||||
{
|
||||
$oldText = Functions::flattenSingleValue($oldText);
|
||||
$start = Functions::flattenSingleValue($start);
|
||||
$chars = Functions::flattenSingleValue($chars);
|
||||
$newText = Functions::flattenSingleValue($newText);
|
||||
|
||||
$left = self::LEFT($oldText, $start - 1);
|
||||
$right = self::RIGHT($oldText, self::STRINGLENGTH($oldText) - ($start + $chars) + 1);
|
||||
|
||||
return $left . $newText . $right;
|
||||
}
|
||||
|
||||
/**
|
||||
* SUBSTITUTE.
|
||||
*
|
||||
* @param string $text Value
|
||||
* @param string $fromText From Value
|
||||
* @param string $toText To Value
|
||||
* @param int $instance Instance Number
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0)
|
||||
{
|
||||
$text = Functions::flattenSingleValue($text);
|
||||
$fromText = Functions::flattenSingleValue($fromText);
|
||||
$toText = Functions::flattenSingleValue($toText);
|
||||
$instance = floor(Functions::flattenSingleValue($instance));
|
||||
|
||||
if ($instance == 0) {
|
||||
return str_replace($fromText, $toText, $text);
|
||||
}
|
||||
|
||||
$pos = -1;
|
||||
while ($instance > 0) {
|
||||
$pos = mb_strpos($text, $fromText, $pos + 1, 'UTF-8');
|
||||
if ($pos === false) {
|
||||
break;
|
||||
}
|
||||
--$instance;
|
||||
}
|
||||
|
||||
if ($pos !== false) {
|
||||
return self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText);
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* RETURNSTRING.
|
||||
*
|
||||
* @param mixed $testValue Value to check
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public static function RETURNSTRING($testValue = '')
|
||||
{
|
||||
$testValue = Functions::flattenSingleValue($testValue);
|
||||
|
||||
if (is_string($testValue)) {
|
||||
return $testValue;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* TEXTFORMAT.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
* @param string $format Format mask to use
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function TEXTFORMAT($value, $format)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$format = Functions::flattenSingleValue($format);
|
||||
|
||||
if ((is_string($value)) && (!is_numeric($value)) && Date::isDateTimeFormatCode($format)) {
|
||||
$value = DateTime::DATEVALUE($value);
|
||||
}
|
||||
|
||||
return (string) NumberFormat::toFormattedString($value, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* VALUE.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
*
|
||||
* @return DateTimeInterface|float|int|string A string if arguments are invalid
|
||||
*/
|
||||
public static function VALUE($value = '')
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
|
||||
if (!is_numeric($value)) {
|
||||
$numberValue = str_replace(
|
||||
StringHelper::getThousandsSeparator(),
|
||||
'',
|
||||
trim($value, " \t\n\r\0\x0B" . StringHelper::getCurrencyCode())
|
||||
);
|
||||
if (is_numeric($numberValue)) {
|
||||
return (float) $numberValue;
|
||||
}
|
||||
|
||||
$dateSetting = Functions::getReturnDateType();
|
||||
Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
|
||||
|
||||
if (strpos($value, ':') !== false) {
|
||||
$timeValue = DateTime::TIMEVALUE($value);
|
||||
if ($timeValue !== Functions::VALUE()) {
|
||||
Functions::setReturnDateType($dateSetting);
|
||||
|
||||
return $timeValue;
|
||||
}
|
||||
}
|
||||
$dateValue = DateTime::DATEVALUE($value);
|
||||
if ($dateValue !== Functions::VALUE()) {
|
||||
Functions::setReturnDateType($dateSetting);
|
||||
|
||||
return $dateValue;
|
||||
}
|
||||
Functions::setReturnDateType($dateSetting);
|
||||
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
return (float) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* NUMBERVALUE.
|
||||
*
|
||||
* @param mixed $value Value to check
|
||||
* @param string $decimalSeparator decimal separator, defaults to locale defined value
|
||||
* @param string $groupSeparator group/thosands separator, defaults to locale defined value
|
||||
*
|
||||
* @return float|string
|
||||
*/
|
||||
public static function NUMBERVALUE($value = '', $decimalSeparator = null, $groupSeparator = null)
|
||||
{
|
||||
$value = Functions::flattenSingleValue($value);
|
||||
$decimalSeparator = Functions::flattenSingleValue($decimalSeparator);
|
||||
$groupSeparator = Functions::flattenSingleValue($groupSeparator);
|
||||
|
||||
if (!is_numeric($value)) {
|
||||
$decimalSeparator = empty($decimalSeparator) ? StringHelper::getDecimalSeparator() : $decimalSeparator;
|
||||
$groupSeparator = empty($groupSeparator) ? StringHelper::getThousandsSeparator() : $groupSeparator;
|
||||
|
||||
$decimalPositions = preg_match_all('/' . preg_quote($decimalSeparator) . '/', $value, $matches, PREG_OFFSET_CAPTURE);
|
||||
if ($decimalPositions > 1) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
$decimalOffset = array_pop($matches[0])[1];
|
||||
if (strpos($value, $groupSeparator, $decimalOffset) !== false) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
$value = str_replace([$groupSeparator, $decimalSeparator], ['', '.'], $value);
|
||||
|
||||
// Handle the special case of trailing % signs
|
||||
$percentageString = rtrim($value, '%');
|
||||
if (!is_numeric($percentageString)) {
|
||||
return Functions::VALUE();
|
||||
}
|
||||
|
||||
$percentageAdjustment = strlen($value) - strlen($percentageString);
|
||||
if ($percentageAdjustment) {
|
||||
$value = (float) $percentageString;
|
||||
$value /= 10 ** ($percentageAdjustment * 2);
|
||||
}
|
||||
}
|
||||
|
||||
return (float) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.
|
||||
* EXACT is case-sensitive but ignores formatting differences.
|
||||
* Use EXACT to test text being entered into a document.
|
||||
*
|
||||
* @param $value1
|
||||
* @param $value2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function EXACT($value1, $value2)
|
||||
{
|
||||
$value1 = Functions::flattenSingleValue($value1);
|
||||
$value2 = Functions::flattenSingleValue($value2);
|
||||
|
||||
return (string) $value2 === (string) $value1;
|
||||
}
|
||||
|
||||
/**
|
||||
* TEXTJOIN.
|
||||
*
|
||||
* @param mixed $delimiter
|
||||
* @param mixed $ignoreEmpty
|
||||
* @param mixed $args
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function TEXTJOIN($delimiter, $ignoreEmpty, ...$args)
|
||||
{
|
||||
// Loop through arguments
|
||||
$aArgs = Functions::flattenArray($args);
|
||||
foreach ($aArgs as $key => &$arg) {
|
||||
if ($ignoreEmpty && trim($arg) == '') {
|
||||
unset($aArgs[$key]);
|
||||
} elseif (is_bool($arg)) {
|
||||
$arg = self::convertBooleanValue($arg);
|
||||
}
|
||||
}
|
||||
|
||||
return implode($delimiter, $aArgs);
|
||||
}
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation\Token;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
|
||||
class Stack
|
||||
{
|
||||
/**
|
||||
* The parser stack for formulae.
|
||||
*
|
||||
* @var mixed[]
|
||||
*/
|
||||
private $stack = [];
|
||||
|
||||
/**
|
||||
* Count of entries in the parser stack.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $count = 0;
|
||||
|
||||
/**
|
||||
* Return the number of entries on the stack.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Push a new entry onto the stack.
|
||||
*
|
||||
* @param mixed $type
|
||||
* @param mixed $value
|
||||
* @param mixed $reference
|
||||
* @param null|string $storeKey will store the result under this alias
|
||||
* @param null|string $onlyIf will only run computation if the matching
|
||||
* store key is true
|
||||
* @param null|string $onlyIfNot will only run computation if the matching
|
||||
* store key is false
|
||||
*/
|
||||
public function push(
|
||||
$type,
|
||||
$value,
|
||||
$reference = null,
|
||||
$storeKey = null,
|
||||
$onlyIf = null,
|
||||
$onlyIfNot = null
|
||||
): void {
|
||||
$stackItem = $this->getStackItem($type, $value, $reference, $storeKey, $onlyIf, $onlyIfNot);
|
||||
|
||||
$this->stack[$this->count++] = $stackItem;
|
||||
|
||||
if ($type == 'Function') {
|
||||
$localeFunction = Calculation::localeFunc($value);
|
||||
if ($localeFunction != $value) {
|
||||
$this->stack[($this->count - 1)]['localeValue'] = $localeFunction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getStackItem(
|
||||
$type,
|
||||
$value,
|
||||
$reference = null,
|
||||
$storeKey = null,
|
||||
$onlyIf = null,
|
||||
$onlyIfNot = null
|
||||
) {
|
||||
$stackItem = [
|
||||
'type' => $type,
|
||||
'value' => $value,
|
||||
'reference' => $reference,
|
||||
];
|
||||
|
||||
if (isset($storeKey)) {
|
||||
$stackItem['storeKey'] = $storeKey;
|
||||
}
|
||||
|
||||
if (isset($onlyIf)) {
|
||||
$stackItem['onlyIf'] = $onlyIf;
|
||||
}
|
||||
|
||||
if (isset($onlyIfNot)) {
|
||||
$stackItem['onlyIfNot'] = $onlyIfNot;
|
||||
}
|
||||
|
||||
return $stackItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pop the last entry from the stack.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function pop()
|
||||
{
|
||||
if ($this->count > 0) {
|
||||
return $this->stack[--$this->count];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an entry from the stack without removing it.
|
||||
*
|
||||
* @param int $n number indicating how far back in the stack we want to look
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function last($n = 1)
|
||||
{
|
||||
if ($this->count - $n < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->stack[$this->count - $n];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the stack.
|
||||
*/
|
||||
public function clear(): void
|
||||
{
|
||||
$this->stack = [];
|
||||
$this->count = 0;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
$str = 'Stack: ';
|
||||
foreach ($this->stack as $index => $item) {
|
||||
if ($index > $this->count - 1) {
|
||||
break;
|
||||
}
|
||||
$value = $item['value'] ?? 'no value';
|
||||
while (is_array($value)) {
|
||||
$value = array_pop($value);
|
||||
}
|
||||
$str .= $value . ' |> ';
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Calculation;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Settings;
|
||||
use Psr\Http\Client\ClientExceptionInterface;
|
||||
|
||||
class Web
|
||||
{
|
||||
/**
|
||||
* WEBSERVICE.
|
||||
*
|
||||
* Returns data from a web service on the Internet or Intranet.
|
||||
*
|
||||
* Excel Function:
|
||||
* Webservice(url)
|
||||
*
|
||||
* @return string the output resulting from a call to the webservice
|
||||
*/
|
||||
public static function WEBSERVICE(string $url)
|
||||
{
|
||||
$url = trim($url);
|
||||
if (strlen($url) > 2048) {
|
||||
return Functions::VALUE(); // Invalid URL length
|
||||
}
|
||||
|
||||
if (!preg_match('/^http[s]?:\/\//', $url)) {
|
||||
return Functions::VALUE(); // Invalid protocol
|
||||
}
|
||||
|
||||
// Get results from the the webservice
|
||||
$client = Settings::getHttpClient();
|
||||
$requestFactory = Settings::getRequestFactory();
|
||||
$request = $requestFactory->createRequest('GET', $url);
|
||||
|
||||
try {
|
||||
$response = $client->sendRequest($request);
|
||||
} catch (ClientExceptionInterface $e) {
|
||||
return Functions::VALUE(); // cURL error
|
||||
}
|
||||
|
||||
if ($response->getStatusCode() != 200) {
|
||||
return Functions::VALUE(); // cURL error
|
||||
}
|
||||
|
||||
$output = $response->getBody()->getContents();
|
||||
if (strlen($output) > 32767) {
|
||||
return Functions::VALUE(); // Output not a string or too long
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
@ -1,395 +0,0 @@
|
||||
ABS
|
||||
ACCRINT
|
||||
ACCRINTM
|
||||
ACOS
|
||||
ACOSH
|
||||
ACOT
|
||||
ACOTH
|
||||
ADDRESS
|
||||
AMORDEGRC
|
||||
AMORLINC
|
||||
AND
|
||||
ARABIC
|
||||
AREAS
|
||||
ASC
|
||||
ASIN
|
||||
ASINH
|
||||
ATAN
|
||||
ATAN2
|
||||
ATANH
|
||||
AVEDEV
|
||||
AVERAGE
|
||||
AVERAGEA
|
||||
AVERAGEIF
|
||||
AVERAGEIFS
|
||||
BAHTTEXT
|
||||
BASE
|
||||
BESSELI
|
||||
BESSELJ
|
||||
BESSELK
|
||||
BESSELY
|
||||
BETADIST
|
||||
BETAINV
|
||||
BIN2DEC
|
||||
BIN2HEX
|
||||
BIN2OCT
|
||||
BINOMDIST
|
||||
BITAND
|
||||
BITLSHIFT
|
||||
BITOR
|
||||
BITRSHIFT
|
||||
BITXOR
|
||||
CEILING
|
||||
CELL
|
||||
CHAR
|
||||
CHIDIST
|
||||
CHIINV
|
||||
CHITEST
|
||||
CHOOSE
|
||||
CLEAN
|
||||
CODE
|
||||
COLUMN
|
||||
COLUMNS
|
||||
COMBIN
|
||||
COMPLEX
|
||||
CONCAT
|
||||
CONCATENATE
|
||||
CONFIDENCE
|
||||
CONVERT
|
||||
CORREL
|
||||
COS
|
||||
COSH
|
||||
COT
|
||||
COTH
|
||||
COUNT
|
||||
COUNTA
|
||||
COUNTBLANK
|
||||
COUNTIF
|
||||
COUNTIFS
|
||||
COUPDAYBS
|
||||
COUPDAYBS
|
||||
COUPDAYSNC
|
||||
COUPNCD
|
||||
COUPNUM
|
||||
COUPPCD
|
||||
COVAR
|
||||
CRITBINOM
|
||||
CSC
|
||||
CSCH
|
||||
CUBEKPIMEMBER
|
||||
CUBEMEMBER
|
||||
CUBEMEMBERPROPERTY
|
||||
CUBERANKEDMEMBER
|
||||
CUBESET
|
||||
CUBESETCOUNT
|
||||
CUBEVALUE
|
||||
CUMIPMT
|
||||
CUMPRINC
|
||||
DATE
|
||||
DATEDIF
|
||||
DATEVALUE
|
||||
DAVERAGE
|
||||
DAY
|
||||
DAYS
|
||||
DAYS360
|
||||
DB
|
||||
DCOUNT
|
||||
DCOUNTA
|
||||
DDB
|
||||
DEC2BIN
|
||||
DEC2HEX
|
||||
DEC2OCT
|
||||
DEGREES
|
||||
DELTA
|
||||
DEVSQ
|
||||
DGET
|
||||
DISC
|
||||
DMAX
|
||||
DMIN
|
||||
DOLLAR
|
||||
DOLLARDE
|
||||
DOLLARFR
|
||||
DPRODUCT
|
||||
DSTDEV
|
||||
DSTDEVP
|
||||
DSUM
|
||||
DURATION
|
||||
DVAR
|
||||
DVARP
|
||||
EDATE
|
||||
EFFECT
|
||||
EOMONTH
|
||||
ERF
|
||||
ERF.PRECISE
|
||||
ERFC
|
||||
ERFC.PRECISE
|
||||
ERROR.TYPE
|
||||
EVEN
|
||||
EXACT
|
||||
EXP
|
||||
EXPONDIST
|
||||
FACT
|
||||
FACTDOUBLE
|
||||
FALSE
|
||||
FDIST
|
||||
FIND
|
||||
FINDB
|
||||
FINV
|
||||
FISHER
|
||||
FISHERINV
|
||||
FIXED
|
||||
FLOOR
|
||||
FLOOR.MATH
|
||||
FLOOR.PRECISE
|
||||
FORECAST
|
||||
FREQUENCY
|
||||
FTEST
|
||||
FV
|
||||
FVSCHEDULE
|
||||
GAMAMDIST
|
||||
GAMMAINV
|
||||
GAMMALN
|
||||
GCD
|
||||
GEOMEAN
|
||||
GESTEP
|
||||
GETPIVOTDATA
|
||||
GROWTH
|
||||
HARMEAN
|
||||
HEX2BIN
|
||||
HEX2OCT
|
||||
HLOOKUP
|
||||
HOUR
|
||||
HYPERLINK
|
||||
HYPGEOMDIST
|
||||
IF
|
||||
IFERROR
|
||||
IFS
|
||||
IMABS
|
||||
IMAGINARY
|
||||
IMARGUMENT
|
||||
IMCONJUGATE
|
||||
IMCOS
|
||||
IMCOSH
|
||||
IMCOT
|
||||
IMCSC
|
||||
IMCSCH
|
||||
IMEXP
|
||||
IMLN
|
||||
IMLOG10
|
||||
IMLOG2
|
||||
IMPOWER
|
||||
IMPRODUCT
|
||||
IMREAL
|
||||
IMSEC
|
||||
IMSECH
|
||||
IMSIN
|
||||
IMSINH
|
||||
IMSQRT
|
||||
IMSUB
|
||||
IMSUM
|
||||
IMTAN
|
||||
INDEX
|
||||
INDIRECT
|
||||
INFO
|
||||
INT
|
||||
INTERCEPT
|
||||
INTRATE
|
||||
IPMT
|
||||
IRR
|
||||
ISBLANK
|
||||
ISERR
|
||||
ISERROR
|
||||
ISEVEN
|
||||
ISLOGICAL
|
||||
ISNA
|
||||
ISNONTEXT
|
||||
ISNUMBER
|
||||
ISODD
|
||||
ISOWEEKNUM
|
||||
ISPMT
|
||||
ISREF
|
||||
ISTEXT
|
||||
JIS
|
||||
KURT
|
||||
LARGE
|
||||
LCM
|
||||
LEFT
|
||||
LEFTB
|
||||
LEN
|
||||
LENB
|
||||
LINEST
|
||||
LN
|
||||
LOG
|
||||
LOG10
|
||||
LOGEST
|
||||
LOGINV
|
||||
LOGNORMDIST
|
||||
LOOKUP
|
||||
LOWER
|
||||
MATCH
|
||||
MAX
|
||||
MAXA
|
||||
MAXIFS
|
||||
MDETERM
|
||||
MDURATION
|
||||
MEDIAN
|
||||
MID
|
||||
MIDB
|
||||
MIN
|
||||
MINA
|
||||
MINIFS
|
||||
MINUTE
|
||||
MINVERSE
|
||||
MIRR
|
||||
MMULT
|
||||
MOD
|
||||
MODE
|
||||
MONTH
|
||||
MROUND
|
||||
MULTINOMIAL
|
||||
N
|
||||
NA
|
||||
NEGBINOMDIST
|
||||
NETWORKDAYS
|
||||
NOMINAL
|
||||
NORMDIST
|
||||
NORMINV
|
||||
NORMSDIST
|
||||
NORMSINV
|
||||
NOT
|
||||
NOW
|
||||
NPER
|
||||
NPV
|
||||
NUMBERVALUE
|
||||
OCT2BIN
|
||||
OCT2DEC
|
||||
OCT2HEX
|
||||
ODD
|
||||
ODDFPRICE
|
||||
ODDFYIELD
|
||||
ODDLPRICE
|
||||
ODDLYIELD
|
||||
OFFSET
|
||||
OR
|
||||
PDURATION
|
||||
PEARSON
|
||||
PERCENTILE
|
||||
PERCENTRANK
|
||||
PERMUT
|
||||
PHONETIC
|
||||
PI
|
||||
PMT
|
||||
POISSON
|
||||
POWER
|
||||
PPMT
|
||||
PRICE
|
||||
PRICEDISC
|
||||
PRICEMAT
|
||||
PROB
|
||||
PRODUCT
|
||||
PROPER
|
||||
PV
|
||||
QUARTILE
|
||||
QUOTIENT
|
||||
RADIANS
|
||||
RAND
|
||||
RANDBETWEEN
|
||||
RANK
|
||||
RATE
|
||||
RECEIVED
|
||||
REPLACE
|
||||
REPLACEB
|
||||
REPT
|
||||
RIGHT
|
||||
RIGHTB
|
||||
ROMAN
|
||||
ROUND
|
||||
ROUNDDOWN
|
||||
ROUNDUP
|
||||
ROW
|
||||
ROWS
|
||||
RRI
|
||||
RSQ
|
||||
RTD
|
||||
SEARCH
|
||||
SEARCHB
|
||||
SEC
|
||||
SECH
|
||||
SECOND
|
||||
SERIESSUM
|
||||
SHEET
|
||||
SHEETS
|
||||
SIGN
|
||||
SIN
|
||||
SINH
|
||||
SKEW
|
||||
SLN
|
||||
SLOPE
|
||||
SMALL
|
||||
SQRT
|
||||
SQRTPI
|
||||
STANDARDIZE
|
||||
STDEV
|
||||
STDEV.A
|
||||
STDEV.P
|
||||
STDEVA
|
||||
STDEVP
|
||||
STDEVPA
|
||||
STEYX
|
||||
SUBSTITUTE
|
||||
SUBTOTAL
|
||||
SUM
|
||||
SUMIF
|
||||
SUMIFS
|
||||
SUMPRODUCT
|
||||
SUMSQ
|
||||
SUMX2MY2
|
||||
SUMX2PY2
|
||||
SUMXMY2
|
||||
SWITCH
|
||||
SYD
|
||||
T
|
||||
TAN
|
||||
TANH
|
||||
TBILLEQ
|
||||
TBILLPRICE
|
||||
TBILLYIELD
|
||||
TDIST
|
||||
TEXT
|
||||
TEXTJOIN
|
||||
TIME
|
||||
TIMEVALUE
|
||||
TINV
|
||||
TODAY
|
||||
TRANSPOSE
|
||||
TREND
|
||||
TRIM
|
||||
TRIMMEAN
|
||||
TRUE
|
||||
TRUNC
|
||||
TTEST
|
||||
TYPE
|
||||
UNICHAR
|
||||
UNIORD
|
||||
UPPER
|
||||
USDOLLAR
|
||||
VALUE
|
||||
VAR
|
||||
VARA
|
||||
VARP
|
||||
VARPA
|
||||
VDB
|
||||
VLOOKUP
|
||||
WEEKDAY
|
||||
WEEKNUM
|
||||
WEIBULL
|
||||
WORKDAY
|
||||
XIRR
|
||||
XNPV
|
||||
XOR
|
||||
YEAR
|
||||
YEARFRAC
|
||||
YIELD
|
||||
YIELDDISC
|
||||
YIELDMAT
|
||||
ZTEST
|
@ -1,23 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = Kč
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
##
|
||||
NULL = #NULL!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #HODNOTA!
|
||||
REF = #REF!
|
||||
NAME = #NÁZEV?
|
||||
NUM = #NUM!
|
||||
NA = #N/A
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Funkce doplňků a automatizace
|
||||
##
|
||||
GETPIVOTDATA = ZÍSKATKONTDATA ## Vrátí data uložená v kontingenční tabulce. Pomocí funkce ZÍSKATKONTDATA můžete načíst souhrnná data z kontingenční tabulky, pokud jsou tato data v kontingenční sestavě zobrazena.
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Funkce pro práci s krychlemi
|
||||
##
|
||||
CUBEKPIMEMBER = CUBEKPIMEMBER ## Vrátí název, vlastnost a velikost klíčového ukazatele výkonu (KUV) a zobrazí v buňce název a vlastnost. Klíčový ukazatel výkonu je kvantifikovatelná veličina, například hrubý měsíční zisk nebo čtvrtletní obrat na zaměstnance, která se používá pro sledování výkonnosti organizace.
|
||||
CUBEMEMBER = CUBEMEMBER ## Vrátí člen nebo n-tici v hierarchii krychle. Slouží k ověření, zda v krychli existuje člen nebo n-tice.
|
||||
CUBEMEMBERPROPERTY = CUBEMEMBERPROPERTY ## Vrátí hodnotu vlastnosti člena v krychli. Slouží k ověření, zda v krychli existuje člen s daným názvem, a k vrácení konkrétní vlastnosti tohoto člena.
|
||||
CUBERANKEDMEMBER = CUBERANKEDMEMBER ## Vrátí n-tý nebo pořadový člen sady. Použijte ji pro vrácení jednoho nebo více prvků sady, například obchodníka s nejvyšším obratem nebo deseti nejlepších studentů.
|
||||
CUBESET = CUBESET ## Definuje vypočtenou sadu členů nebo n-tic odesláním výrazu sady do krychle na serveru, který vytvoří sadu a potom ji vrátí do aplikace Microsoft Office Excel.
|
||||
CUBESETCOUNT = CUBESETCOUNT ## Vrátí počet položek v množině
|
||||
CUBEVALUE = CUBEVALUE ## Vrátí úhrnnou hodnotu z krychle.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Funkce databáze
|
||||
##
|
||||
DAVERAGE = DPRŮMĚR ## Vrátí průměr vybraných položek databáze.
|
||||
DCOUNT = DPOČET ## Spočítá buňky databáze obsahující čísla.
|
||||
DCOUNTA = DPOČET2 ## Spočítá buňky databáze, které nejsou prázdné.
|
||||
DGET = DZÍSKAT ## Extrahuje z databáze jeden záznam splňující zadaná kritéria.
|
||||
DMAX = DMAX ## Vrátí maximální hodnotu z vybraných položek databáze.
|
||||
DMIN = DMIN ## Vrátí minimální hodnotu z vybraných položek databáze.
|
||||
DPRODUCT = DSOUČIN ## Vynásobí hodnoty určitého pole záznamů v databázi, které splňují daná kritéria.
|
||||
DSTDEV = DSMODCH.VÝBĚR ## Odhadne směrodatnou odchylku výběru vybraných položek databáze.
|
||||
DSTDEVP = DSMODCH ## Vypočte směrodatnou odchylku základního souboru vybraných položek databáze.
|
||||
DSUM = DSUMA ## Sečte čísla ve sloupcovém poli záznamů databáze, která splňují daná kritéria.
|
||||
DVAR = DVAR.VÝBĚR ## Odhadne rozptyl výběru vybraných položek databáze.
|
||||
DVARP = DVAR ## Vypočte rozptyl základního souboru vybraných položek databáze.
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Funkce data a času
|
||||
##
|
||||
DATE = DATUM ## Vrátí pořadové číslo určitého data.
|
||||
DATEVALUE = DATUMHODN ## Převede datum ve formě textu na pořadové číslo.
|
||||
DAY = DEN ## Převede pořadové číslo na den v měsíci.
|
||||
DAYS360 = ROK360 ## Vrátí počet dní mezi dvěma daty na základě roku s 360 dny.
|
||||
EDATE = EDATE ## Vrátí pořadové číslo data, které označuje určený počet měsíců před nebo po počátečním datu.
|
||||
EOMONTH = EOMONTH ## Vrátí pořadové číslo posledního dne měsíce před nebo po zadaném počtu měsíců.
|
||||
HOUR = HODINA ## Převede pořadové číslo na hodinu.
|
||||
MINUTE = MINUTA ## Převede pořadové číslo na minutu.
|
||||
MONTH = MĚSÍC ## Převede pořadové číslo na měsíc.
|
||||
NETWORKDAYS = NETWORKDAYS ## Vrátí počet celých pracovních dní mezi dvěma daty.
|
||||
NOW = NYNÍ ## Vrátí pořadové číslo aktuálního data a času.
|
||||
SECOND = SEKUNDA ## Převede pořadové číslo na sekundu.
|
||||
TIME = ČAS ## Vrátí pořadové číslo určitého času.
|
||||
TIMEVALUE = ČASHODN ## Převede čas ve formě textu na pořadové číslo.
|
||||
TODAY = DNES ## Vrátí pořadové číslo dnešního data.
|
||||
WEEKDAY = DENTÝDNE ## Převede pořadové číslo na den v týdnu.
|
||||
WEEKNUM = WEEKNUM ## Převede pořadové číslo na číslo představující číselnou pozici týdne v roce.
|
||||
WORKDAY = WORKDAY ## Vrátí pořadové číslo data před nebo po zadaném počtu pracovních dní.
|
||||
YEAR = ROK ## Převede pořadové číslo na rok.
|
||||
YEARFRAC = YEARFRAC ## Vrátí část roku vyjádřenou zlomkem a představující počet celých dní mezi počátečním a koncovým datem.
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Inženýrské funkce (Technické funkce)
|
||||
##
|
||||
BESSELI = BESSELI ## Vrátí modifikovanou Besselovu funkci In(x).
|
||||
BESSELJ = BESSELJ ## Vrátí modifikovanou Besselovu funkci Jn(x).
|
||||
BESSELK = BESSELK ## Vrátí modifikovanou Besselovu funkci Kn(x).
|
||||
BESSELY = BESSELY ## Vrátí Besselovu funkci Yn(x).
|
||||
BIN2DEC = BIN2DEC ## Převede binární číslo na desítkové.
|
||||
BIN2HEX = BIN2HEX ## Převede binární číslo na šestnáctkové.
|
||||
BIN2OCT = BIN2OCT ## Převede binární číslo na osmičkové.
|
||||
COMPLEX = COMPLEX ## Převede reálnou a imaginární část na komplexní číslo.
|
||||
CONVERT = CONVERT ## Převede číslo do jiného jednotkového měrného systému.
|
||||
DEC2BIN = DEC2BIN ## Převede desítkového čísla na dvojkové
|
||||
DEC2HEX = DEC2HEX ## Převede desítkové číslo na šestnáctkové.
|
||||
DEC2OCT = DEC2OCT ## Převede desítkové číslo na osmičkové.
|
||||
DELTA = DELTA ## Testuje rovnost dvou hodnot.
|
||||
ERF = ERF ## Vrátí chybovou funkci.
|
||||
ERFC = ERFC ## Vrátí doplňkovou chybovou funkci.
|
||||
GESTEP = GESTEP ## Testuje, zda je číslo větší než mezní hodnota.
|
||||
HEX2BIN = HEX2BIN ## Převede šestnáctkové číslo na binární.
|
||||
HEX2DEC = HEX2DEC ## Převede šestnáctkové číslo na desítkové.
|
||||
HEX2OCT = HEX2OCT ## Převede šestnáctkové číslo na osmičkové.
|
||||
IMABS = IMABS ## Vrátí absolutní hodnotu (modul) komplexního čísla.
|
||||
IMAGINARY = IMAGINARY ## Vrátí imaginární část komplexního čísla.
|
||||
IMARGUMENT = IMARGUMENT ## Vrátí argument théta, úhel vyjádřený v radiánech.
|
||||
IMCONJUGATE = IMCONJUGATE ## Vrátí komplexně sdružené číslo ke komplexnímu číslu.
|
||||
IMCOS = IMCOS ## Vrátí kosinus komplexního čísla.
|
||||
IMDIV = IMDIV ## Vrátí podíl dvou komplexních čísel.
|
||||
IMEXP = IMEXP ## Vrátí exponenciální tvar komplexního čísla.
|
||||
IMLN = IMLN ## Vrátí přirozený logaritmus komplexního čísla.
|
||||
IMLOG10 = IMLOG10 ## Vrátí dekadický logaritmus komplexního čísla.
|
||||
IMLOG2 = IMLOG2 ## Vrátí logaritmus komplexního čísla při základu 2.
|
||||
IMPOWER = IMPOWER ## Vrátí komplexní číslo umocněné na celé číslo.
|
||||
IMPRODUCT = IMPRODUCT ## Vrátí součin komplexních čísel.
|
||||
IMREAL = IMREAL ## Vrátí reálnou část komplexního čísla.
|
||||
IMSIN = IMSIN ## Vrátí sinus komplexního čísla.
|
||||
IMSQRT = IMSQRT ## Vrátí druhou odmocninu komplexního čísla.
|
||||
IMSUB = IMSUB ## Vrátí rozdíl mezi dvěma komplexními čísly.
|
||||
IMSUM = IMSUM ## Vrátí součet dvou komplexních čísel.
|
||||
OCT2BIN = OCT2BIN ## Převede osmičkové číslo na binární.
|
||||
OCT2DEC = OCT2DEC ## Převede osmičkové číslo na desítkové.
|
||||
OCT2HEX = OCT2HEX ## Převede osmičkové číslo na šestnáctkové.
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Finanční funkce
|
||||
##
|
||||
ACCRINT = ACCRINT ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen v pravidelných termínech.
|
||||
ACCRINTM = ACCRINTM ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen k datu splatnosti.
|
||||
AMORDEGRC = AMORDEGRC ## Vrátí lineární amortizaci v každém účetním období pomocí koeficientu amortizace.
|
||||
AMORLINC = AMORLINC ## Vrátí lineární amortizaci v každém účetním období.
|
||||
COUPDAYBS = COUPDAYBS ## Vrátí počet dnů od začátku období placení kupónů do data splatnosti.
|
||||
COUPDAYS = COUPDAYS ## Vrátí počet dnů v období placení kupónů, které obsahuje den zúčtování.
|
||||
COUPDAYSNC = COUPDAYSNC ## Vrátí počet dnů od data zúčtování do následujícího data placení kupónu.
|
||||
COUPNCD = COUPNCD ## Vrátí následující datum placení kupónu po datu zúčtování.
|
||||
COUPNUM = COUPNUM ## Vrátí počet kupónů splatných mezi datem zúčtování a datem splatnosti.
|
||||
COUPPCD = COUPPCD ## Vrátí předchozí datum placení kupónu před datem zúčtování.
|
||||
CUMIPMT = CUMIPMT ## Vrátí kumulativní úrok splacený mezi dvěma obdobími.
|
||||
CUMPRINC = CUMPRINC ## Vrátí kumulativní jistinu splacenou mezi dvěma obdobími půjčky.
|
||||
DB = ODPIS.ZRYCH ## Vrátí odpis aktiva za určité období pomocí degresivní metody odpisu s pevným zůstatkem.
|
||||
DDB = ODPIS.ZRYCH2 ## Vrátí odpis aktiva za určité období pomocí dvojité degresivní metody odpisu nebo jiné metody, kterou zadáte.
|
||||
DISC = DISC ## Vrátí diskontní sazbu cenného papíru.
|
||||
DOLLARDE = DOLLARDE ## Převede částku v korunách vyjádřenou zlomkem na částku v korunách vyjádřenou desetinným číslem.
|
||||
DOLLARFR = DOLLARFR ## Převede částku v korunách vyjádřenou desetinným číslem na částku v korunách vyjádřenou zlomkem.
|
||||
DURATION = DURATION ## Vrátí roční dobu cenného papíru s pravidelnými úrokovými sazbami.
|
||||
EFFECT = EFFECT ## Vrátí efektivní roční úrokovou sazbu.
|
||||
FV = BUDHODNOTA ## Vrátí budoucí hodnotu investice.
|
||||
FVSCHEDULE = FVSCHEDULE ## Vrátí budoucí hodnotu počáteční jistiny po použití série sazeb složitého úroku.
|
||||
INTRATE = INTRATE ## Vrátí úrokovou sazbu plně investovaného cenného papíru.
|
||||
IPMT = PLATBA.ÚROK ## Vrátí výšku úroku investice za dané období.
|
||||
IRR = MÍRA.VÝNOSNOSTI ## Vrátí vnitřní výnosové procento série peněžních toků.
|
||||
ISPMT = ISPMT ## Vypočte výši úroku z investice zaplaceného během určitého období.
|
||||
MDURATION = MDURATION ## Vrátí Macauleyho modifikovanou dobu cenného papíru o nominální hodnotě 100 Kč.
|
||||
MIRR = MOD.MÍRA.VÝNOSNOSTI ## Vrátí vnitřní sazbu výnosu, přičemž kladné a záporné hodnoty peněžních prostředků jsou financovány podle různých sazeb.
|
||||
NOMINAL = NOMINAL ## Vrátí nominální roční úrokovou sazbu.
|
||||
NPER = POČET.OBDOBÍ ## Vrátí počet období pro investici.
|
||||
NPV = ČISTÁ.SOUČHODNOTA ## Vrátí čistou současnou hodnotu investice vypočítanou na základě série pravidelných peněžních toků a diskontní sazby.
|
||||
ODDFPRICE = ODDFPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným prvním obdobím.
|
||||
ODDFYIELD = ODDFYIELD ## Vrátí výnos cenného papíru s odlišným prvním obdobím.
|
||||
ODDLPRICE = ODDLPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným posledním obdobím.
|
||||
ODDLYIELD = ODDLYIELD ## Vrátí výnos cenného papíru s odlišným posledním obdobím.
|
||||
PMT = PLATBA ## Vrátí hodnotu pravidelné splátky anuity.
|
||||
PPMT = PLATBA.ZÁKLAD ## Vrátí hodnotu splátky jistiny pro zadanou investici za dané období.
|
||||
PRICE = PRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen v pravidelných termínech.
|
||||
PRICEDISC = PRICEDISC ## Vrátí cenu diskontního cenného papíru o nominální hodnotě 100 Kč.
|
||||
PRICEMAT = PRICEMAT ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen k datu splatnosti.
|
||||
PV = SOUČHODNOTA ## Vrátí současnou hodnotu investice.
|
||||
RATE = ÚROKOVÁ.MÍRA ## Vrátí úrokovou sazbu vztaženou na období anuity.
|
||||
RECEIVED = RECEIVED ## Vrátí částku obdrženou k datu splatnosti plně investovaného cenného papíru.
|
||||
SLN = ODPIS.LIN ## Vrátí přímé odpisy aktiva pro jedno období.
|
||||
SYD = ODPIS.NELIN ## Vrátí směrné číslo ročních odpisů aktiva pro zadané období.
|
||||
TBILLEQ = TBILLEQ ## Vrátí výnos směnky státní pokladny ekvivalentní výnosu obligace.
|
||||
TBILLPRICE = TBILLPRICE ## Vrátí cenu směnky státní pokladny o nominální hodnotě 100 Kč.
|
||||
TBILLYIELD = TBILLYIELD ## Vrátí výnos směnky státní pokladny.
|
||||
VDB = ODPIS.ZA.INT ## Vrátí odpis aktiva pro určité období nebo část období pomocí degresivní metody odpisu.
|
||||
XIRR = XIRR ## Vrátí vnitřní výnosnost pro harmonogram peněžních toků, který nemusí být nutně periodický.
|
||||
XNPV = XNPV ## Vrátí čistou současnou hodnotu pro harmonogram peněžních toků, který nemusí být nutně periodický.
|
||||
YIELD = YIELD ## Vrátí výnos cenného papíru, ze kterého je úrok placen v pravidelných termínech.
|
||||
YIELDDISC = YIELDDISC ## Vrátí roční výnos diskontního cenného papíru, například směnky státní pokladny.
|
||||
YIELDMAT = YIELDMAT ## Vrátí roční výnos cenného papíru, ze kterého je úrok placen k datu splatnosti.
|
||||
|
||||
|
||||
##
|
||||
## Information functions Informační funkce
|
||||
##
|
||||
CELL = POLÍČKO ## Vrátí informace o formátování, umístění nebo obsahu buňky.
|
||||
ERROR.TYPE = CHYBA.TYP ## Vrátí číslo odpovídající typu chyby.
|
||||
INFO = O.PROSTŘEDÍ ## Vrátí informace o aktuálním pracovním prostředí.
|
||||
ISBLANK = JE.PRÁZDNÉ ## Vrátí hodnotu PRAVDA, pokud se argument hodnota odkazuje na prázdnou buňku.
|
||||
ISERR = JE.CHYBA ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota (kromě #N/A).
|
||||
ISERROR = JE.CHYBHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota.
|
||||
ISEVEN = ISEVEN ## Vrátí hodnotu PRAVDA, pokud je číslo sudé.
|
||||
ISLOGICAL = JE.LOGHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota logická hodnota.
|
||||
ISNA = JE.NEDEF ## Vrátí hodnotu PRAVDA, pokud je argument hodnota chybová hodnota #N/A.
|
||||
ISNONTEXT = JE.NETEXT ## Vrátí hodnotu PRAVDA, pokud argument hodnota není text.
|
||||
ISNUMBER = JE.ČÍSLO ## Vrátí hodnotu PRAVDA, pokud je argument hodnota číslo.
|
||||
ISODD = ISODD ## Vrátí hodnotu PRAVDA, pokud je číslo liché.
|
||||
ISREF = JE.ODKAZ ## Vrátí hodnotu PRAVDA, pokud je argument hodnota odkaz.
|
||||
ISTEXT = JE.TEXT ## Vrátí hodnotu PRAVDA, pokud je argument hodnota text.
|
||||
N = N ## Vrátí hodnotu převedenou na číslo.
|
||||
NA = NEDEF ## Vrátí chybovou hodnotu #N/A.
|
||||
TYPE = TYP ## Vrátí číslo označující datový typ hodnoty.
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Logické funkce
|
||||
##
|
||||
AND = A ## Vrátí hodnotu PRAVDA, mají-li všechny argumenty hodnotu PRAVDA.
|
||||
FALSE = NEPRAVDA ## Vrátí logickou hodnotu NEPRAVDA.
|
||||
IF = KDYŽ ## Určí, který logický test má proběhnout.
|
||||
IFERROR = IFERROR ## Pokud je vzorec vyhodnocen jako chyba, vrátí zadanou hodnotu. V opačném případě vrátí výsledek vzorce.
|
||||
NOT = NE ## Provede logickou negaci argumentu funkce.
|
||||
OR = NEBO ## Vrátí hodnotu PRAVDA, je-li alespoň jeden argument roven hodnotě PRAVDA.
|
||||
TRUE = PRAVDA ## Vrátí logickou hodnotu PRAVDA.
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Vyhledávací funkce
|
||||
##
|
||||
ADDRESS = ODKAZ ## Vrátí textový odkaz na jednu buňku listu.
|
||||
AREAS = POČET.BLOKŮ ## Vrátí počet oblastí v odkazu.
|
||||
CHOOSE = ZVOLIT ## Zvolí hodnotu ze seznamu hodnot.
|
||||
COLUMN = SLOUPEC ## Vrátí číslo sloupce odkazu.
|
||||
COLUMNS = SLOUPCE ## Vrátí počet sloupců v odkazu.
|
||||
HLOOKUP = VVYHLEDAT ## Prohledá horní řádek matice a vrátí hodnotu určené buňky.
|
||||
HYPERLINK = HYPERTEXTOVÝ.ODKAZ ## Vytvoří zástupce nebo odkaz, který otevře dokument uložený na síťovém serveru, v síti intranet nebo Internet.
|
||||
INDEX = INDEX ## Pomocí rejstříku zvolí hodnotu z odkazu nebo matice.
|
||||
INDIRECT = NEPŘÍMÝ.ODKAZ ## Vrátí odkaz určený textovou hodnotou.
|
||||
LOOKUP = VYHLEDAT ## Vyhledá hodnoty ve vektoru nebo matici.
|
||||
MATCH = POZVYHLEDAT ## Vyhledá hodnoty v odkazu nebo matici.
|
||||
OFFSET = POSUN ## Vrátí posun odkazu od zadaného odkazu.
|
||||
ROW = ŘÁDEK ## Vrátí číslo řádku odkazu.
|
||||
ROWS = ŘÁDKY ## Vrátí počet řádků v odkazu.
|
||||
RTD = RTD ## Načte data reálného času z programu, který podporuje automatizaci modelu COM (Automatizace: Způsob práce s objekty určité aplikace z jiné aplikace nebo nástroje pro vývoj. Automatizace (dříve nazývaná automatizace OLE) je počítačovým standardem a je funkcí modelu COM (Component Object Model).).
|
||||
TRANSPOSE = TRANSPOZICE ## Vrátí transponovanou matici.
|
||||
VLOOKUP = SVYHLEDAT ## Prohledá první sloupec matice, přesune kurzor v řádku a vrátí hodnotu buňky.
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Matematické a trigonometrické funkce
|
||||
##
|
||||
ABS = ABS ## Vrátí absolutní hodnotu čísla.
|
||||
ACOS = ARCCOS ## Vrátí arkuskosinus čísla.
|
||||
ACOSH = ARCCOSH ## Vrátí hyperbolický arkuskosinus čísla.
|
||||
ASIN = ARCSIN ## Vrátí arkussinus čísla.
|
||||
ASINH = ARCSINH ## Vrátí hyperbolický arkussinus čísla.
|
||||
ATAN = ARCTG ## Vrátí arkustangens čísla.
|
||||
ATAN2 = ARCTG2 ## Vrátí arkustangens x-ové a y-ové souřadnice.
|
||||
ATANH = ARCTGH ## Vrátí hyperbolický arkustangens čísla.
|
||||
CEILING = ZAOKR.NAHORU ## Zaokrouhlí číslo na nejbližší celé číslo nebo na nejbližší násobek zadané hodnoty.
|
||||
COMBIN = KOMBINACE ## Vrátí počet kombinací pro daný počet položek.
|
||||
COS = COS ## Vrátí kosinus čísla.
|
||||
COSH = COSH ## Vrátí hyperbolický kosinus čísla.
|
||||
DEGREES = DEGREES ## Převede radiány na stupně.
|
||||
EVEN = ZAOKROUHLIT.NA.SUDÉ ## Zaokrouhlí číslo nahoru na nejbližší celé sudé číslo.
|
||||
EXP = EXP ## Vrátí základ přirozeného logaritmu e umocněný na zadané číslo.
|
||||
FACT = FAKTORIÁL ## Vrátí faktoriál čísla.
|
||||
FACTDOUBLE = FACTDOUBLE ## Vrátí dvojitý faktoriál čísla.
|
||||
FLOOR = ZAOKR.DOLŮ ## Zaokrouhlí číslo dolů, směrem k nule.
|
||||
GCD = GCD ## Vrátí největší společný dělitel.
|
||||
INT = CELÁ.ČÁST ## Zaokrouhlí číslo dolů na nejbližší celé číslo.
|
||||
LCM = LCM ## Vrátí nejmenší společný násobek.
|
||||
LN = LN ## Vrátí přirozený logaritmus čísla.
|
||||
LOG = LOGZ ## Vrátí logaritmus čísla při zadaném základu.
|
||||
LOG10 = LOG ## Vrátí dekadický logaritmus čísla.
|
||||
MDETERM = DETERMINANT ## Vrátí determinant matice.
|
||||
MINVERSE = INVERZE ## Vrátí inverzní matici.
|
||||
MMULT = SOUČIN.MATIC ## Vrátí součin dvou matic.
|
||||
MOD = MOD ## Vrátí zbytek po dělení.
|
||||
MROUND = MROUND ## Vrátí číslo zaokrouhlené na požadovaný násobek.
|
||||
MULTINOMIAL = MULTINOMIAL ## Vrátí mnohočlen z množiny čísel.
|
||||
ODD = ZAOKROUHLIT.NA.LICHÉ ## Zaokrouhlí číslo nahoru na nejbližší celé liché číslo.
|
||||
PI = PI ## Vrátí hodnotu čísla pí.
|
||||
POWER = POWER ## Umocní číslo na zadanou mocninu.
|
||||
PRODUCT = SOUČIN ## Vynásobí argumenty funkce.
|
||||
QUOTIENT = QUOTIENT ## Vrátí celou část dělení.
|
||||
RADIANS = RADIANS ## Převede stupně na radiány.
|
||||
RAND = NÁHČÍSLO ## Vrátí náhodné číslo mezi 0 a 1.
|
||||
RANDBETWEEN = RANDBETWEEN ## Vrátí náhodné číslo mezi zadanými čísly.
|
||||
ROMAN = ROMAN ## Převede arabskou číslici na římskou ve formátu textu.
|
||||
ROUND = ZAOKROUHLIT ## Zaokrouhlí číslo na zadaný počet číslic.
|
||||
ROUNDDOWN = ROUNDDOWN ## Zaokrouhlí číslo dolů, směrem k nule.
|
||||
ROUNDUP = ROUNDUP ## Zaokrouhlí číslo nahoru, směrem od nuly.
|
||||
SERIESSUM = SERIESSUM ## Vrátí součet mocninné řady určené podle vzorce.
|
||||
SIGN = SIGN ## Vrátí znaménko čísla.
|
||||
SIN = SIN ## Vrátí sinus daného úhlu.
|
||||
SINH = SINH ## Vrátí hyperbolický sinus čísla.
|
||||
SQRT = ODMOCNINA ## Vrátí kladnou druhou odmocninu.
|
||||
SQRTPI = SQRTPI ## Vrátí druhou odmocninu výrazu (číslo * pí).
|
||||
SUBTOTAL = SUBTOTAL ## Vrátí souhrn v seznamu nebo databázi.
|
||||
SUM = SUMA ## Sečte argumenty funkce.
|
||||
SUMIF = SUMIF ## Sečte buňky vybrané podle zadaných kritérií.
|
||||
SUMIFS = SUMIFS ## Sečte buňky určené více zadanými podmínkami.
|
||||
SUMPRODUCT = SOUČIN.SKALÁRNÍ ## Vrátí součet součinů odpovídajících prvků matic.
|
||||
SUMSQ = SUMA.ČTVERCŮ ## Vrátí součet čtverců argumentů.
|
||||
SUMX2MY2 = SUMX2MY2 ## Vrátí součet rozdílu čtverců odpovídajících hodnot ve dvou maticích.
|
||||
SUMX2PY2 = SUMX2PY2 ## Vrátí součet součtu čtverců odpovídajících hodnot ve dvou maticích.
|
||||
SUMXMY2 = SUMXMY2 ## Vrátí součet čtverců rozdílů odpovídajících hodnot ve dvou maticích.
|
||||
TAN = TGTG ## Vrátí tangens čísla.
|
||||
TANH = TGH ## Vrátí hyperbolický tangens čísla.
|
||||
TRUNC = USEKNOUT ## Zkrátí číslo na celé číslo.
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Statistické funkce
|
||||
##
|
||||
AVEDEV = PRŮMODCHYLKA ## Vrátí průměrnou hodnotu absolutních odchylek datových bodů od jejich střední hodnoty.
|
||||
AVERAGE = PRŮMĚR ## Vrátí průměrnou hodnotu argumentů.
|
||||
AVERAGEA = AVERAGEA ## Vrátí průměrnou hodnotu argumentů včetně čísel, textu a logických hodnot.
|
||||
AVERAGEIF = AVERAGEIF ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk v oblasti, které vyhovují příslušné podmínce.
|
||||
AVERAGEIFS = AVERAGEIFS ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk vyhovujících několika podmínkám.
|
||||
BETADIST = BETADIST ## Vrátí hodnotu součtového rozdělení beta.
|
||||
BETAINV = BETAINV ## Vrátí inverzní hodnotu součtového rozdělení pro zadané rozdělení beta.
|
||||
BINOMDIST = BINOMDIST ## Vrátí hodnotu binomického rozdělení pravděpodobnosti jednotlivých veličin.
|
||||
CHIDIST = CHIDIST ## Vrátí jednostrannou pravděpodobnost rozdělení chí-kvadrát.
|
||||
CHIINV = CHIINV ## Vrátí hodnotu funkce inverzní k distribuční funkci jednostranné pravděpodobnosti rozdělení chí-kvadrát.
|
||||
CHITEST = CHITEST ## Vrátí test nezávislosti.
|
||||
CONFIDENCE = CONFIDENCE ## Vrátí interval spolehlivosti pro střední hodnotu základního souboru.
|
||||
CORREL = CORREL ## Vrátí korelační koeficient mezi dvěma množinami dat.
|
||||
COUNT = POČET ## Vrátí počet čísel v seznamu argumentů.
|
||||
COUNTA = POČET2 ## Vrátí počet hodnot v seznamu argumentů.
|
||||
COUNTBLANK = COUNTBLANK ## Spočítá počet prázdných buněk v oblasti.
|
||||
COUNTIF = COUNTIF ## Spočítá buňky v oblasti, které odpovídají zadaným kritériím.
|
||||
COUNTIFS = COUNTIFS ## Spočítá buňky v oblasti, které odpovídají více kritériím.
|
||||
COVAR = COVAR ## Vrátí hodnotu kovariance, průměrnou hodnotu součinů párových odchylek
|
||||
CRITBINOM = CRITBINOM ## Vrátí nejmenší hodnotu, pro kterou má součtové binomické rozdělení hodnotu větší nebo rovnu hodnotě kritéria.
|
||||
DEVSQ = DEVSQ ## Vrátí součet čtverců odchylek.
|
||||
EXPONDIST = EXPONDIST ## Vrátí hodnotu exponenciálního rozdělení.
|
||||
FDIST = FDIST ## Vrátí hodnotu rozdělení pravděpodobnosti F.
|
||||
FINV = FINV ## Vrátí hodnotu inverzní funkce k distribuční funkci rozdělení F.
|
||||
FISHER = FISHER ## Vrátí hodnotu Fisherovy transformace.
|
||||
FISHERINV = FISHERINV ## Vrátí hodnotu inverzní funkce k Fisherově transformaci.
|
||||
FORECAST = FORECAST ## Vrátí hodnotu lineárního trendu.
|
||||
FREQUENCY = ČETNOSTI ## Vrátí četnost rozdělení jako svislou matici.
|
||||
FTEST = FTEST ## Vrátí výsledek F-testu.
|
||||
GAMMADIST = GAMMADIST ## Vrátí hodnotu rozdělení gama.
|
||||
GAMMAINV = GAMMAINV ## Vrátí hodnotu inverzní funkce k distribuční funkci součtového rozdělení gama.
|
||||
GAMMALN = GAMMALN ## Vrátí přirozený logaritmus funkce gama, Γ(x).
|
||||
GEOMEAN = GEOMEAN ## Vrátí geometrický průměr.
|
||||
GROWTH = LOGLINTREND ## Vrátí hodnoty exponenciálního trendu.
|
||||
HARMEAN = HARMEAN ## Vrátí harmonický průměr.
|
||||
HYPGEOMDIST = HYPGEOMDIST ## Vrátí hodnotu hypergeometrického rozdělení.
|
||||
INTERCEPT = INTERCEPT ## Vrátí úsek lineární regresní čáry.
|
||||
KURT = KURT ## Vrátí hodnotu excesu množiny dat.
|
||||
LARGE = LARGE ## Vrátí k-tou největší hodnotu množiny dat.
|
||||
LINEST = LINREGRESE ## Vrátí parametry lineárního trendu.
|
||||
LOGEST = LOGLINREGRESE ## Vrátí parametry exponenciálního trendu.
|
||||
LOGINV = LOGINV ## Vrátí inverzní funkci k distribuční funkci logaritmicko-normálního rozdělení.
|
||||
LOGNORMDIST = LOGNORMDIST ## Vrátí hodnotu součtového logaritmicko-normálního rozdělení.
|
||||
MAX = MAX ## Vrátí maximální hodnotu seznamu argumentů.
|
||||
MAXA = MAXA ## Vrátí maximální hodnotu seznamu argumentů včetně čísel, textu a logických hodnot.
|
||||
MEDIAN = MEDIAN ## Vrátí střední hodnotu zadaných čísel.
|
||||
MIN = MIN ## Vrátí minimální hodnotu seznamu argumentů.
|
||||
MINA = MINA ## Vrátí nejmenší hodnotu v seznamu argumentů včetně čísel, textu a logických hodnot.
|
||||
MODE = MODE ## Vrátí hodnotu, která se v množině dat vyskytuje nejčastěji.
|
||||
NEGBINOMDIST = NEGBINOMDIST ## Vrátí hodnotu negativního binomického rozdělení.
|
||||
NORMDIST = NORMDIST ## Vrátí hodnotu normálního součtového rozdělení.
|
||||
NORMINV = NORMINV ## Vrátí inverzní funkci k funkci normálního součtového rozdělení.
|
||||
NORMSDIST = NORMSDIST ## Vrátí hodnotu standardního normálního součtového rozdělení.
|
||||
NORMSINV = NORMSINV ## Vrátí inverzní funkci k funkci standardního normálního součtového rozdělení.
|
||||
PEARSON = PEARSON ## Vrátí Pearsonův výsledný momentový korelační koeficient.
|
||||
PERCENTILE = PERCENTIL ## Vrátí hodnotu k-tého percentilu hodnot v oblasti.
|
||||
PERCENTRANK = PERCENTRANK ## Vrátí pořadí hodnoty v množině dat vyjádřené procentuální částí množiny dat.
|
||||
PERMUT = PERMUTACE ## Vrátí počet permutací pro zadaný počet objektů.
|
||||
POISSON = POISSON ## Vrátí hodnotu distribuční funkce Poissonova rozdělení.
|
||||
PROB = PROB ## Vrátí pravděpodobnost výskytu hodnot v oblasti mezi dvěma mezními hodnotami.
|
||||
QUARTILE = QUARTIL ## Vrátí hodnotu kvartilu množiny dat.
|
||||
RANK = RANK ## Vrátí pořadí čísla v seznamu čísel.
|
||||
RSQ = RKQ ## Vrátí druhou mocninu Pearsonova výsledného momentového korelačního koeficientu.
|
||||
SKEW = SKEW ## Vrátí zešikmení rozdělení.
|
||||
SLOPE = SLOPE ## Vrátí směrnici lineární regresní čáry.
|
||||
SMALL = SMALL ## Vrátí k-tou nejmenší hodnotu množiny dat.
|
||||
STANDARDIZE = STANDARDIZE ## Vrátí normalizovanou hodnotu.
|
||||
STDEV = SMODCH.VÝBĚR ## Vypočte směrodatnou odchylku výběru.
|
||||
STDEVA = STDEVA ## Vypočte směrodatnou odchylku výběru včetně čísel, textu a logických hodnot.
|
||||
STDEVP = SMODCH ## Vypočte směrodatnou odchylku základního souboru.
|
||||
STDEVPA = STDEVPA ## Vypočte směrodatnou odchylku základního souboru včetně čísel, textu a logických hodnot.
|
||||
STEYX = STEYX ## Vrátí standardní chybu předpovězené hodnoty y pro každou hodnotu x v regresi.
|
||||
TDIST = TDIST ## Vrátí hodnotu Studentova t-rozdělení.
|
||||
TINV = TINV ## Vrátí inverzní funkci k distribuční funkci Studentova t-rozdělení.
|
||||
TREND = LINTREND ## Vrátí hodnoty lineárního trendu.
|
||||
TRIMMEAN = TRIMMEAN ## Vrátí střední hodnotu vnitřní části množiny dat.
|
||||
TTEST = TTEST ## Vrátí pravděpodobnost spojenou se Studentovým t-testem.
|
||||
VAR = VAR.VÝBĚR ## Vypočte rozptyl výběru.
|
||||
VARA = VARA ## Vypočte rozptyl výběru včetně čísel, textu a logických hodnot.
|
||||
VARP = VAR ## Vypočte rozptyl základního souboru.
|
||||
VARPA = VARPA ## Vypočte rozptyl základního souboru včetně čísel, textu a logických hodnot.
|
||||
WEIBULL = WEIBULL ## Vrátí hodnotu Weibullova rozdělení.
|
||||
ZTEST = ZTEST ## Vrátí jednostrannou P-hodnotu z-testu.
|
||||
|
||||
|
||||
##
|
||||
## Text functions Textové funkce
|
||||
##
|
||||
ASC = ASC ## Změní znaky s plnou šířkou (dvoubajtové)v řetězci znaků na znaky s poloviční šířkou (jednobajtové).
|
||||
BAHTTEXT = BAHTTEXT ## Převede číslo na text ve formátu, měny ß (baht).
|
||||
CHAR = ZNAK ## Vrátí znak určený číslem kódu.
|
||||
CLEAN = VYČISTIT ## Odebere z textu všechny netisknutelné znaky.
|
||||
CODE = KÓD ## Vrátí číselný kód prvního znaku zadaného textového řetězce.
|
||||
CONCATENATE = CONCATENATE ## Spojí několik textových položek do jedné.
|
||||
DOLLAR = KČ ## Převede číslo na text ve formátu měny Kč (česká koruna).
|
||||
EXACT = STEJNÉ ## Zkontroluje, zda jsou dvě textové hodnoty shodné.
|
||||
FIND = NAJÍT ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena).
|
||||
FINDB = FINDB ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena).
|
||||
FIXED = ZAOKROUHLIT.NA.TEXT ## Zformátuje číslo jako text s pevným počtem desetinných míst.
|
||||
JIS = JIS ## Změní znaky s poloviční šířkou (jednobajtové) v řetězci znaků na znaky s plnou šířkou (dvoubajtové).
|
||||
LEFT = ZLEVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo.
|
||||
LEFTB = LEFTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo.
|
||||
LEN = DÉLKA ## Vrátí počet znaků textového řetězce.
|
||||
LENB = LENB ## Vrátí počet znaků textového řetězce.
|
||||
LOWER = MALÁ ## Převede text na malá písmena.
|
||||
MID = ČÁST ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem.
|
||||
MIDB = MIDB ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem.
|
||||
PHONETIC = ZVUKOVÉ ## Extrahuje fonetické znaky (furigana) z textového řetězce.
|
||||
PROPER = VELKÁ2 ## Převede první písmeno každého slova textové hodnoty na velké.
|
||||
REPLACE = NAHRADIT ## Nahradí znaky uvnitř textu.
|
||||
REPLACEB = NAHRADITB ## Nahradí znaky uvnitř textu.
|
||||
REPT = OPAKOVAT ## Zopakuje text podle zadaného počtu opakování.
|
||||
RIGHT = ZPRAVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo.
|
||||
RIGHTB = RIGHTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo.
|
||||
SEARCH = HLEDAT ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována).
|
||||
SEARCHB = SEARCHB ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována).
|
||||
SUBSTITUTE = DOSADIT ## V textovém řetězci nahradí starý text novým.
|
||||
T = T ## Převede argumenty na text.
|
||||
TEXT = HODNOTA.NA.TEXT ## Zformátuje číslo a převede ho na text.
|
||||
TRIM = PROČISTIT ## Odstraní z textu mezery.
|
||||
UPPER = VELKÁ ## Převede text na velká písmena.
|
||||
VALUE = HODNOTA ## Převede textový argument na číslo.
|
@ -1,25 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = kr
|
||||
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NUL!
|
||||
DIV0 = #DIVISION/0!
|
||||
VALUE = #VÆRDI!
|
||||
REF = #REFERENCE!
|
||||
NAME = #NAVN?
|
||||
NUM = #NUM!
|
||||
NA = #I/T
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Tilføjelsesprogram- og automatiseringsfunktioner
|
||||
##
|
||||
GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data, der er lagret i en pivottabelrapport
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Kubefunktioner
|
||||
##
|
||||
CUBEKPIMEMBER = KUBE.KPI.MEDLEM ## Returnerer navn, egenskab og mål for en KPI-indikator og viser navnet og egenskaben i cellen. En KPI-indikator er en målbar størrelse, f.eks. bruttooverskud pr. måned eller personaleudskiftning pr. kvartal, der bruges til at overvåge en organisations præstationer.
|
||||
CUBEMEMBER = KUBE.MEDLEM ## Returnerer et medlem eller en tupel fra kubehierarkiet. Bruges til at validere, om et medlem eller en tupel findes i kuben.
|
||||
CUBEMEMBERPROPERTY = KUBEMEDLEM.EGENSKAB ## Returnerer værdien af en egenskab for et medlem i kuben. Bruges til at validere, om et medlemsnavn findes i kuben, og returnere den angivne egenskab for medlemmet.
|
||||
CUBERANKEDMEMBER = KUBEMEDLEM.RANG ## Returnerer det n'te eller rangordnede medlem i et sæt. Bruges til at returnere et eller flere elementer i et sæt, f.eks. topsælgere eller de 10 bedste elever.
|
||||
CUBESET = KUBESÆT ## Definerer et beregnet sæt medlemmer eller tupler ved at sende et sætudtryk til kuben på serveren, som opretter sættet og returnerer det til Microsoft Office Excel.
|
||||
CUBESETCOUNT = KUBESÆT.TÆL ## Returnerer antallet af elementer i et sæt.
|
||||
CUBEVALUE = KUBEVÆRDI ## Returnerer en sammenlagt (aggregeret) værdi fra en kube.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Databasefunktioner
|
||||
##
|
||||
DAVERAGE = DMIDDEL ## Returnerer gennemsnittet af markerede databaseposter
|
||||
DCOUNT = DTÆL ## Tæller de celler, der indeholder tal, i en database
|
||||
DCOUNTA = DTÆLV ## Tæller udfyldte celler i en database
|
||||
DGET = DHENT ## Uddrager en enkelt post, der opfylder de angivne kriterier, fra en database
|
||||
DMAX = DMAKS ## Returnerer den største værdi blandt markerede databaseposter
|
||||
DMIN = DMIN ## Returnerer den mindste værdi blandt markerede databaseposter
|
||||
DPRODUCT = DPRODUKT ## Ganger værdierne i et bestemt felt med poster, der opfylder kriterierne i en database
|
||||
DSTDEV = DSTDAFV ## Beregner et skøn over standardafvigelsen baseret på en stikprøve af markerede databaseposter
|
||||
DSTDEVP = DSTDAFVP ## Beregner standardafvigelsen baseret på hele populationen af markerede databaseposter
|
||||
DSUM = DSUM ## Sammenlægger de tal i feltkolonnen i databasen, der opfylder kriterierne
|
||||
DVAR = DVARIANS ## Beregner varians baseret på en stikprøve af markerede databaseposter
|
||||
DVARP = DVARIANSP ## Beregner varians baseret på hele populationen af markerede databaseposter
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Dato- og klokkeslætsfunktioner
|
||||
##
|
||||
DATE = DATO ## Returnerer serienummeret for en bestemt dato
|
||||
DATEVALUE = DATOVÆRDI ## Konverterer en dato i form af tekst til et serienummer
|
||||
DAY = DAG ## Konverterer et serienummer til en dag i måneden
|
||||
DAYS360 = DAGE360 ## Beregner antallet af dage mellem to datoer på grundlag af et år med 360 dage
|
||||
EDATE = EDATO ## Returnerer serienummeret for den dato, der ligger det angivne antal måneder før eller efter startdatoen
|
||||
EOMONTH = SLUT.PÅ.MÅNED ## Returnerer serienummeret på den sidste dag i måneden før eller efter et angivet antal måneder
|
||||
HOUR = TIME ## Konverterer et serienummer til en time
|
||||
MINUTE = MINUT ## Konverterer et serienummer til et minut
|
||||
MONTH = MÅNED ## Konverterer et serienummer til en måned
|
||||
NETWORKDAYS = ANTAL.ARBEJDSDAGE ## Returnerer antallet af hele arbejdsdage mellem to datoer
|
||||
NOW = NU ## Returnerer serienummeret for den aktuelle dato eller det aktuelle klokkeslæt
|
||||
SECOND = SEKUND ## Konverterer et serienummer til et sekund
|
||||
TIME = KLOKKESLÆT ## Returnerer serienummeret for et bestemt klokkeslæt
|
||||
TIMEVALUE = TIDSVÆRDI ## Konverterer et klokkeslæt i form af tekst til et serienummer
|
||||
TODAY = IDAG ## Returnerer serienummeret for dags dato
|
||||
WEEKDAY = UGEDAG ## Konverterer et serienummer til en ugedag
|
||||
WEEKNUM = UGE.NR ## Konverterer et serienummer til et tal, der angiver ugenummeret i året
|
||||
WORKDAY = ARBEJDSDAG ## Returnerer serienummeret for dagen før eller efter det angivne antal arbejdsdage
|
||||
YEAR = ÅR ## Konverterer et serienummer til et år
|
||||
YEARFRAC = ÅR.BRØK ## Returnerer årsbrøken, der repræsenterer antallet af hele dage mellem startdato og slutdato
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Tekniske funktioner
|
||||
##
|
||||
BESSELI = BESSELI ## Returnerer den modificerede Bessel-funktion In(x)
|
||||
BESSELJ = BESSELJ ## Returnerer Bessel-funktionen Jn(x)
|
||||
BESSELK = BESSELK ## Returnerer den modificerede Bessel-funktion Kn(x)
|
||||
BESSELY = BESSELY ## Returnerer Bessel-funktionen Yn(x)
|
||||
BIN2DEC = BIN.TIL.DEC ## Konverterer et binært tal til et decimaltal
|
||||
BIN2HEX = BIN.TIL.HEX ## Konverterer et binært tal til et heksadecimalt tal
|
||||
BIN2OCT = BIN.TIL.OKT ## Konverterer et binært tal til et oktaltal.
|
||||
COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koefficienter til et komplekst tal
|
||||
CONVERT = KONVERTER ## Konverterer et tal fra én måleenhed til en anden
|
||||
DEC2BIN = DEC.TIL.BIN ## Konverterer et decimaltal til et binært tal
|
||||
DEC2HEX = DEC.TIL.HEX ## Konverterer et decimaltal til et heksadecimalt tal
|
||||
DEC2OCT = DEC.TIL.OKT ## Konverterer et decimaltal til et oktaltal
|
||||
DELTA = DELTA ## Tester, om to værdier er ens
|
||||
ERF = FEJLFUNK ## Returner fejlfunktionen
|
||||
ERFC = FEJLFUNK.KOMP ## Returnerer den komplementære fejlfunktion
|
||||
GESTEP = GETRIN ## Tester, om et tal er større end en grænseværdi
|
||||
HEX2BIN = HEX.TIL.BIN ## Konverterer et heksadecimalt tal til et binært tal
|
||||
HEX2DEC = HEX.TIL.DEC ## Konverterer et decimaltal til et heksadecimalt tal
|
||||
HEX2OCT = HEX.TIL.OKT ## Konverterer et heksadecimalt tal til et oktaltal
|
||||
IMABS = IMAGABS ## Returnerer den absolutte værdi (modulus) for et komplekst tal
|
||||
IMAGINARY = IMAGINÆR ## Returnerer den imaginære koefficient for et komplekst tal
|
||||
IMARGUMENT = IMAGARGUMENT ## Returnerer argumentet theta, en vinkel udtrykt i radianer
|
||||
IMCONJUGATE = IMAGKONJUGERE ## Returnerer den komplekse konjugation af et komplekst tal
|
||||
IMCOS = IMAGCOS ## Returnerer et komplekst tals cosinus
|
||||
IMDIV = IMAGDIV ## Returnerer kvotienten for to komplekse tal
|
||||
IMEXP = IMAGEKSP ## Returnerer et komplekst tals eksponentialfunktion
|
||||
IMLN = IMAGLN ## Returnerer et komplekst tals naturlige logaritme
|
||||
IMLOG10 = IMAGLOG10 ## Returnerer et komplekst tals sædvanlige logaritme (titalslogaritme)
|
||||
IMLOG2 = IMAGLOG2 ## Returnerer et komplekst tals sædvanlige logaritme (totalslogaritme)
|
||||
IMPOWER = IMAGPOTENS ## Returnerer et komplekst tal opløftet i en heltalspotens
|
||||
IMPRODUCT = IMAGPRODUKT ## Returnerer produktet af komplekse tal
|
||||
IMREAL = IMAGREELT ## Returnerer den reelle koefficient for et komplekst tal
|
||||
IMSIN = IMAGSIN ## Returnerer et komplekst tals sinus
|
||||
IMSQRT = IMAGKVROD ## Returnerer et komplekst tals kvadratrod
|
||||
IMSUB = IMAGSUB ## Returnerer forskellen mellem to komplekse tal
|
||||
IMSUM = IMAGSUM ## Returnerer summen af komplekse tal
|
||||
OCT2BIN = OKT.TIL.BIN ## Konverterer et oktaltal til et binært tal
|
||||
OCT2DEC = OKT.TIL.DEC ## Konverterer et oktaltal til et decimaltal
|
||||
OCT2HEX = OKT.TIL.HEX ## Konverterer et oktaltal til et heksadecimalt tal
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Finansielle funktioner
|
||||
##
|
||||
ACCRINT = PÅLØBRENTE ## Returnerer den påløbne rente for et værdipapir med periodiske renteudbetalinger
|
||||
ACCRINTM = PÅLØBRENTE.UDLØB ## Returnerer den påløbne rente for et værdipapir, hvor renteudbetalingen finder sted ved papirets udløb
|
||||
AMORDEGRC = AMORDEGRC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode ved hjælp af en afskrivningskoefficient
|
||||
AMORLINC = AMORLINC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode
|
||||
COUPDAYBS = KUPONDAGE.SA ## Returnerer antallet af dage fra starten af kuponperioden til afregningsdatoen
|
||||
COUPDAYS = KUPONDAGE.A ## Returnerer antallet af dage fra begyndelsen af kuponperioden til afregningsdatoen
|
||||
COUPDAYSNC = KUPONDAGE.ANK ## Returnerer antallet af dage i den kuponperiode, der indeholder afregningsdatoen
|
||||
COUPNCD = KUPONDAG.NÆSTE ## Returnerer den næste kupondato efter afregningsdatoen
|
||||
COUPNUM = KUPONBETALINGER ## Returnerer antallet af kuponudbetalinger mellem afregnings- og udløbsdatoen
|
||||
COUPPCD = KUPONDAG.FORRIGE ## Returnerer den forrige kupondato før afregningsdatoen
|
||||
CUMIPMT = AKKUM.RENTE ## Returnerer den akkumulerede rente, der betales på et lån mellem to perioder
|
||||
CUMPRINC = AKKUM.HOVEDSTOL ## Returnerer den akkumulerede nedbringelse af hovedstol mellem to perioder
|
||||
DB = DB ## Returnerer afskrivningen på et aktiv i en angivet periode ved anvendelse af saldometoden
|
||||
DDB = DSA ## Returnerer afskrivningsbeløbet for et aktiv over en bestemt periode ved anvendelse af dobbeltsaldometoden eller en anden afskrivningsmetode, som du angiver
|
||||
DISC = DISKONTO ## Returnerer et værdipapirs diskonto
|
||||
DOLLARDE = KR.DECIMAL ## Konverterer en kronepris udtrykt som brøk til en kronepris udtrykt som decimaltal
|
||||
DOLLARFR = KR.BRØK ## Konverterer en kronepris udtrykt som decimaltal til en kronepris udtrykt som brøk
|
||||
DURATION = VARIGHED ## Returnerer den årlige løbetid for et værdipapir med periodiske renteudbetalinger
|
||||
EFFECT = EFFEKTIV.RENTE ## Returnerer den årlige effektive rente
|
||||
FV = FV ## Returnerer fremtidsværdien af en investering
|
||||
FVSCHEDULE = FVTABEL ## Returnerer den fremtidige værdi af en hovedstol, når der er tilskrevet rente og rentes rente efter forskellige rentesatser
|
||||
INTRATE = RENTEFOD ## Returnerer renten på et fuldt ud investeret værdipapir
|
||||
IPMT = R.YDELSE ## Returnerer renten fra en investering for en given periode
|
||||
IRR = IA ## Returnerer den interne rente for en række pengestrømme
|
||||
ISPMT = ISPMT ## Beregner den betalte rente i løbet af en bestemt investeringsperiode
|
||||
MDURATION = MVARIGHED ## Returnerer Macauleys modificerede løbetid for et værdipapir med en formodet pari på kr. 100
|
||||
MIRR = MIA ## Returnerer den interne forrentning, hvor positive og negative pengestrømme finansieres til forskellig rente
|
||||
NOMINAL = NOMINEL ## Returnerer den årlige nominelle rente
|
||||
NPER = NPER ## Returnerer antallet af perioder for en investering
|
||||
NPV = NUTIDSVÆRDI ## Returnerer nettonutidsværdien for en investering baseret på en række periodiske pengestrømme og en diskonteringssats
|
||||
ODDFPRICE = ULIGE.KURS.PÅLYDENDE ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med en ulige (kort eller lang) første periode
|
||||
ODDFYIELD = ULIGE.FØRSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige første periode
|
||||
ODDLPRICE = ULIGE.SIDSTE.KURS ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med ulige sidste periode
|
||||
ODDLYIELD = ULIGE.SIDSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige sidste periode
|
||||
PMT = YDELSE ## Returnerer renten fra en investering for en given periode
|
||||
PPMT = H.YDELSE ## Returnerer ydelsen på hovedstolen for en investering i en given periode
|
||||
PRICE = KURS ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir med periodiske renteudbetalinger
|
||||
PRICEDISC = KURS.DISKONTO ## Returnerer kursen pr. kr 100 nominel værdi for et diskonteret værdipapir
|
||||
PRICEMAT = KURS.UDLØB ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir, hvor renten udbetales ved papirets udløb
|
||||
PV = NV ## Returnerer den nuværende værdi af en investering
|
||||
RATE = RENTE ## Returnerer renten i hver periode for en annuitet
|
||||
RECEIVED = MODTAGET.VED.UDLØB ## Returnerer det beløb, der modtages ved udløbet af et fuldt ud investeret værdipapir
|
||||
SLN = LA ## Returnerer den lineære afskrivning for et aktiv i en enkelt periode
|
||||
SYD = ÅRSAFSKRIVNING ## Returnerer den årlige afskrivning på et aktiv i en bestemt periode
|
||||
TBILLEQ = STATSOBLIGATION ## Returnerer det obligationsækvivalente afkast for en statsobligation
|
||||
TBILLPRICE = STATSOBLIGATION.KURS ## Returnerer kursen pr. kr 100 nominel værdi for en statsobligation
|
||||
TBILLYIELD = STATSOBLIGATION.AFKAST ## Returnerer en afkastet på en statsobligation
|
||||
VDB = VSA ## Returnerer afskrivningen på et aktiv i en angivet periode, herunder delperioder, ved brug af dobbeltsaldometoden
|
||||
XIRR = INTERN.RENTE ## Returnerer den interne rente for en plan over pengestrømme, der ikke behøver at være periodiske
|
||||
XNPV = NETTO.NUTIDSVÆRDI ## Returnerer nutidsværdien for en plan over pengestrømme, der ikke behøver at være periodiske
|
||||
YIELD = AFKAST ## Returnerer afkastet for et værdipapir med periodiske renteudbetalinger
|
||||
YIELDDISC = AFKAST.DISKONTO ## Returnerer det årlige afkast for et diskonteret værdipapir, f.eks. en statsobligation
|
||||
YIELDMAT = AFKAST.UDLØBSDATO ## Returnerer det årlige afkast for et værdipapir, hvor renten udbetales ved papirets udløb
|
||||
|
||||
|
||||
##
|
||||
## Information functions Informationsfunktioner
|
||||
##
|
||||
CELL = CELLE ## Returnerer oplysninger om formatering, placering eller indhold af en celle
|
||||
ERROR.TYPE = FEJLTYPE ## Returnerer et tal, der svarer til en fejltype
|
||||
INFO = INFO ## Returnerer oplysninger om det aktuelle operativmiljø
|
||||
ISBLANK = ER.TOM ## Returnerer SAND, hvis værdien er tom
|
||||
ISERR = ER.FJL ## Returnerer SAND, hvis værdien er en fejlværdi undtagen #I/T
|
||||
ISERROR = ER.FEJL ## Returnerer SAND, hvis værdien er en fejlværdi
|
||||
ISEVEN = ER.LIGE ## Returnerer SAND, hvis tallet er lige
|
||||
ISLOGICAL = ER.LOGISK ## Returnerer SAND, hvis værdien er en logisk værdi
|
||||
ISNA = ER.IKKE.TILGÆNGELIG ## Returnerer SAND, hvis værdien er fejlværdien #I/T
|
||||
ISNONTEXT = ER.IKKE.TEKST ## Returnerer SAND, hvis værdien ikke er tekst
|
||||
ISNUMBER = ER.TAL ## Returnerer SAND, hvis værdien er et tal
|
||||
ISODD = ER.ULIGE ## Returnerer SAND, hvis tallet er ulige
|
||||
ISREF = ER.REFERENCE ## Returnerer SAND, hvis værdien er en reference
|
||||
ISTEXT = ER.TEKST ## Returnerer SAND, hvis værdien er tekst
|
||||
N = TAL ## Returnerer en værdi konverteret til et tal
|
||||
NA = IKKE.TILGÆNGELIG ## Returnerer fejlværdien #I/T
|
||||
TYPE = VÆRDITYPE ## Returnerer et tal, der angiver datatypen for en værdi
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Logiske funktioner
|
||||
##
|
||||
AND = OG ## Returnerer SAND, hvis alle argumenterne er sande
|
||||
FALSE = FALSK ## Returnerer den logiske værdi FALSK
|
||||
IF = HVIS ## Angiver en logisk test, der skal udføres
|
||||
IFERROR = HVIS.FEJL ## Returnerer en værdi, du angiver, hvis en formel evauleres som en fejl. Returnerer i modsat fald resultatet af formlen
|
||||
NOT = IKKE ## Vender argumentets logik om
|
||||
OR = ELLER ## Returneret værdien SAND, hvis mindst ét argument er sandt
|
||||
TRUE = SAND ## Returnerer den logiske værdi SAND
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Opslags- og referencefunktioner
|
||||
##
|
||||
ADDRESS = ADRESSE ## Returnerer en reference som tekst til en enkelt celle i et regneark
|
||||
AREAS = OMRÅDER ## Returnerer antallet af områder i en reference
|
||||
CHOOSE = VÆLG ## Vælger en værdi på en liste med værdier
|
||||
COLUMN = KOLONNE ## Returnerer kolonnenummeret i en reference
|
||||
COLUMNS = KOLONNER ## Returnerer antallet af kolonner i en reference
|
||||
HLOOKUP = VOPSLAG ## Søger i den øverste række af en matrix og returnerer værdien af den angivne celle
|
||||
HYPERLINK = HYPERLINK ## Opretter en genvej kaldet et hyperlink, der åbner et dokument, som er lagret på en netværksserver, på et intranet eller på internettet
|
||||
INDEX = INDEKS ## Anvender et indeks til at vælge en værdi fra en reference eller en matrix
|
||||
INDIRECT = INDIREKTE ## Returnerer en reference, der er angivet af en tekstværdi
|
||||
LOOKUP = SLÅ.OP ## Søger værdier i en vektor eller en matrix
|
||||
MATCH = SAMMENLIGN ## Søger værdier i en reference eller en matrix
|
||||
OFFSET = FORSKYDNING ## Returnerer en reference forskudt i forhold til en given reference
|
||||
ROW = RÆKKE ## Returnerer rækkenummeret for en reference
|
||||
ROWS = RÆKKER ## Returnerer antallet af rækker i en reference
|
||||
RTD = RTD ## Henter realtidsdata fra et program, der understøtter COM-automatisering (Automation: En metode til at arbejde med objekter fra et andet program eller udviklingsværktøj. Automation, som tidligere blev kaldt OLE Automation, er en industristandard og en funktion i COM (Component Object Model).)
|
||||
TRANSPOSE = TRANSPONER ## Returnerer en transponeret matrix
|
||||
VLOOKUP = LOPSLAG ## Søger i øverste række af en matrix og flytter på tværs af rækken for at returnere en celleværdi
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Matematiske og trigonometriske funktioner
|
||||
##
|
||||
ABS = ABS ## Returnerer den absolutte værdi af et tal
|
||||
ACOS = ARCCOS ## Returnerer et tals arcus cosinus
|
||||
ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus af tal
|
||||
ASIN = ARCSIN ## Returnerer et tals arcus sinus
|
||||
ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus for tal
|
||||
ATAN = ARCTAN ## Returnerer et tals arcus tangens
|
||||
ATAN2 = ARCTAN2 ## Returnerer de angivne x- og y-koordinaters arcus tangens
|
||||
ATANH = ARCTANH ## Returnerer et tals inverse hyperbolske tangens
|
||||
CEILING = AFRUND.LOFT ## Afrunder et tal til nærmeste heltal eller til nærmeste multiplum af betydning
|
||||
COMBIN = KOMBIN ## Returnerer antallet af kombinationer for et givet antal objekter
|
||||
COS = COS ## Returnerer et tals cosinus
|
||||
COSH = COSH ## Returnerer den inverse hyperbolske cosinus af et tal
|
||||
DEGREES = GRADER ## Konverterer radianer til grader
|
||||
EVEN = LIGE ## Runder et tal op til nærmeste lige heltal
|
||||
EXP = EKSP ## Returnerer e opløftet til en potens af et angivet tal
|
||||
FACT = FAKULTET ## Returnerer et tals fakultet
|
||||
FACTDOUBLE = DOBBELT.FAKULTET ## Returnerer et tals dobbelte fakultet
|
||||
FLOOR = AFRUND.GULV ## Runder et tal ned mod nul
|
||||
GCD = STØRSTE.FÆLLES.DIVISOR ## Returnerer den største fælles divisor
|
||||
INT = HELTAL ## Nedrunder et tal til det nærmeste heltal
|
||||
LCM = MINDSTE.FÆLLES.MULTIPLUM ## Returnerer det mindste fælles multiplum
|
||||
LN = LN ## Returnerer et tals naturlige logaritme
|
||||
LOG = LOG ## Returnerer logaritmen for et tal på grundlag af et angivet grundtal
|
||||
LOG10 = LOG10 ## Returnerer titalslogaritmen af et tal
|
||||
MDETERM = MDETERM ## Returnerer determinanten for en matrix
|
||||
MINVERSE = MINVERT ## Returnerer den inverse matrix for en matrix
|
||||
MMULT = MPRODUKT ## Returnerer matrixproduktet af to matrixer
|
||||
MOD = REST ## Returnerer restværdien fra division
|
||||
MROUND = MAFRUND ## Returnerer et tal afrundet til det ønskede multiplum
|
||||
MULTINOMIAL = MULTINOMIAL ## Returnerer et multinomialt talsæt
|
||||
ODD = ULIGE ## Runder et tal op til nærmeste ulige heltal
|
||||
PI = PI ## Returnerer værdien af pi
|
||||
POWER = POTENS ## Returnerer resultatet af et tal opløftet til en potens
|
||||
PRODUCT = PRODUKT ## Multiplicerer argumenterne
|
||||
QUOTIENT = KVOTIENT ## Returnerer heltalsdelen ved division
|
||||
RADIANS = RADIANER ## Konverterer grader til radianer
|
||||
RAND = SLUMP ## Returnerer et tilfældigt tal mellem 0 og 1
|
||||
RANDBETWEEN = SLUMP.MELLEM ## Returnerer et tilfældigt tal mellem de tal, der angives
|
||||
ROMAN = ROMERTAL ## Konverterer et arabertal til romertal som tekst
|
||||
ROUND = AFRUND ## Afrunder et tal til et angivet antal decimaler
|
||||
ROUNDDOWN = RUND.NED ## Runder et tal ned mod nul
|
||||
ROUNDUP = RUND.OP ## Runder et tal op, væk fra 0 (nul)
|
||||
SERIESSUM = SERIESUM ## Returnerer summen af en potensserie baseret på en formel
|
||||
SIGN = FORTEGN ## Returnerer et tals fortegn
|
||||
SIN = SIN ## Returnerer en given vinkels sinusværdi
|
||||
SINH = SINH ## Returnerer den hyperbolske sinus af et tal
|
||||
SQRT = KVROD ## Returnerer en positiv kvadratrod
|
||||
SQRTPI = KVRODPI ## Returnerer kvadratroden af (tal * pi;)
|
||||
SUBTOTAL = SUBTOTAL ## Returnerer en subtotal på en liste eller i en database
|
||||
SUM = SUM ## Lægger argumenterne sammen
|
||||
SUMIF = SUM.HVIS ## Lægger de celler sammen, der er specificeret af et givet kriterium.
|
||||
SUMIFS = SUM.HVISER ## Lægger de celler i et område sammen, der opfylder flere kriterier.
|
||||
SUMPRODUCT = SUMPRODUKT ## Returnerer summen af produkter af ens matrixkomponenter
|
||||
SUMSQ = SUMKV ## Returnerer summen af argumenternes kvadrater
|
||||
SUMX2MY2 = SUMX2MY2 ## Returnerer summen af differensen mellem kvadrater af ens værdier i to matrixer
|
||||
SUMX2PY2 = SUMX2PY2 ## Returnerer summen af summen af kvadrater af tilsvarende værdier i to matrixer
|
||||
SUMXMY2 = SUMXMY2 ## Returnerer summen af kvadrater af differenser mellem ens værdier i to matrixer
|
||||
TAN = TAN ## Returnerer et tals tangens
|
||||
TANH = TANH ## Returnerer et tals hyperbolske tangens
|
||||
TRUNC = AFKORT ## Afkorter et tal til et heltal
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Statistiske funktioner
|
||||
##
|
||||
AVEDEV = MAD ## Returnerer den gennemsnitlige numeriske afvigelse fra stikprøvens middelværdi
|
||||
AVERAGE = MIDDEL ## Returnerer middelværdien af argumenterne
|
||||
AVERAGEA = MIDDELV ## Returnerer middelværdien af argumenterne og medtager tal, tekst og logiske værdier
|
||||
AVERAGEIF = MIDDEL.HVIS ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder et givet kriterium, i et område
|
||||
AVERAGEIFS = MIDDEL.HVISER ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder flere kriterier.
|
||||
BETADIST = BETAFORDELING ## Returnerer den kumulative betafordelingsfunktion
|
||||
BETAINV = BETAINV ## Returnerer den inverse kumulative fordelingsfunktion for en angivet betafordeling
|
||||
BINOMDIST = BINOMIALFORDELING ## Returnerer punktsandsynligheden for binomialfordelingen
|
||||
CHIDIST = CHIFORDELING ## Returnerer fraktilsandsynligheden for en chi2-fordeling
|
||||
CHIINV = CHIINV ## Returnerer den inverse fraktilsandsynlighed for en chi2-fordeling
|
||||
CHITEST = CHITEST ## Foretager en test for uafhængighed
|
||||
CONFIDENCE = KONFIDENSINTERVAL ## Returnerer et konfidensinterval for en population
|
||||
CORREL = KORRELATION ## Returnerer korrelationskoefficienten mellem to datasæt
|
||||
COUNT = TÆL ## Tæller antallet af tal på en liste med argumenter
|
||||
COUNTA = TÆLV ## Tæller antallet af værdier på en liste med argumenter
|
||||
COUNTBLANK = ANTAL.BLANKE ## Tæller antallet af tomme celler i et område
|
||||
COUNTIF = TÆLHVIS ## Tæller antallet af celler, som opfylder de givne kriterier, i et område
|
||||
COUNTIFS = TÆL.HVISER ## Tæller antallet af de celler, som opfylder flere kriterier, i et område
|
||||
COVAR = KOVARIANS ## Beregner kovariansen mellem to stokastiske variabler
|
||||
CRITBINOM = KRITBINOM ## Returnerer den mindste værdi for x, for hvilken det gælder, at fordelingsfunktionen er mindre end eller lig med kriterieværdien.
|
||||
DEVSQ = SAK ## Returnerer summen af de kvadrerede afvigelser fra middelværdien
|
||||
EXPONDIST = EKSPFORDELING ## Returnerer eksponentialfordelingen
|
||||
FDIST = FFORDELING ## Returnerer fraktilsandsynligheden for F-fordelingen
|
||||
FINV = FINV ## Returnerer den inverse fraktilsandsynlighed for F-fordelingen
|
||||
FISHER = FISHER ## Returnerer Fisher-transformationen
|
||||
FISHERINV = FISHERINV ## Returnerer den inverse Fisher-transformation
|
||||
FORECAST = PROGNOSE ## Returnerer en prognoseværdi baseret på lineær tendens
|
||||
FREQUENCY = FREKVENS ## Returnerer en frekvensfordeling i en søjlevektor
|
||||
FTEST = FTEST ## Returnerer resultatet af en F-test til sammenligning af varians
|
||||
GAMMADIST = GAMMAFORDELING ## Returnerer fordelingsfunktionen for gammafordelingen
|
||||
GAMMAINV = GAMMAINV ## Returnerer den inverse fordelingsfunktion for gammafordelingen
|
||||
GAMMALN = GAMMALN ## Returnerer den naturlige logaritme til gammafordelingen, G(x)
|
||||
GEOMEAN = GEOMIDDELVÆRDI ## Returnerer det geometriske gennemsnit
|
||||
GROWTH = FORØGELSE ## Returnerer værdier langs en eksponentiel tendens
|
||||
HARMEAN = HARMIDDELVÆRDI ## Returnerer det harmoniske gennemsnit
|
||||
HYPGEOMDIST = HYPGEOFORDELING ## Returnerer punktsandsynligheden i en hypergeometrisk fordeling
|
||||
INTERCEPT = SKÆRING ## Returnerer afskæringsværdien på y-aksen i en lineær regression
|
||||
KURT = TOPSTEJL ## Returnerer kurtosisværdien for en stokastisk variabel
|
||||
LARGE = STOR ## Returnerer den k'te største værdi i et datasæt
|
||||
LINEST = LINREGR ## Returnerer parameterestimaterne for en lineær tendens
|
||||
LOGEST = LOGREGR ## Returnerer parameterestimaterne for en eksponentiel tendens
|
||||
LOGINV = LOGINV ## Returnerer den inverse fordelingsfunktion for lognormalfordelingen
|
||||
LOGNORMDIST = LOGNORMFORDELING ## Returnerer fordelingsfunktionen for lognormalfordelingen
|
||||
MAX = MAKS ## Returnerer den maksimale værdi på en liste med argumenter.
|
||||
MAXA = MAKSV ## Returnerer den maksimale værdi på en liste med argumenter og medtager tal, tekst og logiske værdier
|
||||
MEDIAN = MEDIAN ## Returnerer medianen for de angivne tal
|
||||
MIN = MIN ## Returnerer den mindste værdi på en liste med argumenter.
|
||||
MINA = MINV ## Returnerer den mindste værdi på en liste med argumenter og medtager tal, tekst og logiske værdier
|
||||
MODE = HYPPIGST ## Returnerer den hyppigste værdi i et datasæt
|
||||
NEGBINOMDIST = NEGBINOMFORDELING ## Returnerer den negative binomialfordeling
|
||||
NORMDIST = NORMFORDELING ## Returnerer fordelingsfunktionen for normalfordelingen
|
||||
NORMINV = NORMINV ## Returnerer den inverse fordelingsfunktion for normalfordelingen
|
||||
NORMSDIST = STANDARDNORMFORDELING ## Returnerer fordelingsfunktionen for standardnormalfordelingen
|
||||
NORMSINV = STANDARDNORMINV ## Returnerer den inverse fordelingsfunktion for standardnormalfordelingen
|
||||
PEARSON = PEARSON ## Returnerer Pearsons korrelationskoefficient
|
||||
PERCENTILE = FRAKTIL ## Returnerer den k'te fraktil for datasættet
|
||||
PERCENTRANK = PROCENTPLADS ## Returnerer den procentuelle rang for en given værdi i et datasæt
|
||||
PERMUT = PERMUT ## Returnerer antallet af permutationer for et givet sæt objekter
|
||||
POISSON = POISSON ## Returnerer fordelingsfunktionen for en Poisson-fordeling
|
||||
PROB = SANDSYNLIGHED ## Returnerer intervalsandsynligheden
|
||||
QUARTILE = KVARTIL ## Returnerer kvartilen i et givet datasæt
|
||||
RANK = PLADS ## Returnerer rangen for et tal på en liste med tal
|
||||
RSQ = FORKLARINGSGRAD ## Returnerer R2-værdien fra en simpel lineær regression
|
||||
SKEW = SKÆVHED ## Returnerer skævheden for en stokastisk variabel
|
||||
SLOPE = HÆLDNING ## Returnerer estimatet på hældningen fra en simpel lineær regression
|
||||
SMALL = MINDSTE ## Returnerer den k'te mindste værdi i datasættet
|
||||
STANDARDIZE = STANDARDISER ## Returnerer en standardiseret værdi
|
||||
STDEV = STDAFV ## Estimerer standardafvigelsen på basis af en stikprøve
|
||||
STDEVA = STDAFVV ## Beregner standardafvigelsen på basis af en prøve og medtager tal, tekst og logiske værdier
|
||||
STDEVP = STDAFVP ## Beregner standardafvigelsen på basis af en hel population
|
||||
STDEVPA = STDAFVPV ## Beregner standardafvigelsen på basis af en hel population og medtager tal, tekst og logiske værdier
|
||||
STEYX = STFYX ## Returnerer standardafvigelsen for de estimerede y-værdier i den simple lineære regression
|
||||
TDIST = TFORDELING ## Returnerer fordelingsfunktionen for Student's t-fordeling
|
||||
TINV = TINV ## Returnerer den inverse fordelingsfunktion for Student's t-fordeling
|
||||
TREND = TENDENS ## Returnerer værdi under antagelse af en lineær tendens
|
||||
TRIMMEAN = TRIMMIDDELVÆRDI ## Returnerer den trimmede middelværdi for datasættet
|
||||
TTEST = TTEST ## Returnerer den sandsynlighed, der er forbundet med Student's t-test
|
||||
VAR = VARIANS ## Beregner variansen på basis af en prøve
|
||||
VARA = VARIANSV ## Beregner variansen på basis af en prøve og medtager tal, tekst og logiske værdier
|
||||
VARP = VARIANSP ## Beregner variansen på basis af hele populationen
|
||||
VARPA = VARIANSPV ## Beregner variansen på basis af hele populationen og medtager tal, tekst og logiske værdier
|
||||
WEIBULL = WEIBULL ## Returnerer fordelingsfunktionen for Weibull-fordelingen
|
||||
ZTEST = ZTEST ## Returnerer sandsynlighedsværdien ved en en-sidet z-test
|
||||
|
||||
|
||||
##
|
||||
## Text functions Tekstfunktioner
|
||||
##
|
||||
ASC = ASC ## Ændrer engelske tegn i fuld bredde (dobbelt-byte) eller katakana i en tegnstreng til tegn i halv bredde (enkelt-byte)
|
||||
BAHTTEXT = BAHTTEKST ## Konverterer et tal til tekst ved hjælp af valutaformatet ß (baht)
|
||||
CHAR = TEGN ## Returnerer det tegn, der svarer til kodenummeret
|
||||
CLEAN = RENS ## Fjerner alle tegn, der ikke kan udskrives, fra tekst
|
||||
CODE = KODE ## Returnerer en numerisk kode for det første tegn i en tekststreng
|
||||
CONCATENATE = SAMMENKÆDNING ## Sammenkæder adskillige tekstelementer til ét tekstelement
|
||||
DOLLAR = KR ## Konverterer et tal til tekst ved hjælp af valutaformatet kr. (kroner)
|
||||
EXACT = EKSAKT ## Kontrollerer, om to tekstværdier er identiske
|
||||
FIND = FIND ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver)
|
||||
FINDB = FINDB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver)
|
||||
FIXED = FAST ## Formaterer et tal som tekst med et fast antal decimaler
|
||||
JIS = JIS ## Ændrer engelske tegn i halv bredde (enkelt-byte) eller katakana i en tegnstreng til tegn i fuld bredde (dobbelt-byte)
|
||||
LEFT = VENSTRE ## Returnerer tegnet længst til venstre i en tekstværdi
|
||||
LEFTB = VENSTREB ## Returnerer tegnet længst til venstre i en tekstværdi
|
||||
LEN = LÆNGDE ## Returnerer antallet af tegn i en tekststreng
|
||||
LENB = LÆNGDEB ## Returnerer antallet af tegn i en tekststreng
|
||||
LOWER = SMÅ.BOGSTAVER ## Konverterer tekst til små bogstaver
|
||||
MID = MIDT ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition
|
||||
MIDB = MIDTB ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition
|
||||
PHONETIC = FONETISK ## Uddrager de fonetiske (furigana) tegn fra en tekststreng
|
||||
PROPER = STORT.FORBOGSTAV ## Konverterer første bogstav i hvert ord i teksten til stort bogstav
|
||||
REPLACE = ERSTAT ## Erstatter tegn i tekst
|
||||
REPLACEB = ERSTATB ## Erstatter tegn i tekst
|
||||
REPT = GENTAG ## Gentager tekst et givet antal gange
|
||||
RIGHT = HØJRE ## Returnerer tegnet længste til højre i en tekstværdi
|
||||
RIGHTB = HØJREB ## Returnerer tegnet længste til højre i en tekstværdi
|
||||
SEARCH = SØG ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver)
|
||||
SEARCHB = SØGB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver)
|
||||
SUBSTITUTE = UDSKIFT ## Udskifter gammel tekst med ny tekst i en tekststreng
|
||||
T = T ## Konverterer argumenterne til tekst
|
||||
TEXT = TEKST ## Formaterer et tal og konverterer det til tekst
|
||||
TRIM = FJERN.OVERFLØDIGE.BLANKE ## Fjerner mellemrum fra tekst
|
||||
UPPER = STORE.BOGSTAVER ## Konverterer tekst til store bogstaver
|
||||
VALUE = VÆRDI ## Konverterer et tekstargument til et tal
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = €
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NULL!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #WERT!
|
||||
REF = #BEZUG!
|
||||
NAME = #NAME?
|
||||
NUM = #ZAHL!
|
||||
NA = #NV
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Add-In- und Automatisierungsfunktionen
|
||||
##
|
||||
GETPIVOTDATA = PIVOTDATENZUORDNEN ## In einem PivotTable-Bericht gespeicherte Daten werden zurückgegeben.
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Cubefunktionen
|
||||
##
|
||||
CUBEKPIMEMBER = CUBEKPIELEMENT ## Gibt Name, Eigenschaft und Measure eines Key Performance Indicators (KPI) zurück und zeigt den Namen und die Eigenschaft in der Zelle an. Ein KPI ist ein quantifizierbares Maß, wie z. B. der monatliche Bruttogewinn oder die vierteljährliche Mitarbeiterfluktuation, mit dessen Hilfe das Leistungsverhalten eines Unternehmens überwacht werden kann.
|
||||
CUBEMEMBER = CUBEELEMENT ## Gibt ein Element oder ein Tuple in einer Cubehierarchie zurück. Wird verwendet, um zu überprüfen, ob das Element oder Tuple im Cube vorhanden ist.
|
||||
CUBEMEMBERPROPERTY = CUBEELEMENTEIGENSCHAFT ## Gibt den Wert einer Elementeigenschaft im Cube zurück. Wird verwendet, um zu überprüfen, ob ein Elementname im Cube vorhanden ist, und um die für dieses Element angegebene Eigenschaft zurückzugeben.
|
||||
CUBERANKEDMEMBER = CUBERANGELEMENT ## Gibt das n-te oder n-rangige Element in einer Menge zurück. Wird verwendet, um mindestens ein Element in einer Menge zurückzugeben, wie z. B. bester Vertriebsmitarbeiter oder 10 beste Kursteilnehmer.
|
||||
CUBESET = CUBEMENGE ## Definiert eine berechnete Menge Elemente oder Tuples durch Senden eines Mengenausdrucks an den Cube auf dem Server, der die Menge erstellt und an Microsoft Office Excel zurückgibt.
|
||||
CUBESETCOUNT = CUBEMENGENANZAHL ## Gibt die Anzahl der Elemente in einer Menge zurück.
|
||||
CUBEVALUE = CUBEWERT ## Gibt einen Aggregatwert aus einem Cube zurück.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Datenbankfunktionen
|
||||
##
|
||||
DAVERAGE = DBMITTELWERT ## Gibt den Mittelwert der ausgewählten Datenbankeinträge zurück
|
||||
DCOUNT = DBANZAHL ## Zählt die Zellen mit Zahlen in einer Datenbank
|
||||
DCOUNTA = DBANZAHL2 ## Zählt nicht leere Zellen in einer Datenbank
|
||||
DGET = DBAUSZUG ## Extrahiert aus einer Datenbank einen einzelnen Datensatz, der den angegebenen Kriterien entspricht
|
||||
DMAX = DBMAX ## Gibt den größten Wert aus ausgewählten Datenbankeinträgen zurück
|
||||
DMIN = DBMIN ## Gibt den kleinsten Wert aus ausgewählten Datenbankeinträgen zurück
|
||||
DPRODUCT = DBPRODUKT ## Multipliziert die Werte in einem bestimmten Feld mit Datensätzen, die den Kriterien in einer Datenbank entsprechen
|
||||
DSTDEV = DBSTDABW ## Schätzt die Standardabweichung auf der Grundlage einer Stichprobe aus ausgewählten Datenbankeinträgen
|
||||
DSTDEVP = DBSTDABWN ## Berechnet die Standardabweichung auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge
|
||||
DSUM = DBSUMME ## Addiert die Zahlen in der Feldspalte mit Datensätzen in der Datenbank, die den Kriterien entsprechen
|
||||
DVAR = DBVARIANZ ## Schätzt die Varianz auf der Grundlage ausgewählter Datenbankeinträge
|
||||
DVARP = DBVARIANZEN ## Berechnet die Varianz auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Datums- und Zeitfunktionen
|
||||
##
|
||||
DATE = DATUM ## Gibt die fortlaufende Zahl eines bestimmten Datums zurück
|
||||
DATEVALUE = DATWERT ## Wandelt ein Datum in Form von Text in eine fortlaufende Zahl um
|
||||
DAY = TAG ## Wandelt eine fortlaufende Zahl in den Tag des Monats um
|
||||
DAYS360 = TAGE360 ## Berechnet die Anzahl der Tage zwischen zwei Datumsangaben ausgehend von einem Jahr, das 360 Tage hat
|
||||
EDATE = EDATUM ## Gibt die fortlaufende Zahl des Datums zurück, bei dem es sich um die angegebene Anzahl von Monaten vor oder nach dem Anfangstermin handelt
|
||||
EOMONTH = MONATSENDE ## Gibt die fortlaufende Zahl des letzten Tags des Monats vor oder nach einer festgelegten Anzahl von Monaten zurück
|
||||
HOUR = STUNDE ## Wandelt eine fortlaufende Zahl in eine Stunde um
|
||||
MINUTE = MINUTE ## Wandelt eine fortlaufende Zahl in eine Minute um
|
||||
MONTH = MONAT ## Wandelt eine fortlaufende Zahl in einen Monat um
|
||||
NETWORKDAYS = NETTOARBEITSTAGE ## Gibt die Anzahl von ganzen Arbeitstagen zwischen zwei Datumswerten zurück
|
||||
NOW = JETZT ## Gibt die fortlaufende Zahl des aktuellen Datums und der aktuellen Uhrzeit zurück
|
||||
SECOND = SEKUNDE ## Wandelt eine fortlaufende Zahl in eine Sekunde um
|
||||
TIME = ZEIT ## Gibt die fortlaufende Zahl einer bestimmten Uhrzeit zurück
|
||||
TIMEVALUE = ZEITWERT ## Wandelt eine Uhrzeit in Form von Text in eine fortlaufende Zahl um
|
||||
TODAY = HEUTE ## Gibt die fortlaufende Zahl des heutigen Datums zurück
|
||||
WEEKDAY = WOCHENTAG ## Wandelt eine fortlaufende Zahl in den Wochentag um
|
||||
WEEKNUM = KALENDERWOCHE ## Wandelt eine fortlaufende Zahl in eine Zahl um, die angibt, in welche Woche eines Jahres das angegebene Datum fällt
|
||||
WORKDAY = ARBEITSTAG ## Gibt die fortlaufende Zahl des Datums vor oder nach einer bestimmten Anzahl von Arbeitstagen zurück
|
||||
YEAR = JAHR ## Wandelt eine fortlaufende Zahl in ein Jahr um
|
||||
YEARFRAC = BRTEILJAHRE ## Gibt die Anzahl der ganzen Tage zwischen Ausgangsdatum und Enddatum in Bruchteilen von Jahren zurück
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Konstruktionsfunktionen
|
||||
##
|
||||
BESSELI = BESSELI ## Gibt die geänderte Besselfunktion In(x) zurück
|
||||
BESSELJ = BESSELJ ## Gibt die Besselfunktion Jn(x) zurück
|
||||
BESSELK = BESSELK ## Gibt die geänderte Besselfunktion Kn(x) zurück
|
||||
BESSELY = BESSELY ## Gibt die Besselfunktion Yn(x) zurück
|
||||
BIN2DEC = BININDEZ ## Wandelt eine binäre Zahl (Dualzahl) in eine dezimale Zahl um
|
||||
BIN2HEX = BININHEX ## Wandelt eine binäre Zahl (Dualzahl) in eine hexadezimale Zahl um
|
||||
BIN2OCT = BININOKT ## Wandelt eine binäre Zahl (Dualzahl) in eine oktale Zahl um
|
||||
COMPLEX = KOMPLEXE ## Wandelt den Real- und Imaginärteil in eine komplexe Zahl um
|
||||
CONVERT = UMWANDELN ## Wandelt eine Zahl von einem Maßsystem in ein anderes um
|
||||
DEC2BIN = DEZINBIN ## Wandelt eine dezimale Zahl in eine binäre Zahl (Dualzahl) um
|
||||
DEC2HEX = DEZINHEX ## Wandelt eine dezimale Zahl in eine hexadezimale Zahl um
|
||||
DEC2OCT = DEZINOKT ## Wandelt eine dezimale Zahl in eine oktale Zahl um
|
||||
DELTA = DELTA ## Überprüft, ob zwei Werte gleich sind
|
||||
ERF = GAUSSFEHLER ## Gibt die Gauss'sche Fehlerfunktion zurück
|
||||
ERFC = GAUSSFKOMPL ## Gibt das Komplement zur Gauss'schen Fehlerfunktion zurück
|
||||
GESTEP = GGANZZAHL ## Überprüft, ob eine Zahl größer als ein gegebener Schwellenwert ist
|
||||
HEX2BIN = HEXINBIN ## Wandelt eine hexadezimale Zahl in eine Binärzahl um
|
||||
HEX2DEC = HEXINDEZ ## Wandelt eine hexadezimale Zahl in eine dezimale Zahl um
|
||||
HEX2OCT = HEXINOKT ## Wandelt eine hexadezimale Zahl in eine Oktalzahl um
|
||||
IMABS = IMABS ## Gibt den Absolutbetrag (Modulo) einer komplexen Zahl zurück
|
||||
IMAGINARY = IMAGINÄRTEIL ## Gibt den Imaginärteil einer komplexen Zahl zurück
|
||||
IMARGUMENT = IMARGUMENT ## Gibt das Argument Theta zurück, einen Winkel, der als Bogenmaß ausgedrückt wird
|
||||
IMCONJUGATE = IMKONJUGIERTE ## Gibt die konjugierte komplexe Zahl zu einer komplexen Zahl zurück
|
||||
IMCOS = IMCOS ## Gibt den Kosinus einer komplexen Zahl zurück
|
||||
IMDIV = IMDIV ## Gibt den Quotienten zweier komplexer Zahlen zurück
|
||||
IMEXP = IMEXP ## Gibt die algebraische Form einer in exponentieller Schreibweise vorliegenden komplexen Zahl zurück
|
||||
IMLN = IMLN ## Gibt den natürlichen Logarithmus einer komplexen Zahl zurück
|
||||
IMLOG10 = IMLOG10 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 10 zurück
|
||||
IMLOG2 = IMLOG2 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 2 zurück
|
||||
IMPOWER = IMAPOTENZ ## Potenziert eine komplexe Zahl mit einer ganzen Zahl
|
||||
IMPRODUCT = IMPRODUKT ## Gibt das Produkt von komplexen Zahlen zurück
|
||||
IMREAL = IMREALTEIL ## Gibt den Realteil einer komplexen Zahl zurück
|
||||
IMSIN = IMSIN ## Gibt den Sinus einer komplexen Zahl zurück
|
||||
IMSQRT = IMWURZEL ## Gibt die Quadratwurzel einer komplexen Zahl zurück
|
||||
IMSUB = IMSUB ## Gibt die Differenz zwischen zwei komplexen Zahlen zurück
|
||||
IMSUM = IMSUMME ## Gibt die Summe von komplexen Zahlen zurück
|
||||
OCT2BIN = OKTINBIN ## Wandelt eine oktale Zahl in eine binäre Zahl (Dualzahl) um
|
||||
OCT2DEC = OKTINDEZ ## Wandelt eine oktale Zahl in eine dezimale Zahl um
|
||||
OCT2HEX = OKTINHEX ## Wandelt eine oktale Zahl in eine hexadezimale Zahl um
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Finanzmathematische Funktionen
|
||||
##
|
||||
ACCRINT = AUFGELZINS ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers mit periodischen Zinszahlungen zurück
|
||||
ACCRINTM = AUFGELZINSF ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers zurück, die bei Fälligkeit ausgezahlt werden
|
||||
AMORDEGRC = AMORDEGRK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume mithilfe eines Abschreibungskoeffizienten zurück
|
||||
AMORLINC = AMORLINEARK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume zurück
|
||||
COUPDAYBS = ZINSTERMTAGVA ## Gibt die Anzahl der Tage vom Anfang des Zinstermins bis zum Abrechnungstermin zurück
|
||||
COUPDAYS = ZINSTERMTAGE ## Gibt die Anzahl der Tage der Zinsperiode zurück, die den Abrechnungstermin einschließt
|
||||
COUPDAYSNC = ZINSTERMTAGNZ ## Gibt die Anzahl der Tage vom Abrechnungstermin bis zum nächsten Zinstermin zurück
|
||||
COUPNCD = ZINSTERMNZ ## Gibt das Datum des ersten Zinstermins nach dem Abrechnungstermin zurück
|
||||
COUPNUM = ZINSTERMZAHL ## Gibt die Anzahl der Zinstermine zwischen Abrechnungs- und Fälligkeitsdatum zurück
|
||||
COUPPCD = ZINSTERMVZ ## Gibt das Datum des letzten Zinstermins vor dem Abrechnungstermin zurück
|
||||
CUMIPMT = KUMZINSZ ## Berechnet die kumulierten Zinsen, die zwischen zwei Perioden zu zahlen sind
|
||||
CUMPRINC = KUMKAPITAL ## Berechnet die aufgelaufene Tilgung eines Darlehens, die zwischen zwei Perioden zu zahlen ist
|
||||
DB = GDA2 ## Gibt die geometrisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück
|
||||
DDB = GDA ## Gibt die Abschreibung eines Anlageguts für einen angegebenen Zeitraum unter Verwendung der degressiven Doppelraten-Abschreibung oder eines anderen von Ihnen angegebenen Abschreibungsverfahrens zurück
|
||||
DISC = DISAGIO ## Gibt den in Prozent ausgedrückten Abzinsungssatz eines Wertpapiers zurück
|
||||
DOLLARDE = NOTIERUNGDEZ ## Wandelt eine Notierung, die als Dezimalbruch ausgedrückt wurde, in eine Dezimalzahl um
|
||||
DOLLARFR = NOTIERUNGBRU ## Wandelt eine Notierung, die als Dezimalzahl ausgedrückt wurde, in einen Dezimalbruch um
|
||||
DURATION = DURATION ## Gibt die jährliche Duration eines Wertpapiers mit periodischen Zinszahlungen zurück
|
||||
EFFECT = EFFEKTIV ## Gibt die jährliche Effektivverzinsung zurück
|
||||
FV = ZW ## Gibt den zukünftigen Wert (Endwert) einer Investition zurück
|
||||
FVSCHEDULE = ZW2 ## Gibt den aufgezinsten Wert des Anfangskapitals für eine Reihe periodisch unterschiedlicher Zinssätze zurück
|
||||
INTRATE = ZINSSATZ ## Gibt den Zinssatz eines voll investierten Wertpapiers zurück
|
||||
IPMT = ZINSZ ## Gibt die Zinszahlung einer Investition für die angegebene Periode zurück
|
||||
IRR = IKV ## Gibt den internen Zinsfuß einer Investition ohne Finanzierungskosten oder Reinvestitionsgewinne zurück
|
||||
ISPMT = ISPMT ## Berechnet die während eines bestimmten Zeitraums für eine Investition gezahlten Zinsen
|
||||
MDURATION = MDURATION ## Gibt die geänderte Dauer für ein Wertpapier mit einem angenommenen Nennwert von 100 € zurück
|
||||
MIRR = QIKV ## Gibt den internen Zinsfuß zurück, wobei positive und negative Zahlungen zu unterschiedlichen Sätzen finanziert werden
|
||||
NOMINAL = NOMINAL ## Gibt die jährliche Nominalverzinsung zurück
|
||||
NPER = ZZR ## Gibt die Anzahl der Zahlungsperioden einer Investition zurück
|
||||
NPV = NBW ## Gibt den Nettobarwert einer Investition auf Basis periodisch anfallender Zahlungen und eines Abzinsungsfaktors zurück
|
||||
ODDFPRICE = UNREGER.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück
|
||||
ODDFYIELD = UNREGER.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück
|
||||
ODDLPRICE = UNREGLE.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück
|
||||
ODDLYIELD = UNREGLE.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück
|
||||
PMT = RMZ ## Gibt die periodische Zahlung für eine Annuität zurück
|
||||
PPMT = KAPZ ## Gibt die Kapitalrückzahlung einer Investition für eine angegebene Periode zurück
|
||||
PRICE = KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das periodisch Zinsen auszahlt
|
||||
PRICEDISC = KURSDISAGIO ## Gibt den Kurs pro 100 € Nennwert eines unverzinslichen Wertpapiers zurück
|
||||
PRICEMAT = KURSFÄLLIG ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt
|
||||
PV = BW ## Gibt den Barwert einer Investition zurück
|
||||
RATE = ZINS ## Gibt den Zinssatz pro Zeitraum einer Annuität zurück
|
||||
RECEIVED = AUSZAHLUNG ## Gibt den Auszahlungsbetrag eines voll investierten Wertpapiers am Fälligkeitstermin zurück
|
||||
SLN = LIA ## Gibt die lineare Abschreibung eines Wirtschaftsguts pro Periode zurück
|
||||
SYD = DIA ## Gibt die arithmetisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück
|
||||
TBILLEQ = TBILLÄQUIV ## Gibt die Rendite für ein Wertpapier zurück
|
||||
TBILLPRICE = TBILLKURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück
|
||||
TBILLYIELD = TBILLRENDITE ## Gibt die Rendite für ein Wertpapier zurück
|
||||
VDB = VDB ## Gibt die degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode oder Teilperiode zurück
|
||||
XIRR = XINTZINSFUSS ## Gibt den internen Zinsfuß einer Reihe nicht periodisch anfallender Zahlungen zurück
|
||||
XNPV = XKAPITALWERT ## Gibt den Nettobarwert (Kapitalwert) einer Reihe nicht periodisch anfallender Zahlungen zurück
|
||||
YIELD = RENDITE ## Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen auszahlt
|
||||
YIELDDISC = RENDITEDIS ## Gibt die jährliche Rendite eines unverzinslichen Wertpapiers zurück
|
||||
YIELDMAT = RENDITEFÄLL ## Gibt die jährliche Rendite eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt
|
||||
|
||||
|
||||
##
|
||||
## Information functions Informationsfunktionen
|
||||
##
|
||||
CELL = ZELLE ## Gibt Informationen zu Formatierung, Position oder Inhalt einer Zelle zurück
|
||||
ERROR.TYPE = FEHLER.TYP ## Gibt eine Zahl zurück, die einem Fehlertyp entspricht
|
||||
INFO = INFO ## Gibt Informationen zur aktuellen Betriebssystemumgebung zurück
|
||||
ISBLANK = ISTLEER ## Gibt WAHR zurück, wenn der Wert leer ist
|
||||
ISERR = ISTFEHL ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert außer #N/V ist
|
||||
ISERROR = ISTFEHLER ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert ist
|
||||
ISEVEN = ISTGERADE ## Gibt WAHR zurück, wenn es sich um eine gerade Zahl handelt
|
||||
ISLOGICAL = ISTLOG ## Gibt WAHR zurück, wenn der Wert ein Wahrheitswert ist
|
||||
ISNA = ISTNV ## Gibt WAHR zurück, wenn der Wert der Fehlerwert #N/V ist
|
||||
ISNONTEXT = ISTKTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das keinen Text enthält
|
||||
ISNUMBER = ISTZAHL ## Gibt WAHR zurück, wenn der Wert eine Zahl ist
|
||||
ISODD = ISTUNGERADE ## Gibt WAHR zurück, wenn es sich um eine ungerade Zahl handelt
|
||||
ISREF = ISTBEZUG ## Gibt WAHR zurück, wenn der Wert ein Bezug ist
|
||||
ISTEXT = ISTTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das Text enthält
|
||||
N = N ## Gibt den in eine Zahl umgewandelten Wert zurück
|
||||
NA = NV ## Gibt den Fehlerwert #NV zurück
|
||||
TYPE = TYP ## Gibt eine Zahl zurück, die den Datentyp des angegebenen Werts anzeigt
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Logische Funktionen
|
||||
##
|
||||
AND = UND ## Gibt WAHR zurück, wenn alle zugehörigen Argumente WAHR sind
|
||||
FALSE = FALSCH ## Gibt den Wahrheitswert FALSCH zurück
|
||||
IF = WENN ## Gibt einen logischen Test zum Ausführen an
|
||||
IFERROR = WENNFEHLER ## Gibt einen von Ihnen festgelegten Wert zurück, wenn die Auswertung der Formel zu einem Fehler führt; andernfalls wird das Ergebnis der Formel zurückgegeben
|
||||
NOT = NICHT ## Kehrt den Wahrheitswert der zugehörigen Argumente um
|
||||
OR = ODER ## Gibt WAHR zurück, wenn ein Argument WAHR ist
|
||||
TRUE = WAHR ## Gibt den Wahrheitswert WAHR zurück
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Nachschlage- und Verweisfunktionen
|
||||
##
|
||||
ADDRESS = ADRESSE ## Gibt einen Bezug auf eine einzelne Zelle in einem Tabellenblatt als Text zurück
|
||||
AREAS = BEREICHE ## Gibt die Anzahl der innerhalb eines Bezugs aufgeführten Bereiche zurück
|
||||
CHOOSE = WAHL ## Wählt einen Wert aus eine Liste mit Werten aus
|
||||
COLUMN = SPALTE ## Gibt die Spaltennummer eines Bezugs zurück
|
||||
COLUMNS = SPALTEN ## Gibt die Anzahl der Spalten in einem Bezug zurück
|
||||
HLOOKUP = HVERWEIS ## Sucht in der obersten Zeile einer Matrix und gibt den Wert der angegebenen Zelle zurück
|
||||
HYPERLINK = HYPERLINK ## Erstellt eine Verknüpfung, über die ein auf einem Netzwerkserver, in einem Intranet oder im Internet gespeichertes Dokument geöffnet wird
|
||||
INDEX = INDEX ## Verwendet einen Index, um einen Wert aus einem Bezug oder einer Matrix auszuwählen
|
||||
INDIRECT = INDIREKT ## Gibt einen Bezug zurück, der von einem Textwert angegeben wird
|
||||
LOOKUP = LOOKUP ## Sucht Werte in einem Vektor oder einer Matrix
|
||||
MATCH = VERGLEICH ## Sucht Werte in einem Bezug oder einer Matrix
|
||||
OFFSET = BEREICH.VERSCHIEBEN ## Gibt einen Bezugoffset aus einem gegebenen Bezug zurück
|
||||
ROW = ZEILE ## Gibt die Zeilennummer eines Bezugs zurück
|
||||
ROWS = ZEILEN ## Gibt die Anzahl der Zeilen in einem Bezug zurück
|
||||
RTD = RTD ## Ruft Echtzeitdaten von einem Programm ab, das die COM-Automatisierung (Automatisierung: Ein Verfahren, bei dem aus einer Anwendung oder einem Entwicklungstool heraus mit den Objekten einer anderen Anwendung gearbeitet wird. Die früher als OLE-Automatisierung bezeichnete Automatisierung ist ein Industriestandard und eine Funktion von COM (Component Object Model).) unterstützt
|
||||
TRANSPOSE = MTRANS ## Gibt die transponierte Matrix einer Matrix zurück
|
||||
VLOOKUP = SVERWEIS ## Sucht in der ersten Spalte einer Matrix und arbeitet sich durch die Zeile, um den Wert einer Zelle zurückzugeben
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Mathematische und trigonometrische Funktionen
|
||||
##
|
||||
ABS = ABS ## Gibt den Absolutwert einer Zahl zurück
|
||||
ACOS = ARCCOS ## Gibt den Arkuskosinus einer Zahl zurück
|
||||
ACOSH = ARCCOSHYP ## Gibt den umgekehrten hyperbolischen Kosinus einer Zahl zurück
|
||||
ASIN = ARCSIN ## Gibt den Arkussinus einer Zahl zurück
|
||||
ASINH = ARCSINHYP ## Gibt den umgekehrten hyperbolischen Sinus einer Zahl zurück
|
||||
ATAN = ARCTAN ## Gibt den Arkustangens einer Zahl zurück
|
||||
ATAN2 = ARCTAN2 ## Gibt den Arkustangens einer x- und einer y-Koordinate zurück
|
||||
ATANH = ARCTANHYP ## Gibt den umgekehrten hyperbolischen Tangens einer Zahl zurück
|
||||
CEILING = OBERGRENZE ## Rundet eine Zahl auf die nächste ganze Zahl oder das nächste Vielfache von Schritt
|
||||
COMBIN = KOMBINATIONEN ## Gibt die Anzahl der Kombinationen für eine bestimmte Anzahl von Objekten zurück
|
||||
COS = COS ## Gibt den Kosinus einer Zahl zurück
|
||||
COSH = COSHYP ## Gibt den hyperbolischen Kosinus einer Zahl zurück
|
||||
DEGREES = GRAD ## Wandelt Bogenmaß (Radiant) in Grad um
|
||||
EVEN = GERADE ## Rundet eine Zahl auf die nächste gerade ganze Zahl auf
|
||||
EXP = EXP ## Potenziert die Basis e mit der als Argument angegebenen Zahl
|
||||
FACT = FAKULTÄT ## Gibt die Fakultät einer Zahl zurück
|
||||
FACTDOUBLE = ZWEIFAKULTÄT ## Gibt die Fakultät zu Zahl mit Schrittlänge 2 zurück
|
||||
FLOOR = UNTERGRENZE ## Rundet die Zahl auf Anzahl_Stellen ab
|
||||
GCD = GGT ## Gibt den größten gemeinsamen Teiler zurück
|
||||
INT = GANZZAHL ## Rundet eine Zahl auf die nächstkleinere ganze Zahl ab
|
||||
LCM = KGV ## Gibt das kleinste gemeinsame Vielfache zurück
|
||||
LN = LN ## Gibt den natürlichen Logarithmus einer Zahl zurück
|
||||
LOG = LOG ## Gibt den Logarithmus einer Zahl zu der angegebenen Basis zurück
|
||||
LOG10 = LOG10 ## Gibt den Logarithmus einer Zahl zur Basis 10 zurück
|
||||
MDETERM = MDET ## Gibt die Determinante einer Matrix zurück
|
||||
MINVERSE = MINV ## Gibt die inverse Matrix einer Matrix zurück
|
||||
MMULT = MMULT ## Gibt das Produkt zweier Matrizen zurück
|
||||
MOD = REST ## Gibt den Rest einer Division zurück
|
||||
MROUND = VRUNDEN ## Gibt eine auf das gewünschte Vielfache gerundete Zahl zurück
|
||||
MULTINOMIAL = POLYNOMIAL ## Gibt den Polynomialkoeffizienten einer Gruppe von Zahlen zurück
|
||||
ODD = UNGERADE ## Rundet eine Zahl auf die nächste ungerade ganze Zahl auf
|
||||
PI = PI ## Gibt den Wert Pi zurück
|
||||
POWER = POTENZ ## Gibt als Ergebnis eine potenzierte Zahl zurück
|
||||
PRODUCT = PRODUKT ## Multipliziert die zugehörigen Argumente
|
||||
QUOTIENT = QUOTIENT ## Gibt den ganzzahligen Anteil einer Division zurück
|
||||
RADIANS = BOGENMASS ## Wandelt Grad in Bogenmaß (Radiant) um
|
||||
RAND = ZUFALLSZAHL ## Gibt eine Zufallszahl zwischen 0 und 1 zurück
|
||||
RANDBETWEEN = ZUFALLSBEREICH ## Gibt eine Zufallszahl aus dem festgelegten Bereich zurück
|
||||
ROMAN = RÖMISCH ## Wandelt eine arabische Zahl in eine römische Zahl als Text um
|
||||
ROUND = RUNDEN ## Rundet eine Zahl auf eine bestimmte Anzahl von Dezimalstellen
|
||||
ROUNDDOWN = ABRUNDEN ## Rundet die Zahl auf Anzahl_Stellen ab
|
||||
ROUNDUP = AUFRUNDEN ## Rundet die Zahl auf Anzahl_Stellen auf
|
||||
SERIESSUM = POTENZREIHE ## Gibt die Summe von Potenzen (zur Berechnung von Potenzreihen und dichotomen Wahrscheinlichkeiten) zurück
|
||||
SIGN = VORZEICHEN ## Gibt das Vorzeichen einer Zahl zurück
|
||||
SIN = SIN ## Gibt den Sinus einer Zahl zurück
|
||||
SINH = SINHYP ## Gibt den hyperbolischen Sinus einer Zahl zurück
|
||||
SQRT = WURZEL ## Gibt die Quadratwurzel einer Zahl zurück
|
||||
SQRTPI = WURZELPI ## Gibt die Wurzel aus der mit Pi (pi) multiplizierten Zahl zurück
|
||||
SUBTOTAL = TEILERGEBNIS ## Gibt ein Teilergebnis in einer Liste oder Datenbank zurück
|
||||
SUM = SUMME ## Addiert die zugehörigen Argumente
|
||||
SUMIF = SUMMEWENN ## Addiert Zahlen, die mit den Suchkriterien übereinstimmen
|
||||
SUMIFS = SUMMEWENNS ## Die Zellen, die mehrere Kriterien erfüllen, werden in einem Bereich hinzugefügt
|
||||
SUMPRODUCT = SUMMENPRODUKT ## Gibt die Summe der Produkte zusammengehöriger Matrixkomponenten zurück
|
||||
SUMSQ = QUADRATESUMME ## Gibt die Summe der quadrierten Argumente zurück
|
||||
SUMX2MY2 = SUMMEX2MY2 ## Gibt die Summe der Differenzen der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück
|
||||
SUMX2PY2 = SUMMEX2PY2 ## Gibt die Summe der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück
|
||||
SUMXMY2 = SUMMEXMY2 ## Gibt die Summe der quadrierten Differenzen für zusammengehörige Komponenten zweier Matrizen zurück
|
||||
TAN = TAN ## Gibt den Tangens einer Zahl zurück
|
||||
TANH = TANHYP ## Gibt den hyperbolischen Tangens einer Zahl zurück
|
||||
TRUNC = KÜRZEN ## Schneidet die Kommastellen einer Zahl ab und gibt als Ergebnis eine ganze Zahl zurück
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Statistische Funktionen
|
||||
##
|
||||
AVEDEV = MITTELABW ## Gibt die durchschnittliche absolute Abweichung einer Reihe von Merkmalsausprägungen und ihrem Mittelwert zurück
|
||||
AVERAGE = MITTELWERT ## Gibt den Mittelwert der zugehörigen Argumente zurück
|
||||
AVERAGEA = MITTELWERTA ## Gibt den Mittelwert der zugehörigen Argumente, die Zahlen, Text und Wahrheitswerte enthalten, zurück
|
||||
AVERAGEIF = MITTELWERTWENN ## Der Durchschnittswert (arithmetisches Mittel) für alle Zellen in einem Bereich, die einem angegebenen Kriterium entsprechen, wird zurückgegeben
|
||||
AVERAGEIFS = MITTELWERTWENNS ## Gibt den Durchschnittswert (arithmetisches Mittel) aller Zellen zurück, die mehreren Kriterien entsprechen
|
||||
BETADIST = BETAVERT ## Gibt die Werte der kumulierten Betaverteilungsfunktion zurück
|
||||
BETAINV = BETAINV ## Gibt das Quantil der angegebenen Betaverteilung zurück
|
||||
BINOMDIST = BINOMVERT ## Gibt Wahrscheinlichkeiten einer binomialverteilten Zufallsvariablen zurück
|
||||
CHIDIST = CHIVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer Chi-Quadrat-verteilten Zufallsgröße zurück
|
||||
CHIINV = CHIINV ## Gibt Quantile der Verteilungsfunktion (1-Alpha) der Chi-Quadrat-Verteilung zurück
|
||||
CHITEST = CHITEST ## Gibt die Teststatistik eines Unabhängigkeitstests zurück
|
||||
CONFIDENCE = KONFIDENZ ## Ermöglicht die Berechnung des 1-Alpha Konfidenzintervalls für den Erwartungswert einer Zufallsvariablen
|
||||
CORREL = KORREL ## Gibt den Korrelationskoeffizienten zweier Reihen von Merkmalsausprägungen zurück
|
||||
COUNT = ANZAHL ## Gibt die Anzahl der Zahlen in der Liste mit Argumenten an
|
||||
COUNTA = ANZAHL2 ## Gibt die Anzahl der Werte in der Liste mit Argumenten an
|
||||
COUNTBLANK = ANZAHLLEEREZELLEN ## Gibt die Anzahl der leeren Zellen in einem Bereich an
|
||||
COUNTIF = ZÄHLENWENN ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit den Suchkriterien übereinstimmen
|
||||
COUNTIFS = ZÄHLENWENNS ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit mehreren Suchkriterien übereinstimmen
|
||||
COVAR = KOVAR ## Gibt die Kovarianz zurück, den Mittelwert der für alle Datenpunktpaare gebildeten Produkte der Abweichungen
|
||||
CRITBINOM = KRITBINOM ## Gibt den kleinsten Wert zurück, für den die kumulierten Wahrscheinlichkeiten der Binomialverteilung kleiner oder gleich einer Grenzwahrscheinlichkeit sind
|
||||
DEVSQ = SUMQUADABW ## Gibt die Summe der quadrierten Abweichungen der Datenpunkte von ihrem Stichprobenmittelwert zurück
|
||||
EXPONDIST = EXPONVERT ## Gibt Wahrscheinlichkeiten einer exponential verteilten Zufallsvariablen zurück
|
||||
FDIST = FVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer F-verteilten Zufallsvariablen zurück
|
||||
FINV = FINV ## Gibt Quantile der F-Verteilung zurück
|
||||
FISHER = FISHER ## Gibt die Fisher-Transformation zurück
|
||||
FISHERINV = FISHERINV ## Gibt die Umkehrung der Fisher-Transformation zurück
|
||||
FORECAST = PROGNOSE ## Gibt einen Wert zurück, der sich aus einem linearen Trend ergibt
|
||||
FREQUENCY = HÄUFIGKEIT ## Gibt eine Häufigkeitsverteilung als vertikale Matrix zurück
|
||||
FTEST = FTEST ## Gibt die Teststatistik eines F-Tests zurück
|
||||
GAMMADIST = GAMMAVERT ## Gibt Wahrscheinlichkeiten einer gammaverteilten Zufallsvariablen zurück
|
||||
GAMMAINV = GAMMAINV ## Gibt Quantile der Gammaverteilung zurück
|
||||
GAMMALN = GAMMALN ## Gibt den natürlichen Logarithmus der Gammafunktion zurück, Γ(x)
|
||||
GEOMEAN = GEOMITTEL ## Gibt das geometrische Mittel zurück
|
||||
GROWTH = VARIATION ## Gibt Werte zurück, die sich aus einem exponentiellen Trend ergeben
|
||||
HARMEAN = HARMITTEL ## Gibt das harmonische Mittel zurück
|
||||
HYPGEOMDIST = HYPGEOMVERT ## Gibt Wahrscheinlichkeiten einer hypergeometrisch-verteilten Zufallsvariablen zurück
|
||||
INTERCEPT = ACHSENABSCHNITT ## Gibt den Schnittpunkt der Regressionsgeraden zurück
|
||||
KURT = KURT ## Gibt die Kurtosis (Exzess) einer Datengruppe zurück
|
||||
LARGE = KGRÖSSTE ## Gibt den k-größten Wert einer Datengruppe zurück
|
||||
LINEST = RGP ## Gibt die Parameter eines linearen Trends zurück
|
||||
LOGEST = RKP ## Gibt die Parameter eines exponentiellen Trends zurück
|
||||
LOGINV = LOGINV ## Gibt Quantile der Lognormalverteilung zurück
|
||||
LOGNORMDIST = LOGNORMVERT ## Gibt Werte der Verteilungsfunktion einer lognormalverteilten Zufallsvariablen zurück
|
||||
MAX = MAX ## Gibt den Maximalwert einer Liste mit Argumenten zurück
|
||||
MAXA = MAXA ## Gibt den Maximalwert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten
|
||||
MEDIAN = MEDIAN ## Gibt den Median der angegebenen Zahlen zurück
|
||||
MIN = MIN ## Gibt den Minimalwert einer Liste mit Argumenten zurück
|
||||
MINA = MINA ## Gibt den kleinsten Wert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten
|
||||
MODE = MODALWERT ## Gibt den am häufigsten vorkommenden Wert in einer Datengruppe zurück
|
||||
NEGBINOMDIST = NEGBINOMVERT ## Gibt Wahrscheinlichkeiten einer negativen, binominal verteilten Zufallsvariablen zurück
|
||||
NORMDIST = NORMVERT ## Gibt Wahrscheinlichkeiten einer normal verteilten Zufallsvariablen zurück
|
||||
NORMINV = NORMINV ## Gibt Quantile der Normalverteilung zurück
|
||||
NORMSDIST = STANDNORMVERT ## Gibt Werte der Verteilungsfunktion einer standardnormalverteilten Zufallsvariablen zurück
|
||||
NORMSINV = STANDNORMINV ## Gibt Quantile der Standardnormalverteilung zurück
|
||||
PEARSON = PEARSON ## Gibt den Pearsonschen Korrelationskoeffizienten zurück
|
||||
PERCENTILE = QUANTIL ## Gibt das Alpha-Quantil einer Gruppe von Daten zurück
|
||||
PERCENTRANK = QUANTILSRANG ## Gibt den prozentualen Rang (Alpha) eines Werts in einer Datengruppe zurück
|
||||
PERMUT = VARIATIONEN ## Gibt die Anzahl der Möglichkeiten zurück, um k Elemente aus einer Menge von n Elementen ohne Zurücklegen zu ziehen
|
||||
POISSON = POISSON ## Gibt Wahrscheinlichkeiten einer poissonverteilten Zufallsvariablen zurück
|
||||
PROB = WAHRSCHBEREICH ## Gibt die Wahrscheinlichkeit für ein von zwei Werten eingeschlossenes Intervall zurück
|
||||
QUARTILE = QUARTILE ## Gibt die Quartile der Datengruppe zurück
|
||||
RANK = RANG ## Gibt den Rang zurück, den eine Zahl innerhalb einer Liste von Zahlen einnimmt
|
||||
RSQ = BESTIMMTHEITSMASS ## Gibt das Quadrat des Pearsonschen Korrelationskoeffizienten zurück
|
||||
SKEW = SCHIEFE ## Gibt die Schiefe einer Verteilung zurück
|
||||
SLOPE = STEIGUNG ## Gibt die Steigung der Regressionsgeraden zurück
|
||||
SMALL = KKLEINSTE ## Gibt den k-kleinsten Wert einer Datengruppe zurück
|
||||
STANDARDIZE = STANDARDISIERUNG ## Gibt den standardisierten Wert zurück
|
||||
STDEV = STABW ## Schätzt die Standardabweichung ausgehend von einer Stichprobe
|
||||
STDEVA = STABWA ## Schätzt die Standardabweichung ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält
|
||||
STDEVP = STABWN ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit
|
||||
STDEVPA = STABWNA ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält
|
||||
STEYX = STFEHLERYX ## Gibt den Standardfehler der geschätzten y-Werte für alle x-Werte der Regression zurück
|
||||
TDIST = TVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer (Student) t-verteilten Zufallsvariablen zurück
|
||||
TINV = TINV ## Gibt Quantile der t-Verteilung zurück
|
||||
TREND = TREND ## Gibt Werte zurück, die sich aus einem linearen Trend ergeben
|
||||
TRIMMEAN = GESTUTZTMITTEL ## Gibt den Mittelwert einer Datengruppe zurück, ohne die Randwerte zu berücksichtigen
|
||||
TTEST = TTEST ## Gibt die Teststatistik eines Student'schen t-Tests zurück
|
||||
VAR = VARIANZ ## Schätzt die Varianz ausgehend von einer Stichprobe
|
||||
VARA = VARIANZA ## Schätzt die Varianz ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält
|
||||
VARP = VARIANZEN ## Berechnet die Varianz ausgehend von der Grundgesamtheit
|
||||
VARPA = VARIANZENA ## Berechnet die Varianz ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält
|
||||
WEIBULL = WEIBULL ## Gibt Wahrscheinlichkeiten einer weibullverteilten Zufallsvariablen zurück
|
||||
ZTEST = GTEST ## Gibt den einseitigen Wahrscheinlichkeitswert für einen Gausstest (Normalverteilung) zurück
|
||||
|
||||
|
||||
##
|
||||
## Text functions Textfunktionen
|
||||
##
|
||||
ASC = ASC ## Konvertiert DB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in SB-Text
|
||||
BAHTTEXT = BAHTTEXT ## Wandelt eine Zahl in Text im Währungsformat ß (Baht) um
|
||||
CHAR = ZEICHEN ## Gibt das der Codezahl entsprechende Zeichen zurück
|
||||
CLEAN = SÄUBERN ## Löscht alle nicht druckbaren Zeichen aus einem Text
|
||||
CODE = CODE ## Gibt die Codezahl des ersten Zeichens in einem Text zurück
|
||||
CONCATENATE = VERKETTEN ## Verknüpft mehrere Textelemente zu einem Textelement
|
||||
DOLLAR = DM ## Wandelt eine Zahl in Text im Währungsformat € (Euro) um
|
||||
EXACT = IDENTISCH ## Prüft, ob zwei Textwerte identisch sind
|
||||
FIND = FINDEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden)
|
||||
FINDB = FINDENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden)
|
||||
FIXED = FEST ## Formatiert eine Zahl als Text mit einer festen Anzahl von Dezimalstellen
|
||||
JIS = JIS ## Konvertiert SB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in DB-Text
|
||||
LEFT = LINKS ## Gibt die Zeichen ganz links in einem Textwert zurück
|
||||
LEFTB = LINKSB ## Gibt die Zeichen ganz links in einem Textwert zurück
|
||||
LEN = LÄNGE ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück
|
||||
LENB = LÄNGEB ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück
|
||||
LOWER = KLEIN ## Wandelt Text in Kleinbuchstaben um
|
||||
MID = TEIL ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück
|
||||
MIDB = TEILB ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück
|
||||
PHONETIC = PHONETIC ## Extrahiert die phonetischen (Furigana-)Zeichen aus einer Textzeichenfolge
|
||||
PROPER = GROSS2 ## Wandelt den ersten Buchstaben aller Wörter eines Textwerts in Großbuchstaben um
|
||||
REPLACE = ERSETZEN ## Ersetzt Zeichen in Text
|
||||
REPLACEB = ERSETZENB ## Ersetzt Zeichen in Text
|
||||
REPT = WIEDERHOLEN ## Wiederholt einen Text so oft wie angegeben
|
||||
RIGHT = RECHTS ## Gibt die Zeichen ganz rechts in einem Textwert zurück
|
||||
RIGHTB = RECHTSB ## Gibt die Zeichen ganz rechts in einem Textwert zurück
|
||||
SEARCH = SUCHEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden)
|
||||
SEARCHB = SUCHENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden)
|
||||
SUBSTITUTE = WECHSELN ## Ersetzt in einer Zeichenfolge neuen Text gegen alten
|
||||
T = T ## Wandelt die zugehörigen Argumente in Text um
|
||||
TEXT = TEXT ## Formatiert eine Zahl und wandelt sie in Text um
|
||||
TRIM = GLÄTTEN ## Entfernt Leerzeichen aus Text
|
||||
UPPER = GROSS ## Wandelt Text in Großbuchstaben um
|
||||
VALUE = WERT ## Wandelt ein Textargument in eine Zahl um
|
@ -1,8 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = £
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = $ ## I'm surprised that the Excel Documentation suggests $ rather than €
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #¡NULO!
|
||||
DIV0 = #¡DIV/0!
|
||||
VALUE = #¡VALOR!
|
||||
REF = #¡REF!
|
||||
NAME = #¿NOMBRE?
|
||||
NUM = #¡NÚM!
|
||||
NA = #N/A
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Funciones de complementos y automatización
|
||||
##
|
||||
GETPIVOTDATA = IMPORTARDATOSDINAMICOS ## Devuelve los datos almacenados en un informe de tabla dinámica.
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Funciones de cubo
|
||||
##
|
||||
CUBEKPIMEMBER = MIEMBROKPICUBO ## Devuelve un nombre, propiedad y medida de indicador de rendimiento clave (KPI) y muestra el nombre y la propiedad en la celda. Un KPI es una medida cuantificable, como los beneficios brutos mensuales o la facturación trimestral por empleado, que se usa para supervisar el rendimiento de una organización.
|
||||
CUBEMEMBER = MIEMBROCUBO ## Devuelve un miembro o tupla en una jerarquía de cubo. Se usa para validar la existencia del miembro o la tupla en el cubo.
|
||||
CUBEMEMBERPROPERTY = PROPIEDADMIEMBROCUBO ## Devuelve el valor de una propiedad de miembro del cubo Se usa para validar la existencia de un nombre de miembro en el cubo y para devolver la propiedad especificada para este miembro.
|
||||
CUBERANKEDMEMBER = MIEMBRORANGOCUBO ## Devuelve el miembro n, o clasificado, de un conjunto. Se usa para devolver uno o más elementos de un conjunto, por ejemplo, el representante con mejores ventas o los diez mejores alumnos.
|
||||
CUBESET = CONJUNTOCUBO ## Define un conjunto calculado de miembros o tuplas mediante el envío de una expresión de conjunto al cubo en el servidor, lo que crea el conjunto y, después, devuelve dicho conjunto a Microsoft Office Excel.
|
||||
CUBESETCOUNT = RECUENTOCONJUNTOCUBO ## Devuelve el número de elementos de un conjunto.
|
||||
CUBEVALUE = VALORCUBO ## Devuelve un valor agregado de un cubo.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Funciones de base de datos
|
||||
##
|
||||
DAVERAGE = BDPROMEDIO ## Devuelve el promedio de las entradas seleccionadas en la base de datos.
|
||||
DCOUNT = BDCONTAR ## Cuenta el número de celdas que contienen números en una base de datos.
|
||||
DCOUNTA = BDCONTARA ## Cuenta el número de celdas no vacías en una base de datos.
|
||||
DGET = BDEXTRAER ## Extrae de una base de datos un único registro que cumple los criterios especificados.
|
||||
DMAX = BDMAX ## Devuelve el valor máximo de las entradas seleccionadas de la base de datos.
|
||||
DMIN = BDMIN ## Devuelve el valor mínimo de las entradas seleccionadas de la base de datos.
|
||||
DPRODUCT = BDPRODUCTO ## Multiplica los valores de un campo concreto de registros de una base de datos que cumplen los criterios especificados.
|
||||
DSTDEV = BDDESVEST ## Calcula la desviación estándar a partir de una muestra de entradas seleccionadas en la base de datos.
|
||||
DSTDEVP = BDDESVESTP ## Calcula la desviación estándar en función de la población total de las entradas seleccionadas de la base de datos.
|
||||
DSUM = BDSUMA ## Suma los números de la columna de campo de los registros de la base de datos que cumplen los criterios.
|
||||
DVAR = BDVAR ## Calcula la varianza a partir de una muestra de entradas seleccionadas de la base de datos.
|
||||
DVARP = BDVARP ## Calcula la varianza a partir de la población total de entradas seleccionadas de la base de datos.
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Funciones de fecha y hora
|
||||
##
|
||||
DATE = FECHA ## Devuelve el número de serie correspondiente a una fecha determinada.
|
||||
DATEVALUE = FECHANUMERO ## Convierte una fecha con formato de texto en un valor de número de serie.
|
||||
DAY = DIA ## Convierte un número de serie en un valor de día del mes.
|
||||
DAYS360 = DIAS360 ## Calcula el número de días entre dos fechas a partir de un año de 360 días.
|
||||
EDATE = FECHA.MES ## Devuelve el número de serie de la fecha equivalente al número indicado de meses anteriores o posteriores a la fecha inicial.
|
||||
EOMONTH = FIN.MES ## Devuelve el número de serie correspondiente al último día del mes anterior o posterior a un número de meses especificado.
|
||||
HOUR = HORA ## Convierte un número de serie en un valor de hora.
|
||||
MINUTE = MINUTO ## Convierte un número de serie en un valor de minuto.
|
||||
MONTH = MES ## Convierte un número de serie en un valor de mes.
|
||||
NETWORKDAYS = DIAS.LAB ## Devuelve el número de todos los días laborables existentes entre dos fechas.
|
||||
NOW = AHORA ## Devuelve el número de serie correspondiente a la fecha y hora actuales.
|
||||
SECOND = SEGUNDO ## Convierte un número de serie en un valor de segundo.
|
||||
TIME = HORA ## Devuelve el número de serie correspondiente a una hora determinada.
|
||||
TIMEVALUE = HORANUMERO ## Convierte una hora con formato de texto en un valor de número de serie.
|
||||
TODAY = HOY ## Devuelve el número de serie correspondiente al día actual.
|
||||
WEEKDAY = DIASEM ## Convierte un número de serie en un valor de día de la semana.
|
||||
WEEKNUM = NUM.DE.SEMANA ## Convierte un número de serie en un número que representa el lugar numérico correspondiente a una semana de un año.
|
||||
WORKDAY = DIA.LAB ## Devuelve el número de serie de la fecha que tiene lugar antes o después de un número determinado de días laborables.
|
||||
YEAR = AÑO ## Convierte un número de serie en un valor de año.
|
||||
YEARFRAC = FRAC.AÑO ## Devuelve la fracción de año que representa el número total de días existentes entre el valor de fecha_inicial y el de fecha_final.
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Funciones de ingeniería
|
||||
##
|
||||
BESSELI = BESSELI ## Devuelve la función Bessel In(x) modificada.
|
||||
BESSELJ = BESSELJ ## Devuelve la función Bessel Jn(x).
|
||||
BESSELK = BESSELK ## Devuelve la función Bessel Kn(x) modificada.
|
||||
BESSELY = BESSELY ## Devuelve la función Bessel Yn(x).
|
||||
BIN2DEC = BIN.A.DEC ## Convierte un número binario en decimal.
|
||||
BIN2HEX = BIN.A.HEX ## Convierte un número binario en hexadecimal.
|
||||
BIN2OCT = BIN.A.OCT ## Convierte un número binario en octal.
|
||||
COMPLEX = COMPLEJO ## Convierte coeficientes reales e imaginarios en un número complejo.
|
||||
CONVERT = CONVERTIR ## Convierte un número de un sistema de medida a otro.
|
||||
DEC2BIN = DEC.A.BIN ## Convierte un número decimal en binario.
|
||||
DEC2HEX = DEC.A.HEX ## Convierte un número decimal en hexadecimal.
|
||||
DEC2OCT = DEC.A.OCT ## Convierte un número decimal en octal.
|
||||
DELTA = DELTA ## Comprueba si dos valores son iguales.
|
||||
ERF = FUN.ERROR ## Devuelve la función de error.
|
||||
ERFC = FUN.ERROR.COMPL ## Devuelve la función de error complementario.
|
||||
GESTEP = MAYOR.O.IGUAL ## Comprueba si un número es mayor que un valor de umbral.
|
||||
HEX2BIN = HEX.A.BIN ## Convierte un número hexadecimal en binario.
|
||||
HEX2DEC = HEX.A.DEC ## Convierte un número hexadecimal en decimal.
|
||||
HEX2OCT = HEX.A.OCT ## Convierte un número hexadecimal en octal.
|
||||
IMABS = IM.ABS ## Devuelve el valor absoluto (módulo) de un número complejo.
|
||||
IMAGINARY = IMAGINARIO ## Devuelve el coeficiente imaginario de un número complejo.
|
||||
IMARGUMENT = IM.ANGULO ## Devuelve el argumento theta, un ángulo expresado en radianes.
|
||||
IMCONJUGATE = IM.CONJUGADA ## Devuelve la conjugada compleja de un número complejo.
|
||||
IMCOS = IM.COS ## Devuelve el coseno de un número complejo.
|
||||
IMDIV = IM.DIV ## Devuelve el cociente de dos números complejos.
|
||||
IMEXP = IM.EXP ## Devuelve el valor exponencial de un número complejo.
|
||||
IMLN = IM.LN ## Devuelve el logaritmo natural (neperiano) de un número complejo.
|
||||
IMLOG10 = IM.LOG10 ## Devuelve el logaritmo en base 10 de un número complejo.
|
||||
IMLOG2 = IM.LOG2 ## Devuelve el logaritmo en base 2 de un número complejo.
|
||||
IMPOWER = IM.POT ## Devuelve un número complejo elevado a una potencia entera.
|
||||
IMPRODUCT = IM.PRODUCT ## Devuelve el producto de números complejos.
|
||||
IMREAL = IM.REAL ## Devuelve el coeficiente real de un número complejo.
|
||||
IMSIN = IM.SENO ## Devuelve el seno de un número complejo.
|
||||
IMSQRT = IM.RAIZ2 ## Devuelve la raíz cuadrada de un número complejo.
|
||||
IMSUB = IM.SUSTR ## Devuelve la diferencia entre dos números complejos.
|
||||
IMSUM = IM.SUM ## Devuelve la suma de números complejos.
|
||||
OCT2BIN = OCT.A.BIN ## Convierte un número octal en binario.
|
||||
OCT2DEC = OCT.A.DEC ## Convierte un número octal en decimal.
|
||||
OCT2HEX = OCT.A.HEX ## Convierte un número octal en hexadecimal.
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Funciones financieras
|
||||
##
|
||||
ACCRINT = INT.ACUM ## Devuelve el interés acumulado de un valor bursátil con pagos de interés periódicos.
|
||||
ACCRINTM = INT.ACUM.V ## Devuelve el interés acumulado de un valor bursátil con pagos de interés al vencimiento.
|
||||
AMORDEGRC = AMORTIZ.PROGRE ## Devuelve la amortización de cada período contable mediante el uso de un coeficiente de amortización.
|
||||
AMORLINC = AMORTIZ.LIN ## Devuelve la amortización de cada uno de los períodos contables.
|
||||
COUPDAYBS = CUPON.DIAS.L1 ## Devuelve el número de días desde el principio del período de un cupón hasta la fecha de liquidación.
|
||||
COUPDAYS = CUPON.DIAS ## Devuelve el número de días del período (entre dos cupones) donde se encuentra la fecha de liquidación.
|
||||
COUPDAYSNC = CUPON.DIAS.L2 ## Devuelve el número de días desde la fecha de liquidación hasta la fecha del próximo cupón.
|
||||
COUPNCD = CUPON.FECHA.L2 ## Devuelve la fecha del próximo cupón después de la fecha de liquidación.
|
||||
COUPNUM = CUPON.NUM ## Devuelve el número de pagos de cupón entre la fecha de liquidación y la fecha de vencimiento.
|
||||
COUPPCD = CUPON.FECHA.L1 ## Devuelve la fecha de cupón anterior a la fecha de liquidación.
|
||||
CUMIPMT = PAGO.INT.ENTRE ## Devuelve el interés acumulado pagado entre dos períodos.
|
||||
CUMPRINC = PAGO.PRINC.ENTRE ## Devuelve el capital acumulado pagado de un préstamo entre dos períodos.
|
||||
DB = DB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización de saldo fijo.
|
||||
DDB = DDB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización por doble disminución de saldo u otro método que se especifique.
|
||||
DISC = TASA.DESC ## Devuelve la tasa de descuento de un valor bursátil.
|
||||
DOLLARDE = MONEDA.DEC ## Convierte una cotización de un valor bursátil expresada en forma fraccionaria en una cotización de un valor bursátil expresada en forma decimal.
|
||||
DOLLARFR = MONEDA.FRAC ## Convierte una cotización de un valor bursátil expresada en forma decimal en una cotización de un valor bursátil expresada en forma fraccionaria.
|
||||
DURATION = DURACION ## Devuelve la duración anual de un valor bursátil con pagos de interés periódico.
|
||||
EFFECT = INT.EFECTIVO ## Devuelve la tasa de interés anual efectiva.
|
||||
FV = VF ## Devuelve el valor futuro de una inversión.
|
||||
FVSCHEDULE = VF.PLAN ## Devuelve el valor futuro de un capital inicial después de aplicar una serie de tasas de interés compuesto.
|
||||
INTRATE = TASA.INT ## Devuelve la tasa de interés para la inversión total de un valor bursátil.
|
||||
IPMT = PAGOINT ## Devuelve el pago de intereses de una inversión durante un período determinado.
|
||||
IRR = TIR ## Devuelve la tasa interna de retorno para una serie de flujos de efectivo periódicos.
|
||||
ISPMT = INT.PAGO.DIR ## Calcula el interés pagado durante un período específico de una inversión.
|
||||
MDURATION = DURACION.MODIF ## Devuelve la duración de Macauley modificada de un valor bursátil con un valor nominal supuesto de 100 $.
|
||||
MIRR = TIRM ## Devuelve la tasa interna de retorno donde se financian flujos de efectivo positivos y negativos a tasas diferentes.
|
||||
NOMINAL = TASA.NOMINAL ## Devuelve la tasa nominal de interés anual.
|
||||
NPER = NPER ## Devuelve el número de períodos de una inversión.
|
||||
NPV = VNA ## Devuelve el valor neto actual de una inversión en función de una serie de flujos periódicos de efectivo y una tasa de descuento.
|
||||
ODDFPRICE = PRECIO.PER.IRREGULAR.1 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un primer período impar.
|
||||
ODDFYIELD = RENDTO.PER.IRREGULAR.1 ## Devuelve el rendimiento de un valor bursátil con un primer período impar.
|
||||
ODDLPRICE = PRECIO.PER.IRREGULAR.2 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un último período impar.
|
||||
ODDLYIELD = RENDTO.PER.IRREGULAR.2 ## Devuelve el rendimiento de un valor bursátil con un último período impar.
|
||||
PMT = PAGO ## Devuelve el pago periódico de una anualidad.
|
||||
PPMT = PAGOPRIN ## Devuelve el pago de capital de una inversión durante un período determinado.
|
||||
PRICE = PRECIO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga una tasa de interés periódico.
|
||||
PRICEDISC = PRECIO.DESCUENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con descuento.
|
||||
PRICEMAT = PRECIO.VENCIMIENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga interés a su vencimiento.
|
||||
PV = VALACT ## Devuelve el valor actual de una inversión.
|
||||
RATE = TASA ## Devuelve la tasa de interés por período de una anualidad.
|
||||
RECEIVED = CANTIDAD.RECIBIDA ## Devuelve la cantidad recibida al vencimiento de un valor bursátil completamente invertido.
|
||||
SLN = SLN ## Devuelve la amortización por método directo de un bien en un período dado.
|
||||
SYD = SYD ## Devuelve la amortización por suma de dígitos de los años de un bien durante un período especificado.
|
||||
TBILLEQ = LETRA.DE.TES.EQV.A.BONO ## Devuelve el rendimiento de un bono equivalente a una letra del Tesoro (de EE.UU.)
|
||||
TBILLPRICE = LETRA.DE.TES.PRECIO ## Devuelve el precio por un valor nominal de 100 $ de una letra del Tesoro (de EE.UU.)
|
||||
TBILLYIELD = LETRA.DE.TES.RENDTO ## Devuelve el rendimiento de una letra del Tesoro (de EE.UU.)
|
||||
VDB = DVS ## Devuelve la amortización de un bien durante un período específico o parcial a través del método de cálculo del saldo en disminución.
|
||||
XIRR = TIR.NO.PER ## Devuelve la tasa interna de retorno para un flujo de efectivo que no es necesariamente periódico.
|
||||
XNPV = VNA.NO.PER ## Devuelve el valor neto actual para un flujo de efectivo que no es necesariamente periódico.
|
||||
YIELD = RENDTO ## Devuelve el rendimiento de un valor bursátil que paga intereses periódicos.
|
||||
YIELDDISC = RENDTO.DESC ## Devuelve el rendimiento anual de un valor bursátil con descuento; por ejemplo, una letra del Tesoro (de EE.UU.)
|
||||
YIELDMAT = RENDTO.VENCTO ## Devuelve el rendimiento anual de un valor bursátil que paga intereses al vencimiento.
|
||||
|
||||
|
||||
##
|
||||
## Information functions Funciones de información
|
||||
##
|
||||
CELL = CELDA ## Devuelve información acerca del formato, la ubicación o el contenido de una celda.
|
||||
ERROR.TYPE = TIPO.DE.ERROR ## Devuelve un número que corresponde a un tipo de error.
|
||||
INFO = INFO ## Devuelve información acerca del entorno operativo en uso.
|
||||
ISBLANK = ESBLANCO ## Devuelve VERDADERO si el valor está en blanco.
|
||||
ISERR = ESERR ## Devuelve VERDADERO si el valor es cualquier valor de error excepto #N/A.
|
||||
ISERROR = ESERROR ## Devuelve VERDADERO si el valor es cualquier valor de error.
|
||||
ISEVEN = ES.PAR ## Devuelve VERDADERO si el número es par.
|
||||
ISLOGICAL = ESLOGICO ## Devuelve VERDADERO si el valor es un valor lógico.
|
||||
ISNA = ESNOD ## Devuelve VERDADERO si el valor es el valor de error #N/A.
|
||||
ISNONTEXT = ESNOTEXTO ## Devuelve VERDADERO si el valor no es texto.
|
||||
ISNUMBER = ESNUMERO ## Devuelve VERDADERO si el valor es un número.
|
||||
ISODD = ES.IMPAR ## Devuelve VERDADERO si el número es impar.
|
||||
ISREF = ESREF ## Devuelve VERDADERO si el valor es una referencia.
|
||||
ISTEXT = ESTEXTO ## Devuelve VERDADERO si el valor es texto.
|
||||
N = N ## Devuelve un valor convertido en un número.
|
||||
NA = ND ## Devuelve el valor de error #N/A.
|
||||
TYPE = TIPO ## Devuelve un número que indica el tipo de datos de un valor.
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Funciones lógicas
|
||||
##
|
||||
AND = Y ## Devuelve VERDADERO si todos sus argumentos son VERDADERO.
|
||||
FALSE = FALSO ## Devuelve el valor lógico FALSO.
|
||||
IF = SI ## Especifica una prueba lógica que realizar.
|
||||
IFERROR = SI.ERROR ## Devuelve un valor que se especifica si una fórmula lo evalúa como un error; de lo contrario, devuelve el resultado de la fórmula.
|
||||
NOT = NO ## Invierte el valor lógico del argumento.
|
||||
OR = O ## Devuelve VERDADERO si cualquier argumento es VERDADERO.
|
||||
TRUE = VERDADERO ## Devuelve el valor lógico VERDADERO.
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Funciones de búsqueda y referencia
|
||||
##
|
||||
ADDRESS = DIRECCION ## Devuelve una referencia como texto a una sola celda de una hoja de cálculo.
|
||||
AREAS = AREAS ## Devuelve el número de áreas de una referencia.
|
||||
CHOOSE = ELEGIR ## Elige un valor de una lista de valores.
|
||||
COLUMN = COLUMNA ## Devuelve el número de columna de una referencia.
|
||||
COLUMNS = COLUMNAS ## Devuelve el número de columnas de una referencia.
|
||||
HLOOKUP = BUSCARH ## Busca en la fila superior de una matriz y devuelve el valor de la celda indicada.
|
||||
HYPERLINK = HIPERVINCULO ## Crea un acceso directo o un salto que abre un documento almacenado en un servidor de red, en una intranet o en Internet.
|
||||
INDEX = INDICE ## Usa un índice para elegir un valor de una referencia o matriz.
|
||||
INDIRECT = INDIRECTO ## Devuelve una referencia indicada por un valor de texto.
|
||||
LOOKUP = BUSCAR ## Busca valores de un vector o una matriz.
|
||||
MATCH = COINCIDIR ## Busca valores de una referencia o matriz.
|
||||
OFFSET = DESREF ## Devuelve un desplazamiento de referencia respecto a una referencia dada.
|
||||
ROW = FILA ## Devuelve el número de fila de una referencia.
|
||||
ROWS = FILAS ## Devuelve el número de filas de una referencia.
|
||||
RTD = RDTR ## Recupera datos en tiempo real desde un programa compatible con la automatización COM (automatización: modo de trabajar con los objetos de una aplicación desde otra aplicación o herramienta de entorno. La automatización, antes denominada automatización OLE, es un estándar de la industria y una función del Modelo de objetos componentes (COM).).
|
||||
TRANSPOSE = TRANSPONER ## Devuelve la transposición de una matriz.
|
||||
VLOOKUP = BUSCARV ## Busca en la primera columna de una matriz y se mueve en horizontal por la fila para devolver el valor de una celda.
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Funciones matemáticas y trigonométricas
|
||||
##
|
||||
ABS = ABS ## Devuelve el valor absoluto de un número.
|
||||
ACOS = ACOS ## Devuelve el arcocoseno de un número.
|
||||
ACOSH = ACOSH ## Devuelve el coseno hiperbólico inverso de un número.
|
||||
ASIN = ASENO ## Devuelve el arcoseno de un número.
|
||||
ASINH = ASENOH ## Devuelve el seno hiperbólico inverso de un número.
|
||||
ATAN = ATAN ## Devuelve la arcotangente de un número.
|
||||
ATAN2 = ATAN2 ## Devuelve la arcotangente de las coordenadas "x" e "y".
|
||||
ATANH = ATANH ## Devuelve la tangente hiperbólica inversa de un número.
|
||||
CEILING = MULTIPLO.SUPERIOR ## Redondea un número al entero más próximo o al múltiplo significativo más cercano.
|
||||
COMBIN = COMBINAT ## Devuelve el número de combinaciones para un número determinado de objetos.
|
||||
COS = COS ## Devuelve el coseno de un número.
|
||||
COSH = COSH ## Devuelve el coseno hiperbólico de un número.
|
||||
DEGREES = GRADOS ## Convierte radianes en grados.
|
||||
EVEN = REDONDEA.PAR ## Redondea un número hasta el entero par más próximo.
|
||||
EXP = EXP ## Devuelve e elevado a la potencia de un número dado.
|
||||
FACT = FACT ## Devuelve el factorial de un número.
|
||||
FACTDOUBLE = FACT.DOBLE ## Devuelve el factorial doble de un número.
|
||||
FLOOR = MULTIPLO.INFERIOR ## Redondea un número hacia abajo, en dirección hacia cero.
|
||||
GCD = M.C.D ## Devuelve el máximo común divisor.
|
||||
INT = ENTERO ## Redondea un número hacia abajo hasta el entero más próximo.
|
||||
LCM = M.C.M ## Devuelve el mínimo común múltiplo.
|
||||
LN = LN ## Devuelve el logaritmo natural (neperiano) de un número.
|
||||
LOG = LOG ## Devuelve el logaritmo de un número en una base especificada.
|
||||
LOG10 = LOG10 ## Devuelve el logaritmo en base 10 de un número.
|
||||
MDETERM = MDETERM ## Devuelve la determinante matricial de una matriz.
|
||||
MINVERSE = MINVERSA ## Devuelve la matriz inversa de una matriz.
|
||||
MMULT = MMULT ## Devuelve el producto de matriz de dos matrices.
|
||||
MOD = RESIDUO ## Devuelve el resto de la división.
|
||||
MROUND = REDOND.MULT ## Devuelve un número redondeado al múltiplo deseado.
|
||||
MULTINOMIAL = MULTINOMIAL ## Devuelve el polinomio de un conjunto de números.
|
||||
ODD = REDONDEA.IMPAR ## Redondea un número hacia arriba hasta el entero impar más próximo.
|
||||
PI = PI ## Devuelve el valor de pi.
|
||||
POWER = POTENCIA ## Devuelve el resultado de elevar un número a una potencia.
|
||||
PRODUCT = PRODUCTO ## Multiplica sus argumentos.
|
||||
QUOTIENT = COCIENTE ## Devuelve la parte entera de una división.
|
||||
RADIANS = RADIANES ## Convierte grados en radianes.
|
||||
RAND = ALEATORIO ## Devuelve un número aleatorio entre 0 y 1.
|
||||
RANDBETWEEN = ALEATORIO.ENTRE ## Devuelve un número aleatorio entre los números que especifique.
|
||||
ROMAN = NUMERO.ROMANO ## Convierte un número arábigo en número romano, con formato de texto.
|
||||
ROUND = REDONDEAR ## Redondea un número al número de decimales especificado.
|
||||
ROUNDDOWN = REDONDEAR.MENOS ## Redondea un número hacia abajo, en dirección hacia cero.
|
||||
ROUNDUP = REDONDEAR.MAS ## Redondea un número hacia arriba, en dirección contraria a cero.
|
||||
SERIESSUM = SUMA.SERIES ## Devuelve la suma de una serie de potencias en función de la fórmula.
|
||||
SIGN = SIGNO ## Devuelve el signo de un número.
|
||||
SIN = SENO ## Devuelve el seno de un ángulo determinado.
|
||||
SINH = SENOH ## Devuelve el seno hiperbólico de un número.
|
||||
SQRT = RAIZ ## Devuelve la raíz cuadrada positiva de un número.
|
||||
SQRTPI = RAIZ2PI ## Devuelve la raíz cuadrada de un número multiplicado por PI (número * pi).
|
||||
SUBTOTAL = SUBTOTALES ## Devuelve un subtotal en una lista o base de datos.
|
||||
SUM = SUMA ## Suma sus argumentos.
|
||||
SUMIF = SUMAR.SI ## Suma las celdas especificadas que cumplen unos criterios determinados.
|
||||
SUMIFS = SUMAR.SI.CONJUNTO ## Suma las celdas de un rango que cumplen varios criterios.
|
||||
SUMPRODUCT = SUMAPRODUCTO ## Devuelve la suma de los productos de los correspondientes componentes de matriz.
|
||||
SUMSQ = SUMA.CUADRADOS ## Devuelve la suma de los cuadrados de los argumentos.
|
||||
SUMX2MY2 = SUMAX2MENOSY2 ## Devuelve la suma de la diferencia de los cuadrados de los valores correspondientes de dos matrices.
|
||||
SUMX2PY2 = SUMAX2MASY2 ## Devuelve la suma de la suma de los cuadrados de los valores correspondientes de dos matrices.
|
||||
SUMXMY2 = SUMAXMENOSY2 ## Devuelve la suma de los cuadrados de las diferencias de los valores correspondientes de dos matrices.
|
||||
TAN = TAN ## Devuelve la tangente de un número.
|
||||
TANH = TANH ## Devuelve la tangente hiperbólica de un número.
|
||||
TRUNC = TRUNCAR ## Trunca un número a un entero.
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Funciones estadísticas
|
||||
##
|
||||
AVEDEV = DESVPROM ## Devuelve el promedio de las desviaciones absolutas de la media de los puntos de datos.
|
||||
AVERAGE = PROMEDIO ## Devuelve el promedio de sus argumentos.
|
||||
AVERAGEA = PROMEDIOA ## Devuelve el promedio de sus argumentos, incluidos números, texto y valores lógicos.
|
||||
AVERAGEIF = PROMEDIO.SI ## Devuelve el promedio (media aritmética) de todas las celdas de un rango que cumplen unos criterios determinados.
|
||||
AVERAGEIFS = PROMEDIO.SI.CONJUNTO ## Devuelve el promedio (media aritmética) de todas las celdas que cumplen múltiples criterios.
|
||||
BETADIST = DISTR.BETA ## Devuelve la función de distribución beta acumulativa.
|
||||
BETAINV = DISTR.BETA.INV ## Devuelve la función inversa de la función de distribución acumulativa de una distribución beta especificada.
|
||||
BINOMDIST = DISTR.BINOM ## Devuelve la probabilidad de una variable aleatoria discreta siguiendo una distribución binomial.
|
||||
CHIDIST = DISTR.CHI ## Devuelve la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola.
|
||||
CHIINV = PRUEBA.CHI.INV ## Devuelve la función inversa de la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola.
|
||||
CHITEST = PRUEBA.CHI ## Devuelve la prueba de independencia.
|
||||
CONFIDENCE = INTERVALO.CONFIANZA ## Devuelve el intervalo de confianza de la media de una población.
|
||||
CORREL = COEF.DE.CORREL ## Devuelve el coeficiente de correlación entre dos conjuntos de datos.
|
||||
COUNT = CONTAR ## Cuenta cuántos números hay en la lista de argumentos.
|
||||
COUNTA = CONTARA ## Cuenta cuántos valores hay en la lista de argumentos.
|
||||
COUNTBLANK = CONTAR.BLANCO ## Cuenta el número de celdas en blanco de un rango.
|
||||
COUNTIF = CONTAR.SI ## Cuenta el número de celdas, dentro del rango, que cumplen el criterio especificado.
|
||||
COUNTIFS = CONTAR.SI.CONJUNTO ## Cuenta el número de celdas, dentro del rango, que cumplen varios criterios.
|
||||
COVAR = COVAR ## Devuelve la covarianza, que es el promedio de los productos de las desviaciones para cada pareja de puntos de datos.
|
||||
CRITBINOM = BINOM.CRIT ## Devuelve el menor valor cuya distribución binomial acumulativa es menor o igual a un valor de criterio.
|
||||
DEVSQ = DESVIA2 ## Devuelve la suma de los cuadrados de las desviaciones.
|
||||
EXPONDIST = DISTR.EXP ## Devuelve la distribución exponencial.
|
||||
FDIST = DISTR.F ## Devuelve la distribución de probabilidad F.
|
||||
FINV = DISTR.F.INV ## Devuelve la función inversa de la distribución de probabilidad F.
|
||||
FISHER = FISHER ## Devuelve la transformación Fisher.
|
||||
FISHERINV = PRUEBA.FISHER.INV ## Devuelve la función inversa de la transformación Fisher.
|
||||
FORECAST = PRONOSTICO ## Devuelve un valor en una tendencia lineal.
|
||||
FREQUENCY = FRECUENCIA ## Devuelve una distribución de frecuencia como una matriz vertical.
|
||||
FTEST = PRUEBA.F ## Devuelve el resultado de una prueba F.
|
||||
GAMMADIST = DISTR.GAMMA ## Devuelve la distribución gamma.
|
||||
GAMMAINV = DISTR.GAMMA.INV ## Devuelve la función inversa de la distribución gamma acumulativa.
|
||||
GAMMALN = GAMMA.LN ## Devuelve el logaritmo natural de la función gamma, G(x).
|
||||
GEOMEAN = MEDIA.GEOM ## Devuelve la media geométrica.
|
||||
GROWTH = CRECIMIENTO ## Devuelve valores en una tendencia exponencial.
|
||||
HARMEAN = MEDIA.ARMO ## Devuelve la media armónica.
|
||||
HYPGEOMDIST = DISTR.HIPERGEOM ## Devuelve la distribución hipergeométrica.
|
||||
INTERCEPT = INTERSECCION.EJE ## Devuelve la intersección de la línea de regresión lineal.
|
||||
KURT = CURTOSIS ## Devuelve la curtosis de un conjunto de datos.
|
||||
LARGE = K.ESIMO.MAYOR ## Devuelve el k-ésimo mayor valor de un conjunto de datos.
|
||||
LINEST = ESTIMACION.LINEAL ## Devuelve los parámetros de una tendencia lineal.
|
||||
LOGEST = ESTIMACION.LOGARITMICA ## Devuelve los parámetros de una tendencia exponencial.
|
||||
LOGINV = DISTR.LOG.INV ## Devuelve la función inversa de la distribución logarítmico-normal.
|
||||
LOGNORMDIST = DISTR.LOG.NORM ## Devuelve la distribución logarítmico-normal acumulativa.
|
||||
MAX = MAX ## Devuelve el valor máximo de una lista de argumentos.
|
||||
MAXA = MAXA ## Devuelve el valor máximo de una lista de argumentos, incluidos números, texto y valores lógicos.
|
||||
MEDIAN = MEDIANA ## Devuelve la mediana de los números dados.
|
||||
MIN = MIN ## Devuelve el valor mínimo de una lista de argumentos.
|
||||
MINA = MINA ## Devuelve el valor mínimo de una lista de argumentos, incluidos números, texto y valores lógicos.
|
||||
MODE = MODA ## Devuelve el valor más común de un conjunto de datos.
|
||||
NEGBINOMDIST = NEGBINOMDIST ## Devuelve la distribución binomial negativa.
|
||||
NORMDIST = DISTR.NORM ## Devuelve la distribución normal acumulativa.
|
||||
NORMINV = DISTR.NORM.INV ## Devuelve la función inversa de la distribución normal acumulativa.
|
||||
NORMSDIST = DISTR.NORM.ESTAND ## Devuelve la distribución normal estándar acumulativa.
|
||||
NORMSINV = DISTR.NORM.ESTAND.INV ## Devuelve la función inversa de la distribución normal estándar acumulativa.
|
||||
PEARSON = PEARSON ## Devuelve el coeficiente de momento de correlación de producto Pearson.
|
||||
PERCENTILE = PERCENTIL ## Devuelve el k-ésimo percentil de los valores de un rango.
|
||||
PERCENTRANK = RANGO.PERCENTIL ## Devuelve el rango porcentual de un valor de un conjunto de datos.
|
||||
PERMUT = PERMUTACIONES ## Devuelve el número de permutaciones de un número determinado de objetos.
|
||||
POISSON = POISSON ## Devuelve la distribución de Poisson.
|
||||
PROB = PROBABILIDAD ## Devuelve la probabilidad de que los valores de un rango se encuentren entre dos límites.
|
||||
QUARTILE = CUARTIL ## Devuelve el cuartil de un conjunto de datos.
|
||||
RANK = JERARQUIA ## Devuelve la jerarquía de un número en una lista de números.
|
||||
RSQ = COEFICIENTE.R2 ## Devuelve el cuadrado del coeficiente de momento de correlación de producto Pearson.
|
||||
SKEW = COEFICIENTE.ASIMETRIA ## Devuelve la asimetría de una distribución.
|
||||
SLOPE = PENDIENTE ## Devuelve la pendiente de la línea de regresión lineal.
|
||||
SMALL = K.ESIMO.MENOR ## Devuelve el k-ésimo menor valor de un conjunto de datos.
|
||||
STANDARDIZE = NORMALIZACION ## Devuelve un valor normalizado.
|
||||
STDEV = DESVEST ## Calcula la desviación estándar a partir de una muestra.
|
||||
STDEVA = DESVESTA ## Calcula la desviación estándar a partir de una muestra, incluidos números, texto y valores lógicos.
|
||||
STDEVP = DESVESTP ## Calcula la desviación estándar en función de toda la población.
|
||||
STDEVPA = DESVESTPA ## Calcula la desviación estándar en función de toda la población, incluidos números, texto y valores lógicos.
|
||||
STEYX = ERROR.TIPICO.XY ## Devuelve el error estándar del valor de "y" previsto para cada "x" de la regresión.
|
||||
TDIST = DISTR.T ## Devuelve la distribución de t de Student.
|
||||
TINV = DISTR.T.INV ## Devuelve la función inversa de la distribución de t de Student.
|
||||
TREND = TENDENCIA ## Devuelve valores en una tendencia lineal.
|
||||
TRIMMEAN = MEDIA.ACOTADA ## Devuelve la media del interior de un conjunto de datos.
|
||||
TTEST = PRUEBA.T ## Devuelve la probabilidad asociada a una prueba t de Student.
|
||||
VAR = VAR ## Calcula la varianza en función de una muestra.
|
||||
VARA = VARA ## Calcula la varianza en función de una muestra, incluidos números, texto y valores lógicos.
|
||||
VARP = VARP ## Calcula la varianza en función de toda la población.
|
||||
VARPA = VARPA ## Calcula la varianza en función de toda la población, incluidos números, texto y valores lógicos.
|
||||
WEIBULL = DIST.WEIBULL ## Devuelve la distribución de Weibull.
|
||||
ZTEST = PRUEBA.Z ## Devuelve el valor de una probabilidad de una cola de una prueba z.
|
||||
|
||||
|
||||
##
|
||||
## Text functions Funciones de texto
|
||||
##
|
||||
ASC = ASC ## Convierte las letras inglesas o katakana de ancho completo (de dos bytes) dentro de una cadena de caracteres en caracteres de ancho medio (de un byte).
|
||||
BAHTTEXT = TEXTOBAHT ## Convierte un número en texto, con el formato de moneda ß (Baht).
|
||||
CHAR = CARACTER ## Devuelve el carácter especificado por el número de código.
|
||||
CLEAN = LIMPIAR ## Quita del texto todos los caracteres no imprimibles.
|
||||
CODE = CODIGO ## Devuelve un código numérico del primer carácter de una cadena de texto.
|
||||
CONCATENATE = CONCATENAR ## Concatena varios elementos de texto en uno solo.
|
||||
DOLLAR = MONEDA ## Convierte un número en texto, con el formato de moneda $ (dólar).
|
||||
EXACT = IGUAL ## Comprueba si dos valores de texto son idénticos.
|
||||
FIND = ENCONTRAR ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas).
|
||||
FINDB = ENCONTRARB ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas).
|
||||
FIXED = DECIMAL ## Da formato a un número como texto con un número fijo de decimales.
|
||||
JIS = JIS ## Convierte las letras inglesas o katakana de ancho medio (de un byte) dentro de una cadena de caracteres en caracteres de ancho completo (de dos bytes).
|
||||
LEFT = IZQUIERDA ## Devuelve los caracteres del lado izquierdo de un valor de texto.
|
||||
LEFTB = IZQUIERDAB ## Devuelve los caracteres del lado izquierdo de un valor de texto.
|
||||
LEN = LARGO ## Devuelve el número de caracteres de una cadena de texto.
|
||||
LENB = LARGOB ## Devuelve el número de caracteres de una cadena de texto.
|
||||
LOWER = MINUSC ## Pone el texto en minúsculas.
|
||||
MID = EXTRAE ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique.
|
||||
MIDB = EXTRAEB ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique.
|
||||
PHONETIC = FONETICO ## Extrae los caracteres fonéticos (furigana) de una cadena de texto.
|
||||
PROPER = NOMPROPIO ## Pone en mayúscula la primera letra de cada palabra de un valor de texto.
|
||||
REPLACE = REEMPLAZAR ## Reemplaza caracteres de texto.
|
||||
REPLACEB = REEMPLAZARB ## Reemplaza caracteres de texto.
|
||||
REPT = REPETIR ## Repite el texto un número determinado de veces.
|
||||
RIGHT = DERECHA ## Devuelve los caracteres del lado derecho de un valor de texto.
|
||||
RIGHTB = DERECHAB ## Devuelve los caracteres del lado derecho de un valor de texto.
|
||||
SEARCH = HALLAR ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas).
|
||||
SEARCHB = HALLARB ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas).
|
||||
SUBSTITUTE = SUSTITUIR ## Sustituye texto nuevo por texto antiguo en una cadena de texto.
|
||||
T = T ## Convierte sus argumentos a texto.
|
||||
TEXT = TEXTO ## Da formato a un número y lo convierte en texto.
|
||||
TRIM = ESPACIOS ## Quita los espacios del texto.
|
||||
UPPER = MAYUSC ## Pone el texto en mayúsculas.
|
||||
VALUE = VALOR ## Convierte un argumento de texto en un número.
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = $ # Symbol not known, should it be a € (Euro)?
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #TYHJÄ!
|
||||
DIV0 = #JAKO/0!
|
||||
VALUE = #ARVO!
|
||||
REF = #VIITTAUS!
|
||||
NAME = #NIMI?
|
||||
NUM = #LUKU!
|
||||
NA = #PUUTTUU
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = €
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NUL!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #VALEUR!
|
||||
REF = #REF!
|
||||
NAME = #NOM?
|
||||
NUM = #NOMBRE!
|
||||
NA = #N/A
|
@ -1,23 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = Ft
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
##
|
||||
NULL = #NULLA!
|
||||
DIV0 = #ZÉRÓOSZTÓ!
|
||||
VALUE = #ÉRTÉK!
|
||||
REF = #HIV!
|
||||
NAME = #NÉV?
|
||||
NUM = #SZÁM!
|
||||
NA = #HIÁNYZIK
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = €
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NULLO!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #VALORE!
|
||||
REF = #RIF!
|
||||
NAME = #NOME?
|
||||
NUM = #NUM!
|
||||
NA = #N/D
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Funzioni di automazione e dei componenti aggiuntivi
|
||||
##
|
||||
GETPIVOTDATA = INFO.DATI.TAB.PIVOT ## Restituisce i dati memorizzati in un rapporto di tabella pivot
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Funzioni cubo
|
||||
##
|
||||
CUBEKPIMEMBER = MEMBRO.KPI.CUBO ## Restituisce il nome, la proprietà e la misura di un indicatore di prestazioni chiave (KPI) e visualizza il nome e la proprietà nella cella. Un KPI è una misura quantificabile, ad esempio l'utile lordo mensile o il fatturato trimestrale dei dipendenti, utilizzata per il monitoraggio delle prestazioni di un'organizzazione.
|
||||
CUBEMEMBER = MEMBRO.CUBO ## Restituisce un membro o una tupla in una gerarchia di cubi. Consente di verificare l'esistenza del membro o della tupla nel cubo.
|
||||
CUBEMEMBERPROPERTY = PROPRIETÀ.MEMBRO.CUBO ## Restituisce il valore di una proprietà di un membro del cubo. Consente di verificare l'esistenza di un nome di membro all'interno del cubo e di restituire la proprietà specificata per tale membro.
|
||||
CUBERANKEDMEMBER = MEMBRO.CUBO.CON.RANGO ## Restituisce l'n-esimo membro o il membro ordinato di un insieme. Consente di restituire uno o più elementi in un insieme, ad esempio l'agente di vendita migliore o i primi 10 studenti.
|
||||
CUBESET = SET.CUBO ## Definisce un insieme di tuple o membri calcolati mediante l'invio di un'espressione di insieme al cubo sul server. In questo modo l'insieme viene creato e restituito a Microsoft Office Excel.
|
||||
CUBESETCOUNT = CONTA.SET.CUBO ## Restituisce il numero di elementi di un insieme.
|
||||
CUBEVALUE = VALORE.CUBO ## Restituisce un valore aggregato da un cubo.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Funzioni di database
|
||||
##
|
||||
DAVERAGE = DB.MEDIA ## Restituisce la media di voci del database selezionate
|
||||
DCOUNT = DB.CONTA.NUMERI ## Conta le celle di un database contenenti numeri
|
||||
DCOUNTA = DB.CONTA.VALORI ## Conta le celle non vuote in un database
|
||||
DGET = DB.VALORI ## Estrae da un database un singolo record che soddisfa i criteri specificati
|
||||
DMAX = DB.MAX ## Restituisce il valore massimo dalle voci selezionate in un database
|
||||
DMIN = DB.MIN ## Restituisce il valore minimo dalle voci di un database selezionate
|
||||
DPRODUCT = DB.PRODOTTO ## Moltiplica i valori in un determinato campo di record che soddisfano i criteri del database
|
||||
DSTDEV = DB.DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione di voci di un database selezionate
|
||||
DSTDEVP = DB.DEV.ST.POP ## Calcola la deviazione standard sulla base di tutte le voci di un database selezionate
|
||||
DSUM = DB.SOMMA ## Aggiunge i numeri nel campo colonna di record del database che soddisfa determinati criteri
|
||||
DVAR = DB.VAR ## Restituisce una stima della varianza sulla base di un campione da voci di un database selezionate
|
||||
DVARP = DB.VAR.POP ## Calcola la varianza sulla base di tutte le voci di un database selezionate
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Funzioni data e ora
|
||||
##
|
||||
DATE = DATA ## Restituisce il numero seriale di una determinata data
|
||||
DATEVALUE = DATA.VALORE ## Converte una data sotto forma di testo in un numero seriale
|
||||
DAY = GIORNO ## Converte un numero seriale in un giorno del mese
|
||||
DAYS360 = GIORNO360 ## Calcola il numero di giorni compreso tra due date basandosi su un anno di 360 giorni
|
||||
EDATE = DATA.MESE ## Restituisce il numero seriale della data che rappresenta il numero di mesi prima o dopo la data di inizio
|
||||
EOMONTH = FINE.MESE ## Restituisce il numero seriale dell'ultimo giorno del mese, prima o dopo un determinato numero di mesi
|
||||
HOUR = ORA ## Converte un numero seriale in un'ora
|
||||
MINUTE = MINUTO ## Converte un numero seriale in un minuto
|
||||
MONTH = MESE ## Converte un numero seriale in un mese
|
||||
NETWORKDAYS = GIORNI.LAVORATIVI.TOT ## Restituisce il numero di tutti i giorni lavorativi compresi fra due date
|
||||
NOW = ADESSO ## Restituisce il numero seriale della data e dell'ora corrente
|
||||
SECOND = SECONDO ## Converte un numero seriale in un secondo
|
||||
TIME = ORARIO ## Restituisce il numero seriale di una determinata ora
|
||||
TIMEVALUE = ORARIO.VALORE ## Converte un orario in forma di testo in un numero seriale
|
||||
TODAY = OGGI ## Restituisce il numero seriale relativo alla data odierna
|
||||
WEEKDAY = GIORNO.SETTIMANA ## Converte un numero seriale in un giorno della settimana
|
||||
WEEKNUM = NUM.SETTIMANA ## Converte un numero seriale in un numero che rappresenta la posizione numerica di una settimana nell'anno
|
||||
WORKDAY = GIORNO.LAVORATIVO ## Restituisce il numero della data prima o dopo un determinato numero di giorni lavorativi
|
||||
YEAR = ANNO ## Converte un numero seriale in un anno
|
||||
YEARFRAC = FRAZIONE.ANNO ## Restituisce la frazione dell'anno che rappresenta il numero dei giorni compresi tra una data_ iniziale e una data_finale
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Funzioni ingegneristiche
|
||||
##
|
||||
BESSELI = BESSEL.I ## Restituisce la funzione di Bessel modificata In(x)
|
||||
BESSELJ = BESSEL.J ## Restituisce la funzione di Bessel Jn(x)
|
||||
BESSELK = BESSEL.K ## Restituisce la funzione di Bessel modificata Kn(x)
|
||||
BESSELY = BESSEL.Y ## Restituisce la funzione di Bessel Yn(x)
|
||||
BIN2DEC = BINARIO.DECIMALE ## Converte un numero binario in decimale
|
||||
BIN2HEX = BINARIO.HEX ## Converte un numero binario in esadecimale
|
||||
BIN2OCT = BINARIO.OCT ## Converte un numero binario in ottale
|
||||
COMPLEX = COMPLESSO ## Converte i coefficienti reali e immaginari in numeri complessi
|
||||
CONVERT = CONVERTI ## Converte un numero da un sistema di misura in un altro
|
||||
DEC2BIN = DECIMALE.BINARIO ## Converte un numero decimale in binario
|
||||
DEC2HEX = DECIMALE.HEX ## Converte un numero decimale in esadecimale
|
||||
DEC2OCT = DECIMALE.OCT ## Converte un numero decimale in ottale
|
||||
DELTA = DELTA ## Verifica se due valori sono uguali
|
||||
ERF = FUNZ.ERRORE ## Restituisce la funzione di errore
|
||||
ERFC = FUNZ.ERRORE.COMP ## Restituisce la funzione di errore complementare
|
||||
GESTEP = SOGLIA ## Verifica se un numero è maggiore del valore di soglia
|
||||
HEX2BIN = HEX.BINARIO ## Converte un numero esadecimale in binario
|
||||
HEX2DEC = HEX.DECIMALE ## Converte un numero esadecimale in decimale
|
||||
HEX2OCT = HEX.OCT ## Converte un numero esadecimale in ottale
|
||||
IMABS = COMP.MODULO ## Restituisce il valore assoluto (modulo) di un numero complesso
|
||||
IMAGINARY = COMP.IMMAGINARIO ## Restituisce il coefficiente immaginario di un numero complesso
|
||||
IMARGUMENT = COMP.ARGOMENTO ## Restituisce l'argomento theta, un angolo espresso in radianti
|
||||
IMCONJUGATE = COMP.CONIUGATO ## Restituisce il complesso coniugato del numero complesso
|
||||
IMCOS = COMP.COS ## Restituisce il coseno di un numero complesso
|
||||
IMDIV = COMP.DIV ## Restituisce il quoziente di due numeri complessi
|
||||
IMEXP = COMP.EXP ## Restituisce il valore esponenziale di un numero complesso
|
||||
IMLN = COMP.LN ## Restituisce il logaritmo naturale di un numero complesso
|
||||
IMLOG10 = COMP.LOG10 ## Restituisce il logaritmo in base 10 di un numero complesso
|
||||
IMLOG2 = COMP.LOG2 ## Restituisce un logaritmo in base 2 di un numero complesso
|
||||
IMPOWER = COMP.POTENZA ## Restituisce il numero complesso elevato a una potenza intera
|
||||
IMPRODUCT = COMP.PRODOTTO ## Restituisce il prodotto di numeri complessi compresi tra 2 e 29
|
||||
IMREAL = COMP.PARTE.REALE ## Restituisce il coefficiente reale di un numero complesso
|
||||
IMSIN = COMP.SEN ## Restituisce il seno di un numero complesso
|
||||
IMSQRT = COMP.RADQ ## Restituisce la radice quadrata di un numero complesso
|
||||
IMSUB = COMP.DIFF ## Restituisce la differenza fra due numeri complessi
|
||||
IMSUM = COMP.SOMMA ## Restituisce la somma di numeri complessi
|
||||
OCT2BIN = OCT.BINARIO ## Converte un numero ottale in binario
|
||||
OCT2DEC = OCT.DECIMALE ## Converte un numero ottale in decimale
|
||||
OCT2HEX = OCT.HEX ## Converte un numero ottale in esadecimale
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Funzioni finanziarie
|
||||
##
|
||||
ACCRINT = INT.MATURATO.PER ## Restituisce l'interesse maturato di un titolo che paga interessi periodici
|
||||
ACCRINTM = INT.MATURATO.SCAD ## Restituisce l'interesse maturato di un titolo che paga interessi alla scadenza
|
||||
AMORDEGRC = AMMORT.DEGR ## Restituisce l'ammortamento per ogni periodo contabile utilizzando un coefficiente di ammortamento
|
||||
AMORLINC = AMMORT.PER ## Restituisce l'ammortamento per ogni periodo contabile
|
||||
COUPDAYBS = GIORNI.CED.INIZ.LIQ ## Restituisce il numero dei giorni che vanno dall'inizio del periodo di durata della cedola alla data di liquidazione
|
||||
COUPDAYS = GIORNI.CED ## Restituisce il numero dei giorni relativi al periodo della cedola che contiene la data di liquidazione
|
||||
COUPDAYSNC = GIORNI.CED.NUOVA ## Restituisce il numero di giorni che vanno dalla data di liquidazione alla data della cedola successiva
|
||||
COUPNCD = DATA.CED.SUCC ## Restituisce un numero che rappresenta la data della cedola successiva alla data di liquidazione
|
||||
COUPNUM = NUM.CED ## Restituisce il numero di cedole pagabili fra la data di liquidazione e la data di scadenza
|
||||
COUPPCD = DATA.CED.PREC ## Restituisce un numero che rappresenta la data della cedola precedente alla data di liquidazione
|
||||
CUMIPMT = INT.CUMUL ## Restituisce l'interesse cumulativo pagato fra due periodi
|
||||
CUMPRINC = CAP.CUM ## Restituisce il capitale cumulativo pagato per estinguere un debito fra due periodi
|
||||
DB = DB ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a quote fisse decrescenti
|
||||
DDB = AMMORT ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a doppie quote decrescenti o altri metodi specificati
|
||||
DISC = TASSO.SCONTO ## Restituisce il tasso di sconto per un titolo
|
||||
DOLLARDE = VALUTA.DEC ## Converte un prezzo valuta, espresso come frazione, in prezzo valuta, espresso come numero decimale
|
||||
DOLLARFR = VALUTA.FRAZ ## Converte un prezzo valuta, espresso come numero decimale, in prezzo valuta, espresso come frazione
|
||||
DURATION = DURATA ## Restituisce la durata annuale di un titolo con i pagamenti di interesse periodico
|
||||
EFFECT = EFFETTIVO ## Restituisce l'effettivo tasso di interesse annuo
|
||||
FV = VAL.FUT ## Restituisce il valore futuro di un investimento
|
||||
FVSCHEDULE = VAL.FUT.CAPITALE ## Restituisce il valore futuro di un capitale iniziale dopo aver applicato una serie di tassi di interesse composti
|
||||
INTRATE = TASSO.INT ## Restituisce il tasso di interesse per un titolo interamente investito
|
||||
IPMT = INTERESSI ## Restituisce il valore degli interessi per un investimento relativo a un periodo specifico
|
||||
IRR = TIR.COST ## Restituisce il tasso di rendimento interno per una serie di flussi di cassa
|
||||
ISPMT = INTERESSE.RATA ## Calcola l'interesse di un investimento pagato durante un periodo specifico
|
||||
MDURATION = DURATA.M ## Restituisce la durata Macauley modificata per un titolo con un valore presunto di € 100
|
||||
MIRR = TIR.VAR ## Restituisce il tasso di rendimento interno in cui i flussi di cassa positivi e negativi sono finanziati a tassi differenti
|
||||
NOMINAL = NOMINALE ## Restituisce il tasso di interesse nominale annuale
|
||||
NPER = NUM.RATE ## Restituisce un numero di periodi relativi a un investimento
|
||||
NPV = VAN ## Restituisce il valore attuale netto di un investimento basato su una serie di flussi di cassa periodici e sul tasso di sconto
|
||||
ODDFPRICE = PREZZO.PRIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente il primo periodo di durata irregolare
|
||||
ODDFYIELD = REND.PRIMO.IRR ## Restituisce il rendimento di un titolo avente il primo periodo di durata irregolare
|
||||
ODDLPRICE = PREZZO.ULTIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente l'ultimo periodo di durata irregolare
|
||||
ODDLYIELD = REND.ULTIMO.IRR ## Restituisce il rendimento di un titolo avente l'ultimo periodo di durata irregolare
|
||||
PMT = RATA ## Restituisce il pagamento periodico di una rendita annua
|
||||
PPMT = P.RATA ## Restituisce il pagamento sul capitale di un investimento per un dato periodo
|
||||
PRICE = PREZZO ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga interessi periodici
|
||||
PRICEDISC = PREZZO.SCONT ## Restituisce il prezzo di un titolo scontato dal valore nominale di € 100
|
||||
PRICEMAT = PREZZO.SCAD ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga gli interessi alla scadenza
|
||||
PV = VA ## Restituisce il valore attuale di un investimento
|
||||
RATE = TASSO ## Restituisce il tasso di interesse per un periodo di un'annualità
|
||||
RECEIVED = RICEV.SCAD ## Restituisce l'ammontare ricevuto alla scadenza di un titolo interamente investito
|
||||
SLN = AMMORT.COST ## Restituisce l'ammortamento a quote costanti di un bene per un singolo periodo
|
||||
SYD = AMMORT.ANNUO ## Restituisce l'ammortamento a somma degli anni di un bene per un periodo specificato
|
||||
TBILLEQ = BOT.EQUIV ## Restituisce il rendimento equivalente ad un'obbligazione per un Buono ordinario del Tesoro
|
||||
TBILLPRICE = BOT.PREZZO ## Restituisce il prezzo di un Buono del Tesoro dal valore nominale di € 100
|
||||
TBILLYIELD = BOT.REND ## Restituisce il rendimento di un Buono del Tesoro
|
||||
VDB = AMMORT.VAR ## Restituisce l'ammortamento di un bene per un periodo specificato o parziale utilizzando il metodo a doppie quote proporzionali ai valori residui
|
||||
XIRR = TIR.X ## Restituisce il tasso di rendimento interno di un impiego di flussi di cassa
|
||||
XNPV = VAN.X ## Restituisce il valore attuale netto di un impiego di flussi di cassa non necessariamente periodici
|
||||
YIELD = REND ## Restituisce il rendimento di un titolo che frutta interessi periodici
|
||||
YIELDDISC = REND.TITOLI.SCONT ## Restituisce il rendimento annuale di un titolo scontato, ad esempio un Buono del Tesoro
|
||||
YIELDMAT = REND.SCAD ## Restituisce il rendimento annuo di un titolo che paga interessi alla scadenza
|
||||
|
||||
|
||||
##
|
||||
## Information functions Funzioni relative alle informazioni
|
||||
##
|
||||
CELL = CELLA ## Restituisce le informazioni sulla formattazione, la posizione o i contenuti di una cella
|
||||
ERROR.TYPE = ERRORE.TIPO ## Restituisce un numero che corrisponde a un tipo di errore
|
||||
INFO = INFO ## Restituisce le informazioni sull'ambiente operativo corrente
|
||||
ISBLANK = VAL.VUOTO ## Restituisce VERO se il valore è vuoto
|
||||
ISERR = VAL.ERR ## Restituisce VERO se il valore è un valore di errore qualsiasi tranne #N/D
|
||||
ISERROR = VAL.ERRORE ## Restituisce VERO se il valore è un valore di errore qualsiasi
|
||||
ISEVEN = VAL.PARI ## Restituisce VERO se il numero è pari
|
||||
ISLOGICAL = VAL.LOGICO ## Restituisce VERO se il valore è un valore logico
|
||||
ISNA = VAL.NON.DISP ## Restituisce VERO se il valore è un valore di errore #N/D
|
||||
ISNONTEXT = VAL.NON.TESTO ## Restituisce VERO se il valore non è in formato testo
|
||||
ISNUMBER = VAL.NUMERO ## Restituisce VERO se il valore è un numero
|
||||
ISODD = VAL.DISPARI ## Restituisce VERO se il numero è dispari
|
||||
ISREF = VAL.RIF ## Restituisce VERO se il valore è un riferimento
|
||||
ISTEXT = VAL.TESTO ## Restituisce VERO se il valore è in formato testo
|
||||
N = NUM ## Restituisce un valore convertito in numero
|
||||
NA = NON.DISP ## Restituisce il valore di errore #N/D
|
||||
TYPE = TIPO ## Restituisce un numero che indica il tipo di dati relativi a un valore
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Funzioni logiche
|
||||
##
|
||||
AND = E ## Restituisce VERO se tutti gli argomenti sono VERO
|
||||
FALSE = FALSO ## Restituisce il valore logico FALSO
|
||||
IF = SE ## Specifica un test logico da eseguire
|
||||
IFERROR = SE.ERRORE ## Restituisce un valore specificato se una formula fornisce un errore come risultato; in caso contrario, restituisce il risultato della formula
|
||||
NOT = NON ## Inverte la logica degli argomenti
|
||||
OR = O ## Restituisce VERO se un argomento qualsiasi è VERO
|
||||
TRUE = VERO ## Restituisce il valore logico VERO
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Funzioni di ricerca e di riferimento
|
||||
##
|
||||
ADDRESS = INDIRIZZO ## Restituisce un riferimento come testo in una singola cella di un foglio di lavoro
|
||||
AREAS = AREE ## Restituisce il numero di aree in un riferimento
|
||||
CHOOSE = SCEGLI ## Sceglie un valore da un elenco di valori
|
||||
COLUMN = RIF.COLONNA ## Restituisce il numero di colonna di un riferimento
|
||||
COLUMNS = COLONNE ## Restituisce il numero di colonne in un riferimento
|
||||
HLOOKUP = CERCA.ORIZZ ## Effettua una ricerca nella riga superiore di una matrice e restituisce il valore della cella specificata
|
||||
HYPERLINK = COLLEG.IPERTESTUALE ## Crea un collegamento che apre un documento memorizzato in un server di rete, una rete Intranet o Internet
|
||||
INDEX = INDICE ## Utilizza un indice per scegliere un valore da un riferimento o da una matrice
|
||||
INDIRECT = INDIRETTO ## Restituisce un riferimento specificato da un valore testo
|
||||
LOOKUP = CERCA ## Ricerca i valori in un vettore o in una matrice
|
||||
MATCH = CONFRONTA ## Ricerca i valori in un riferimento o in una matrice
|
||||
OFFSET = SCARTO ## Restituisce uno scarto di riferimento da un riferimento dato
|
||||
ROW = RIF.RIGA ## Restituisce il numero di riga di un riferimento
|
||||
ROWS = RIGHE ## Restituisce il numero delle righe in un riferimento
|
||||
RTD = DATITEMPOREALE ## Recupera dati in tempo reale da un programma che supporta l'automazione COM (automazione: Metodo per utilizzare gli oggetti di un'applicazione da un'altra applicazione o da un altro strumento di sviluppo. Precedentemente nota come automazione OLE, l'automazione è uno standard del settore e una caratteristica del modello COM (Component Object Model).)
|
||||
TRANSPOSE = MATR.TRASPOSTA ## Restituisce la trasposizione di una matrice
|
||||
VLOOKUP = CERCA.VERT ## Effettua una ricerca nella prima colonna di una matrice e si sposta attraverso la riga per restituire il valore di una cella
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Funzioni matematiche e trigonometriche
|
||||
##
|
||||
ABS = ASS ## Restituisce il valore assoluto di un numero.
|
||||
ACOS = ARCCOS ## Restituisce l'arcocoseno di un numero
|
||||
ACOSH = ARCCOSH ## Restituisce l'inverso del coseno iperbolico di un numero
|
||||
ASIN = ARCSEN ## Restituisce l'arcoseno di un numero
|
||||
ASINH = ARCSENH ## Restituisce l'inverso del seno iperbolico di un numero
|
||||
ATAN = ARCTAN ## Restituisce l'arcotangente di un numero
|
||||
ATAN2 = ARCTAN.2 ## Restituisce l'arcotangente delle coordinate x e y specificate
|
||||
ATANH = ARCTANH ## Restituisce l'inverso della tangente iperbolica di un numero
|
||||
CEILING = ARROTONDA.ECCESSO ## Arrotonda un numero per eccesso all'intero più vicino o al multiplo più vicino a peso
|
||||
COMBIN = COMBINAZIONE ## Restituisce il numero di combinazioni possibili per un numero assegnato di elementi
|
||||
COS = COS ## Restituisce il coseno dell'angolo specificato
|
||||
COSH = COSH ## Restituisce il coseno iperbolico di un numero
|
||||
DEGREES = GRADI ## Converte i radianti in gradi
|
||||
EVEN = PARI ## Arrotonda il valore assoluto di un numero per eccesso al più vicino intero pari
|
||||
EXP = ESP ## Restituisce il numero e elevato alla potenza di num
|
||||
FACT = FATTORIALE ## Restituisce il fattoriale di un numero
|
||||
FACTDOUBLE = FATT.DOPPIO ## Restituisce il fattoriale doppio di un numero
|
||||
FLOOR = ARROTONDA.DIFETTO ## Arrotonda un numero per difetto al multiplo più vicino a zero
|
||||
GCD = MCD ## Restituisce il massimo comune divisore
|
||||
INT = INT ## Arrotonda un numero per difetto al numero intero più vicino
|
||||
LCM = MCM ## Restituisce il minimo comune multiplo
|
||||
LN = LN ## Restituisce il logaritmo naturale di un numero
|
||||
LOG = LOG ## Restituisce il logaritmo di un numero in una specificata base
|
||||
LOG10 = LOG10 ## Restituisce il logaritmo in base 10 di un numero
|
||||
MDETERM = MATR.DETERM ## Restituisce il determinante di una matrice
|
||||
MINVERSE = MATR.INVERSA ## Restituisce l'inverso di una matrice
|
||||
MMULT = MATR.PRODOTTO ## Restituisce il prodotto di due matrici
|
||||
MOD = RESTO ## Restituisce il resto della divisione
|
||||
MROUND = ARROTONDA.MULTIPLO ## Restituisce un numero arrotondato al multiplo desiderato
|
||||
MULTINOMIAL = MULTINOMIALE ## Restituisce il multinomiale di un insieme di numeri
|
||||
ODD = DISPARI ## Arrotonda un numero per eccesso al più vicino intero dispari
|
||||
PI = PI.GRECO ## Restituisce il valore di pi greco
|
||||
POWER = POTENZA ## Restituisce il risultato di un numero elevato a potenza
|
||||
PRODUCT = PRODOTTO ## Moltiplica i suoi argomenti
|
||||
QUOTIENT = QUOZIENTE ## Restituisce la parte intera di una divisione
|
||||
RADIANS = RADIANTI ## Converte i gradi in radianti
|
||||
RAND = CASUALE ## Restituisce un numero casuale compreso tra 0 e 1
|
||||
RANDBETWEEN = CASUALE.TRA ## Restituisce un numero casuale compreso tra i numeri specificati
|
||||
ROMAN = ROMANO ## Restituisce il numero come numero romano sotto forma di testo
|
||||
ROUND = ARROTONDA ## Arrotonda il numero al numero di cifre specificato
|
||||
ROUNDDOWN = ARROTONDA.PER.DIF ## Arrotonda il valore assoluto di un numero per difetto
|
||||
ROUNDUP = ARROTONDA.PER.ECC ## Arrotonda il valore assoluto di un numero per eccesso
|
||||
SERIESSUM = SOMMA.SERIE ## Restituisce la somma di una serie di potenze in base alla formula
|
||||
SIGN = SEGNO ## Restituisce il segno di un numero
|
||||
SIN = SEN ## Restituisce il seno di un dato angolo
|
||||
SINH = SENH ## Restituisce il seno iperbolico di un numero
|
||||
SQRT = RADQ ## Restituisce una radice quadrata
|
||||
SQRTPI = RADQ.PI.GRECO ## Restituisce la radice quadrata di un numero (numero * pi greco)
|
||||
SUBTOTAL = SUBTOTALE ## Restituisce un subtotale in un elenco o in un database
|
||||
SUM = SOMMA ## Somma i suoi argomenti
|
||||
SUMIF = SOMMA.SE ## Somma le celle specificate da un dato criterio
|
||||
SUMIFS = SOMMA.PIÙ.SE ## Somma le celle in un intervallo che soddisfano più criteri
|
||||
SUMPRODUCT = MATR.SOMMA.PRODOTTO ## Restituisce la somma dei prodotti dei componenti corrispondenti della matrice
|
||||
SUMSQ = SOMMA.Q ## Restituisce la somma dei quadrati degli argomenti
|
||||
SUMX2MY2 = SOMMA.DIFF.Q ## Restituisce la somma della differenza dei quadrati dei corrispondenti elementi in due matrici
|
||||
SUMX2PY2 = SOMMA.SOMMA.Q ## Restituisce la somma della somma dei quadrati dei corrispondenti elementi in due matrici
|
||||
SUMXMY2 = SOMMA.Q.DIFF ## Restituisce la somma dei quadrati delle differenze dei corrispondenti elementi in due matrici
|
||||
TAN = TAN ## Restituisce la tangente di un numero
|
||||
TANH = TANH ## Restituisce la tangente iperbolica di un numero
|
||||
TRUNC = TRONCA ## Tronca la parte decimale di un numero
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Funzioni statistiche
|
||||
##
|
||||
AVEDEV = MEDIA.DEV ## Restituisce la media delle deviazioni assolute delle coordinate rispetto alla loro media
|
||||
AVERAGE = MEDIA ## Restituisce la media degli argomenti
|
||||
AVERAGEA = MEDIA.VALORI ## Restituisce la media degli argomenti, inclusi i numeri, il testo e i valori logici
|
||||
AVERAGEIF = MEDIA.SE ## Restituisce la media aritmetica di tutte le celle in un intervallo che soddisfano un determinato criterio
|
||||
AVERAGEIFS = MEDIA.PIÙ.SE ## Restituisce la media aritmetica di tutte le celle che soddisfano più criteri
|
||||
BETADIST = DISTRIB.BETA ## Restituisce la funzione di distribuzione cumulativa beta
|
||||
BETAINV = INV.BETA ## Restituisce l'inverso della funzione di distribuzione cumulativa per una distribuzione beta specificata
|
||||
BINOMDIST = DISTRIB.BINOM ## Restituisce la distribuzione binomiale per il termine individuale
|
||||
CHIDIST = DISTRIB.CHI ## Restituisce la probabilità a una coda per la distribuzione del chi quadrato
|
||||
CHIINV = INV.CHI ## Restituisce l'inverso della probabilità ad una coda per la distribuzione del chi quadrato
|
||||
CHITEST = TEST.CHI ## Restituisce il test per l'indipendenza
|
||||
CONFIDENCE = CONFIDENZA ## Restituisce l'intervallo di confidenza per una popolazione
|
||||
CORREL = CORRELAZIONE ## Restituisce il coefficiente di correlazione tra due insiemi di dati
|
||||
COUNT = CONTA.NUMERI ## Conta la quantità di numeri nell'elenco di argomenti
|
||||
COUNTA = CONTA.VALORI ## Conta il numero di valori nell'elenco di argomenti
|
||||
COUNTBLANK = CONTA.VUOTE ## Conta il numero di celle vuote all'interno di un intervallo
|
||||
COUNTIF = CONTA.SE ## Conta il numero di celle all'interno di un intervallo che soddisfa i criteri specificati
|
||||
COUNTIFS = CONTA.PIÙ.SE ## Conta il numero di celle in un intervallo che soddisfano più criteri.
|
||||
COVAR = COVARIANZA ## Calcola la covarianza, la media dei prodotti delle deviazioni accoppiate
|
||||
CRITBINOM = CRIT.BINOM ## Restituisce il più piccolo valore per il quale la distribuzione cumulativa binomiale risulta maggiore o uguale ad un valore di criterio
|
||||
DEVSQ = DEV.Q ## Restituisce la somma dei quadrati delle deviazioni
|
||||
EXPONDIST = DISTRIB.EXP ## Restituisce la distribuzione esponenziale
|
||||
FDIST = DISTRIB.F ## Restituisce la distribuzione di probabilità F
|
||||
FINV = INV.F ## Restituisce l'inverso della distribuzione della probabilità F
|
||||
FISHER = FISHER ## Restituisce la trasformazione di Fisher
|
||||
FISHERINV = INV.FISHER ## Restituisce l'inverso della trasformazione di Fisher
|
||||
FORECAST = PREVISIONE ## Restituisce i valori lungo una tendenza lineare
|
||||
FREQUENCY = FREQUENZA ## Restituisce la distribuzione di frequenza come matrice verticale
|
||||
FTEST = TEST.F ## Restituisce il risultato di un test F
|
||||
GAMMADIST = DISTRIB.GAMMA ## Restituisce la distribuzione gamma
|
||||
GAMMAINV = INV.GAMMA ## Restituisce l'inverso della distribuzione cumulativa gamma
|
||||
GAMMALN = LN.GAMMA ## Restituisce il logaritmo naturale della funzione gamma, G(x)
|
||||
GEOMEAN = MEDIA.GEOMETRICA ## Restituisce la media geometrica
|
||||
GROWTH = CRESCITA ## Restituisce i valori lungo una linea di tendenza esponenziale
|
||||
HARMEAN = MEDIA.ARMONICA ## Restituisce la media armonica
|
||||
HYPGEOMDIST = DISTRIB.IPERGEOM ## Restituisce la distribuzione ipergeometrica
|
||||
INTERCEPT = INTERCETTA ## Restituisce l'intercetta della retta di regressione lineare
|
||||
KURT = CURTOSI ## Restituisce la curtosi di un insieme di dati
|
||||
LARGE = GRANDE ## Restituisce il k-esimo valore più grande in un insieme di dati
|
||||
LINEST = REGR.LIN ## Restituisce i parametri di una tendenza lineare
|
||||
LOGEST = REGR.LOG ## Restituisce i parametri di una linea di tendenza esponenziale
|
||||
LOGINV = INV.LOGNORM ## Restituisce l'inverso di una distribuzione lognormale
|
||||
LOGNORMDIST = DISTRIB.LOGNORM ## Restituisce la distribuzione lognormale cumulativa
|
||||
MAX = MAX ## Restituisce il valore massimo in un elenco di argomenti
|
||||
MAXA = MAX.VALORI ## Restituisce il valore massimo in un elenco di argomenti, inclusi i numeri, il testo e i valori logici
|
||||
MEDIAN = MEDIANA ## Restituisce la mediana dei numeri specificati
|
||||
MIN = MIN ## Restituisce il valore minimo in un elenco di argomenti
|
||||
MINA = MIN.VALORI ## Restituisce il più piccolo valore in un elenco di argomenti, inclusi i numeri, il testo e i valori logici
|
||||
MODE = MODA ## Restituisce il valore più comune in un insieme di dati
|
||||
NEGBINOMDIST = DISTRIB.BINOM.NEG ## Restituisce la distribuzione binomiale negativa
|
||||
NORMDIST = DISTRIB.NORM ## Restituisce la distribuzione cumulativa normale
|
||||
NORMINV = INV.NORM ## Restituisce l'inverso della distribuzione cumulativa normale standard
|
||||
NORMSDIST = DISTRIB.NORM.ST ## Restituisce la distribuzione cumulativa normale standard
|
||||
NORMSINV = INV.NORM.ST ## Restituisce l'inverso della distribuzione cumulativa normale
|
||||
PEARSON = PEARSON ## Restituisce il coefficiente del momento di correlazione di Pearson
|
||||
PERCENTILE = PERCENTILE ## Restituisce il k-esimo dato percentile di valori in un intervallo
|
||||
PERCENTRANK = PERCENT.RANGO ## Restituisce il rango di un valore in un insieme di dati come percentuale
|
||||
PERMUT = PERMUTAZIONE ## Restituisce il numero delle permutazioni per un determinato numero di oggetti
|
||||
POISSON = POISSON ## Restituisce la distribuzione di Poisson
|
||||
PROB = PROBABILITÀ ## Calcola la probabilità che dei valori in un intervallo siano compresi tra due limiti
|
||||
QUARTILE = QUARTILE ## Restituisce il quartile di un insieme di dati
|
||||
RANK = RANGO ## Restituisce il rango di un numero in un elenco di numeri
|
||||
RSQ = RQ ## Restituisce la radice quadrata del coefficiente di momento di correlazione di Pearson
|
||||
SKEW = ASIMMETRIA ## Restituisce il grado di asimmetria di una distribuzione
|
||||
SLOPE = PENDENZA ## Restituisce la pendenza di una retta di regressione lineare
|
||||
SMALL = PICCOLO ## Restituisce il k-esimo valore più piccolo in un insieme di dati
|
||||
STANDARDIZE = NORMALIZZA ## Restituisce un valore normalizzato
|
||||
STDEV = DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione
|
||||
STDEVA = DEV.ST.VALORI ## Restituisce una stima della deviazione standard sulla base di un campione, inclusi i numeri, il testo e i valori logici
|
||||
STDEVP = DEV.ST.POP ## Calcola la deviazione standard sulla base di un'intera popolazione
|
||||
STDEVPA = DEV.ST.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici
|
||||
STEYX = ERR.STD.YX ## Restituisce l'errore standard del valore previsto per y per ogni valore x nella regressione
|
||||
TDIST = DISTRIB.T ## Restituisce la distribuzione t di Student
|
||||
TINV = INV.T ## Restituisce l'inversa della distribuzione t di Student
|
||||
TREND = TENDENZA ## Restituisce i valori lungo una linea di tendenza lineare
|
||||
TRIMMEAN = MEDIA.TRONCATA ## Restituisce la media della parte interna di un insieme di dati
|
||||
TTEST = TEST.T ## Restituisce la probabilità associata ad un test t di Student
|
||||
VAR = VAR ## Stima la varianza sulla base di un campione
|
||||
VARA = VAR.VALORI ## Stima la varianza sulla base di un campione, inclusi i numeri, il testo e i valori logici
|
||||
VARP = VAR.POP ## Calcola la varianza sulla base dell'intera popolazione
|
||||
VARPA = VAR.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici
|
||||
WEIBULL = WEIBULL ## Restituisce la distribuzione di Weibull
|
||||
ZTEST = TEST.Z ## Restituisce il valore di probabilità a una coda per un test z
|
||||
|
||||
|
||||
##
|
||||
## Text functions Funzioni di testo
|
||||
##
|
||||
ASC = ASC ## Modifica le lettere inglesi o il katakana a doppio byte all'interno di una stringa di caratteri in caratteri a singolo byte
|
||||
BAHTTEXT = BAHTTESTO ## Converte un numero in testo, utilizzando il formato valuta ß (baht)
|
||||
CHAR = CODICE.CARATT ## Restituisce il carattere specificato dal numero di codice
|
||||
CLEAN = LIBERA ## Elimina dal testo tutti i caratteri che non è possibile stampare
|
||||
CODE = CODICE ## Restituisce il codice numerico del primo carattere di una stringa di testo
|
||||
CONCATENATE = CONCATENA ## Unisce diversi elementi di testo in un unico elemento di testo
|
||||
DOLLAR = VALUTA ## Converte un numero in testo, utilizzando il formato valuta € (euro)
|
||||
EXACT = IDENTICO ## Verifica se due valori di testo sono uguali
|
||||
FIND = TROVA ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole)
|
||||
FINDB = TROVA.B ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole)
|
||||
FIXED = FISSO ## Formatta un numero come testo con un numero fisso di decimali
|
||||
JIS = ORDINAMENTO.JIS ## Modifica le lettere inglesi o i caratteri katakana a byte singolo all'interno di una stringa di caratteri in caratteri a byte doppio.
|
||||
LEFT = SINISTRA ## Restituisce il carattere più a sinistra di un valore di testo
|
||||
LEFTB = SINISTRA.B ## Restituisce il carattere più a sinistra di un valore di testo
|
||||
LEN = LUNGHEZZA ## Restituisce il numero di caratteri di una stringa di testo
|
||||
LENB = LUNB ## Restituisce il numero di caratteri di una stringa di testo
|
||||
LOWER = MINUSC ## Converte il testo in lettere minuscole
|
||||
MID = MEDIA ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata
|
||||
MIDB = MEDIA.B ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata
|
||||
PHONETIC = FURIGANA ## Estrae i caratteri fonetici (furigana) da una stringa di testo.
|
||||
PROPER = MAIUSC.INIZ ## Converte in maiuscolo la prima lettera di ogni parola di un valore di testo
|
||||
REPLACE = RIMPIAZZA ## Sostituisce i caratteri all'interno di un testo
|
||||
REPLACEB = SOSTITUISCI.B ## Sostituisce i caratteri all'interno di un testo
|
||||
REPT = RIPETI ## Ripete un testo per un dato numero di volte
|
||||
RIGHT = DESTRA ## Restituisce il carattere più a destra di un valore di testo
|
||||
RIGHTB = DESTRA.B ## Restituisce il carattere più a destra di un valore di testo
|
||||
SEARCH = RICERCA ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole)
|
||||
SEARCHB = CERCA.B ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole)
|
||||
SUBSTITUTE = SOSTITUISCI ## Sostituisce il nuovo testo al testo contenuto in una stringa
|
||||
T = T ## Converte gli argomenti in testo
|
||||
TEXT = TESTO ## Formatta un numero e lo converte in testo
|
||||
TRIM = ANNULLA.SPAZI ## Elimina gli spazi dal testo
|
||||
UPPER = MAIUSC ## Converte il testo in lettere maiuscole
|
||||
VALUE = VALORE ## Converte un argomento di testo in numero
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = €
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #LEEG!
|
||||
DIV0 = #DEEL/0!
|
||||
VALUE = #WAARDE!
|
||||
REF = #VERW!
|
||||
NAME = #NAAM?
|
||||
NUM = #GETAL!
|
||||
NA = #N/B
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Automatiseringsfuncties en functies in invoegtoepassingen
|
||||
##
|
||||
GETPIVOTDATA = DRAAITABEL.OPHALEN ## Geeft gegevens uit een draaitabelrapport als resultaat
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Kubusfuncties
|
||||
##
|
||||
CUBEKPIMEMBER = KUBUSKPILID ## Retourneert de naam, eigenschap en waarde van een KPI (prestatie-indicator) en geeft de naam en de eigenschap in de cel weer. Een KPI is een meetbare waarde, zoals de maandelijkse brutowinst of de omzet per kwartaal per werknemer, die wordt gebruikt om de prestaties van een organisatie te bewaken
|
||||
CUBEMEMBER = KUBUSLID ## Retourneert een lid of tupel in een kubushiërarchie. Wordt gebruikt om te controleren of het lid of de tupel in de kubus aanwezig is
|
||||
CUBEMEMBERPROPERTY = KUBUSLIDEIGENSCHAP ## Retourneert de waarde van een lideigenschap in de kubus. Wordt gebruikt om te controleren of de lidnaam in de kubus bestaat en retourneert de opgegeven eigenschap voor dit lid
|
||||
CUBERANKEDMEMBER = KUBUSGERANGCHIKTLID ## Retourneert het zoveelste, gerangschikte lid in een set. Wordt gebruikt om een of meer elementen in een set te retourneren, zoals de tien beste verkopers of de tien beste studenten
|
||||
CUBESET = KUBUSSET ## Definieert een berekende set leden of tupels door een ingestelde expressie naar de kubus op de server te sturen, alwaar de set wordt gemaakt en vervolgens wordt geretourneerd naar Microsoft Office Excel
|
||||
CUBESETCOUNT = KUBUSSETAANTAL ## Retourneert het aantal onderdelen in een set
|
||||
CUBEVALUE = KUBUSWAARDE ## Retourneert een samengestelde waarde van een kubus
|
||||
|
||||
|
||||
##
|
||||
## Database functions Databasefuncties
|
||||
##
|
||||
DAVERAGE = DBGEMIDDELDE ## Berekent de gemiddelde waarde in geselecteerde databasegegevens
|
||||
DCOUNT = DBAANTAL ## Telt de cellen met getallen in een database
|
||||
DCOUNTA = DBAANTALC ## Telt de niet-lege cellen in een database
|
||||
DGET = DBLEZEN ## Retourneert één record dat voldoet aan de opgegeven criteria uit een database
|
||||
DMAX = DBMAX ## Retourneert de maximumwaarde in de geselecteerde databasegegevens
|
||||
DMIN = DBMIN ## Retourneert de minimumwaarde in de geselecteerde databasegegevens
|
||||
DPRODUCT = DBPRODUCT ## Vermenigvuldigt de waarden in een bepaald veld van de records die voldoen aan de criteria in een database
|
||||
DSTDEV = DBSTDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef uit geselecteerde databasegegevens
|
||||
DSTDEVP = DBSTDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie van geselecteerde databasegegevens
|
||||
DSUM = DBSOM ## Telt de getallen uit een kolom records in de database op die voldoen aan de criteria
|
||||
DVAR = DBVAR ## Maakt een schatting van de variantie op basis van een steekproef uit geselecteerde databasegegevens
|
||||
DVARP = DBVARP ## Berekent de variantie op basis van de volledige populatie van geselecteerde databasegegevens
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Datum- en tijdfuncties
|
||||
##
|
||||
DATE = DATUM ## Geeft als resultaat het seriële getal van een opgegeven datum
|
||||
DATEVALUE = DATUMWAARDE ## Converteert een datum in de vorm van tekst naar een serieel getal
|
||||
DAY = DAG ## Converteert een serieel getal naar een dag van de maand
|
||||
DAYS360 = DAGEN360 ## Berekent het aantal dagen tussen twee datums op basis van een jaar met 360 dagen
|
||||
EDATE = ZELFDE.DAG ## Geeft als resultaat het seriële getal van een datum die het opgegeven aantal maanden voor of na de begindatum ligt
|
||||
EOMONTH = LAATSTE.DAG ## Geeft als resultaat het seriële getal van de laatste dag van de maand voor of na het opgegeven aantal maanden
|
||||
HOUR = UUR ## Converteert een serieel getal naar uren
|
||||
MINUTE = MINUUT ## Converteert een serieel naar getal minuten
|
||||
MONTH = MAAND ## Converteert een serieel getal naar een maand
|
||||
NETWORKDAYS = NETTO.WERKDAGEN ## Geeft als resultaat het aantal hele werkdagen tussen twee datums
|
||||
NOW = NU ## Geeft als resultaat het seriële getal van de huidige datum en tijd
|
||||
SECOND = SECONDE ## Converteert een serieel getal naar seconden
|
||||
TIME = TIJD ## Geeft als resultaat het seriële getal van een bepaald tijdstip
|
||||
TIMEVALUE = TIJDWAARDE ## Converteert de tijd in de vorm van tekst naar een serieel getal
|
||||
TODAY = VANDAAG ## Geeft als resultaat het seriële getal van de huidige datum
|
||||
WEEKDAY = WEEKDAG ## Converteert een serieel getal naar een weekdag
|
||||
WEEKNUM = WEEKNUMMER ## Converteert een serieel getal naar een weeknummer
|
||||
WORKDAY = WERKDAG ## Geeft als resultaat het seriële getal van de datum voor of na een bepaald aantal werkdagen
|
||||
YEAR = JAAR ## Converteert een serieel getal naar een jaar
|
||||
YEARFRAC = JAAR.DEEL ## Geeft als resultaat het gedeelte van het jaar, uitgedrukt in het aantal hele dagen tussen begindatum en einddatum
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Technische functies
|
||||
##
|
||||
BESSELI = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie In(x)
|
||||
BESSELJ = BESSEL.J ## Geeft als resultaat de Bessel-functie Jn(x)
|
||||
BESSELK = BESSEL.K ## Geeft als resultaat de gewijzigde Bessel-functie Kn(x)
|
||||
BESSELY = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie Yn(x)
|
||||
BIN2DEC = BIN.N.DEC ## Converteert een binair getal naar een decimaal getal
|
||||
BIN2HEX = BIN.N.HEX ## Converteert een binair getal naar een hexadecimaal getal
|
||||
BIN2OCT = BIN.N.OCT ## Converteert een binair getal naar een octaal getal
|
||||
COMPLEX = COMPLEX ## Converteert reële en imaginaire coëfficiënten naar een complex getal
|
||||
CONVERT = CONVERTEREN ## Converteert een getal in de ene maateenheid naar een getal in een andere maateenheid
|
||||
DEC2BIN = DEC.N.BIN ## Converteert een decimaal getal naar een binair getal
|
||||
DEC2HEX = DEC.N.HEX ## Converteert een decimaal getal naar een hexadecimaal getal
|
||||
DEC2OCT = DEC.N.OCT ## Converteert een decimaal getal naar een octaal getal
|
||||
DELTA = DELTA ## Test of twee waarden gelijk zijn
|
||||
ERF = FOUTFUNCTIE ## Geeft als resultaat de foutfunctie
|
||||
ERFC = FOUT.COMPLEMENT ## Geeft als resultaat de complementaire foutfunctie
|
||||
GESTEP = GROTER.DAN ## Test of een getal groter is dan de drempelwaarde
|
||||
HEX2BIN = HEX.N.BIN ## Converteert een hexadecimaal getal naar een binair getal
|
||||
HEX2DEC = HEX.N.DEC ## Converteert een hexadecimaal getal naar een decimaal getal
|
||||
HEX2OCT = HEX.N.OCT ## Converteert een hexadecimaal getal naar een octaal getal
|
||||
IMABS = C.ABS ## Geeft als resultaat de absolute waarde (modulus) van een complex getal
|
||||
IMAGINARY = C.IM.DEEL ## Geeft als resultaat de imaginaire coëfficiënt van een complex getal
|
||||
IMARGUMENT = C.ARGUMENT ## Geeft als resultaat het argument thèta, een hoek uitgedrukt in radialen
|
||||
IMCONJUGATE = C.TOEGEVOEGD ## Geeft als resultaat het complexe toegevoegde getal van een complex getal
|
||||
IMCOS = C.COS ## Geeft als resultaat de cosinus van een complex getal
|
||||
IMDIV = C.QUOTIENT ## Geeft als resultaat het quotiënt van twee complexe getallen
|
||||
IMEXP = C.EXP ## Geeft als resultaat de exponent van een complex getal
|
||||
IMLN = C.LN ## Geeft als resultaat de natuurlijke logaritme van een complex getal
|
||||
IMLOG10 = C.LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een complex getal
|
||||
IMLOG2 = C.LOG2 ## Geeft als resultaat de logaritme met grondtal 2 van een complex getal
|
||||
IMPOWER = C.MACHT ## Geeft als resultaat een complex getal dat is verheven tot de macht van een geheel getal
|
||||
IMPRODUCT = C.PRODUCT ## Geeft als resultaat het product van complexe getallen
|
||||
IMREAL = C.REEEL.DEEL ## Geeft als resultaat de reële coëfficiënt van een complex getal
|
||||
IMSIN = C.SIN ## Geeft als resultaat de sinus van een complex getal
|
||||
IMSQRT = C.WORTEL ## Geeft als resultaat de vierkantswortel van een complex getal
|
||||
IMSUB = C.VERSCHIL ## Geeft als resultaat het verschil tussen twee complexe getallen
|
||||
IMSUM = C.SOM ## Geeft als resultaat de som van complexe getallen
|
||||
OCT2BIN = OCT.N.BIN ## Converteert een octaal getal naar een binair getal
|
||||
OCT2DEC = OCT.N.DEC ## Converteert een octaal getal naar een decimaal getal
|
||||
OCT2HEX = OCT.N.HEX ## Converteert een octaal getal naar een hexadecimaal getal
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Financiële functies
|
||||
##
|
||||
ACCRINT = SAMENG.RENTE ## Berekent de opgelopen rente voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
|
||||
ACCRINTM = SAMENG.RENTE.V ## Berekent de opgelopen rente voor een waardepapier waarvan de rente op de vervaldatum wordt uitgekeerd
|
||||
AMORDEGRC = AMORDEGRC ## Geeft als resultaat de afschrijving voor elke boekingsperiode door een afschrijvingscoëfficiënt toe te passen
|
||||
AMORLINC = AMORLINC ## Berekent de afschrijving voor elke boekingsperiode
|
||||
COUPDAYBS = COUP.DAGEN.BB ## Berekent het aantal dagen vanaf het begin van de coupontermijn tot de stortingsdatum
|
||||
COUPDAYS = COUP.DAGEN ## Geeft als resultaat het aantal dagen in de coupontermijn waarin de stortingsdatum valt
|
||||
COUPDAYSNC = COUP.DAGEN.VV ## Geeft als resultaat het aantal dagen vanaf de stortingsdatum tot de volgende couponvervaldatum
|
||||
COUPNCD = COUP.DATUM.NB ## Geeft als resultaat de volgende coupondatum na de stortingsdatum
|
||||
COUPNUM = COUP.AANTAL ## Geeft als resultaat het aantal coupons dat nog moet worden uitbetaald tussen de stortingsdatum en de vervaldatum
|
||||
COUPPCD = COUP.DATUM.VB ## Geeft als resultaat de vorige couponvervaldatum vóór de stortingsdatum
|
||||
CUMIPMT = CUM.RENTE ## Geeft als resultaat de cumulatieve rente die tussen twee termijnen is uitgekeerd
|
||||
CUMPRINC = CUM.HOOFDSOM ## Geeft als resultaat de cumulatieve hoofdsom van een lening die tussen twee termijnen is terugbetaald
|
||||
DB = DB ## Geeft als resultaat de afschrijving van activa voor een bepaalde periode met behulp van de 'fixed declining balance'-methode
|
||||
DDB = DDB ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'double declining balance'-methode of een andere methode die u opgeeft
|
||||
DISC = DISCONTO ## Geeft als resultaat het discontopercentage voor een waardepapier
|
||||
DOLLARDE = EURO.DE ## Converteert een prijs in euro's, uitgedrukt in een breuk, naar een prijs in euro's, uitgedrukt in een decimaal getal
|
||||
DOLLARFR = EURO.BR ## Converteert een prijs in euro's, uitgedrukt in een decimaal getal, naar een prijs in euro's, uitgedrukt in een breuk
|
||||
DURATION = DUUR ## Geeft als resultaat de gewogen gemiddelde looptijd voor een waardepapier met periodieke rentebetalingen
|
||||
EFFECT = EFFECT.RENTE ## Geeft als resultaat het effectieve jaarlijkse rentepercentage
|
||||
FV = TW ## Geeft als resultaat de toekomstige waarde van een investering
|
||||
FVSCHEDULE = TOEK.WAARDE2 ## Geeft als resultaat de toekomstige waarde van een bepaalde hoofdsom na het toepassen van een reeks samengestelde rentepercentages
|
||||
INTRATE = RENTEPERCENTAGE ## Geeft als resultaat het rentepercentage voor een volgestort waardepapier
|
||||
IPMT = IBET ## Geeft als resultaat de te betalen rente voor een investering over een bepaalde termijn
|
||||
IRR = IR ## Geeft als resultaat de interne rentabiliteit voor een reeks cashflows
|
||||
ISPMT = ISBET ## Geeft als resultaat de rente die is betaald tijdens een bepaalde termijn van een investering
|
||||
MDURATION = AANG.DUUR ## Geeft als resultaat de aangepaste Macauley-looptijd voor een waardepapier, aangenomen dat de nominale waarde € 100 bedraagt
|
||||
MIRR = GIR ## Geeft als resultaat de interne rentabiliteit voor een serie cashflows, waarbij voor betalingen een ander rentepercentage geldt dan voor inkomsten
|
||||
NOMINAL = NOMINALE.RENTE ## Geeft als resultaat het nominale jaarlijkse rentepercentage
|
||||
NPER = NPER ## Geeft als resultaat het aantal termijnen van een investering
|
||||
NPV = NHW ## Geeft als resultaat de netto huidige waarde van een investering op basis van een reeks periodieke cashflows en een discontopercentage
|
||||
ODDFPRICE = AFW.ET.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende eerste termijn
|
||||
ODDFYIELD = AFW.ET.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende eerste termijn
|
||||
ODDLPRICE = AFW.LT.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende laatste termijn
|
||||
ODDLYIELD = AFW.LT.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende laatste termijn
|
||||
PMT = BET ## Geeft als resultaat de periodieke betaling voor een annuïteit
|
||||
PPMT = PBET ## Geeft als resultaat de afbetaling op de hoofdsom voor een bepaalde termijn
|
||||
PRICE = PRIJS.NOM ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
|
||||
PRICEDISC = PRIJS.DISCONTO ## Geeft als resultaat de prijs per € 100 nominale waarde voor een verdisconteerd waardepapier
|
||||
PRICEMAT = PRIJS.VERVALDAG ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum
|
||||
PV = HW ## Geeft als resultaat de huidige waarde van een investering
|
||||
RATE = RENTE ## Geeft als resultaat het periodieke rentepercentage voor een annuïteit
|
||||
RECEIVED = OPBRENGST ## Geeft als resultaat het bedrag dat op de vervaldatum wordt uitgekeerd voor een volgestort waardepapier
|
||||
SLN = LIN.AFSCHR ## Geeft als resultaat de lineaire afschrijving van activa over één termijn
|
||||
SYD = SYD ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'Sum-Of-Years-Digits'-methode
|
||||
TBILLEQ = SCHATK.OBL ## Geeft als resultaat het rendement op schatkistpapier, dat op dezelfde manier wordt berekend als het rendement op obligaties
|
||||
TBILLPRICE = SCHATK.PRIJS ## Bepaalt de prijs per € 100 nominale waarde voor schatkistpapier
|
||||
TBILLYIELD = SCHATK.REND ## Berekent het rendement voor schatkistpapier
|
||||
VDB = VDB ## Geeft als resultaat de afschrijving van activa over een gehele of gedeeltelijke termijn met behulp van de 'declining balance'-methode
|
||||
XIRR = IR.SCHEMA ## Berekent de interne rentabiliteit voor een betalingsschema van cashflows
|
||||
XNPV = NHW2 ## Berekent de huidige nettowaarde voor een betalingsschema van cashflows
|
||||
YIELD = RENDEMENT ## Geeft als resultaat het rendement voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
|
||||
YIELDDISC = REND.DISCONTO ## Geeft als resultaat het jaarlijkse rendement voor een verdisconteerd waardepapier, bijvoorbeeld schatkistpapier
|
||||
YIELDMAT = REND.VERVAL ## Geeft als resultaat het jaarlijkse rendement voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum
|
||||
|
||||
|
||||
##
|
||||
## Information functions Informatiefuncties
|
||||
##
|
||||
CELL = CEL ## Geeft als resultaat informatie over de opmaak, locatie of inhoud van een cel
|
||||
ERROR.TYPE = TYPE.FOUT ## Geeft als resultaat een getal dat overeenkomt met een van de foutwaarden van Microsoft Excel
|
||||
INFO = INFO ## Geeft als resultaat informatie over de huidige besturingsomgeving
|
||||
ISBLANK = ISLEEG ## Geeft als resultaat WAAR als de waarde leeg is
|
||||
ISERR = ISFOUT2 ## Geeft als resultaat WAAR als de waarde een foutwaarde is, met uitzondering van #N/B
|
||||
ISERROR = ISFOUT ## Geeft als resultaat WAAR als de waarde een foutwaarde is
|
||||
ISEVEN = IS.EVEN ## Geeft als resultaat WAAR als het getal even is
|
||||
ISLOGICAL = ISLOGISCH ## Geeft als resultaat WAAR als de waarde een logische waarde is
|
||||
ISNA = ISNB ## Geeft als resultaat WAAR als de waarde de foutwaarde #N/B is
|
||||
ISNONTEXT = ISGEENTEKST ## Geeft als resultaat WAAR als de waarde geen tekst is
|
||||
ISNUMBER = ISGETAL ## Geeft als resultaat WAAR als de waarde een getal is
|
||||
ISODD = IS.ONEVEN ## Geeft als resultaat WAAR als het getal oneven is
|
||||
ISREF = ISVERWIJZING ## Geeft als resultaat WAAR als de waarde een verwijzing is
|
||||
ISTEXT = ISTEKST ## Geeft als resultaat WAAR als de waarde tekst is
|
||||
N = N ## Geeft als resultaat een waarde die is geconverteerd naar een getal
|
||||
NA = NB ## Geeft als resultaat de foutwaarde #N/B
|
||||
TYPE = TYPE ## Geeft als resultaat een getal dat het gegevenstype van een waarde aangeeft
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Logische functies
|
||||
##
|
||||
AND = EN ## Geeft als resultaat WAAR als alle argumenten WAAR zijn
|
||||
FALSE = ONWAAR ## Geeft als resultaat de logische waarde ONWAAR
|
||||
IF = ALS ## Geeft een logische test aan
|
||||
IFERROR = ALS.FOUT ## Retourneert een waarde die u opgeeft als een formule een fout oplevert, anders wordt het resultaat van de formule geretourneerd
|
||||
NOT = NIET ## Keert de logische waarde van het argument om
|
||||
OR = OF ## Geeft als resultaat WAAR als minimaal een van de argumenten WAAR is
|
||||
TRUE = WAAR ## Geeft als resultaat de logische waarde WAAR
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Zoek- en verwijzingsfuncties
|
||||
##
|
||||
ADDRESS = ADRES ## Geeft als resultaat een verwijzing, in de vorm van tekst, naar één bepaalde cel in een werkblad
|
||||
AREAS = BEREIKEN ## Geeft als resultaat het aantal bereiken in een verwijzing
|
||||
CHOOSE = KIEZEN ## Kiest een waarde uit een lijst met waarden
|
||||
COLUMN = KOLOM ## Geeft als resultaat het kolomnummer van een verwijzing
|
||||
COLUMNS = KOLOMMEN ## Geeft als resultaat het aantal kolommen in een verwijzing
|
||||
HLOOKUP = HORIZ.ZOEKEN ## Zoekt in de bovenste rij van een matrix naar een bepaalde waarde en geeft als resultaat de gevonden waarde in de opgegeven cel
|
||||
HYPERLINK = HYPERLINK ## Maakt een snelkoppeling of een sprong waarmee een document wordt geopend dat is opgeslagen op een netwerkserver, een intranet of op internet
|
||||
INDEX = INDEX ## Kiest met een index een waarde uit een verwijzing of een matrix
|
||||
INDIRECT = INDIRECT ## Geeft als resultaat een verwijzing die wordt aangegeven met een tekstwaarde
|
||||
LOOKUP = ZOEKEN ## Zoekt naar bepaalde waarden in een vector of een matrix
|
||||
MATCH = VERGELIJKEN ## Zoekt naar bepaalde waarden in een verwijzing of een matrix
|
||||
OFFSET = VERSCHUIVING ## Geeft als resultaat een nieuwe verwijzing die is verschoven ten opzichte van een bepaalde verwijzing
|
||||
ROW = RIJ ## Geeft als resultaat het rijnummer van een verwijzing
|
||||
ROWS = RIJEN ## Geeft als resultaat het aantal rijen in een verwijzing
|
||||
RTD = RTG ## Haalt realtimegegevens op uit een programma dat COM-automatisering (automatisering: een methode waarmee de ene toepassing objecten van een andere toepassing of ontwikkelprogramma kan besturen. Automatisering werd vroeger OLE-automatisering genoemd. Automatisering is een industrienorm die deel uitmaakt van het Component Object Model (COM).) ondersteunt
|
||||
TRANSPOSE = TRANSPONEREN ## Geeft als resultaat de getransponeerde van een matrix
|
||||
VLOOKUP = VERT.ZOEKEN ## Zoekt in de meest linkse kolom van een matrix naar een bepaalde waarde en geeft als resultaat de waarde in de opgegeven cel
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Wiskundige en trigonometrische functies
|
||||
##
|
||||
ABS = ABS ## Geeft als resultaat de absolute waarde van een getal
|
||||
ACOS = BOOGCOS ## Geeft als resultaat de boogcosinus van een getal
|
||||
ACOSH = BOOGCOSH ## Geeft als resultaat de inverse cosinus hyperbolicus van een getal
|
||||
ASIN = BOOGSIN ## Geeft als resultaat de boogsinus van een getal
|
||||
ASINH = BOOGSINH ## Geeft als resultaat de inverse sinus hyperbolicus van een getal
|
||||
ATAN = BOOGTAN ## Geeft als resultaat de boogtangens van een getal
|
||||
ATAN2 = BOOGTAN2 ## Geeft als resultaat de boogtangens van de x- en y-coördinaten
|
||||
ATANH = BOOGTANH ## Geeft als resultaat de inverse tangens hyperbolicus van een getal
|
||||
CEILING = AFRONDEN.BOVEN ## Rondt de absolute waarde van een getal naar boven af op het dichtstbijzijnde gehele getal of het dichtstbijzijnde significante veelvoud
|
||||
COMBIN = COMBINATIES ## Geeft als resultaat het aantal combinaties voor een bepaald aantal objecten
|
||||
COS = COS ## Geeft als resultaat de cosinus van een getal
|
||||
COSH = COSH ## Geeft als resultaat de cosinus hyperbolicus van een getal
|
||||
DEGREES = GRADEN ## Converteert radialen naar graden
|
||||
EVEN = EVEN ## Rondt het getal af op het dichtstbijzijnde gehele even getal
|
||||
EXP = EXP ## Verheft e tot de macht van een bepaald getal
|
||||
FACT = FACULTEIT ## Geeft als resultaat de faculteit van een getal
|
||||
FACTDOUBLE = DUBBELE.FACULTEIT ## Geeft als resultaat de dubbele faculteit van een getal
|
||||
FLOOR = AFRONDEN.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af
|
||||
GCD = GGD ## Geeft als resultaat de grootste gemene deler
|
||||
INT = INTEGER ## Rondt een getal naar beneden af op het dichtstbijzijnde gehele getal
|
||||
LCM = KGV ## Geeft als resultaat het kleinste gemene veelvoud
|
||||
LN = LN ## Geeft als resultaat de natuurlijke logaritme van een getal
|
||||
LOG = LOG ## Geeft als resultaat de logaritme met het opgegeven grondtal van een getal
|
||||
LOG10 = LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een getal
|
||||
MDETERM = DETERMINANTMAT ## Geeft als resultaat de determinant van een matrix
|
||||
MINVERSE = INVERSEMAT ## Geeft als resultaat de inverse van een matrix
|
||||
MMULT = PRODUCTMAT ## Geeft als resultaat het product van twee matrices
|
||||
MOD = REST ## Geeft als resultaat het restgetal van een deling
|
||||
MROUND = AFRONDEN.N.VEELVOUD ## Geeft als resultaat een getal afgerond op het gewenste veelvoud
|
||||
MULTINOMIAL = MULTINOMIAAL ## Geeft als resultaat de multinomiaalcoëfficiënt van een reeks getallen
|
||||
ODD = ONEVEN ## Rondt de absolute waarde van het getal naar boven af op het dichtstbijzijnde gehele oneven getal
|
||||
PI = PI ## Geeft als resultaat de waarde van pi
|
||||
POWER = MACHT ## Verheft een getal tot een macht
|
||||
PRODUCT = PRODUCT ## Vermenigvuldigt de argumenten met elkaar
|
||||
QUOTIENT = QUOTIENT ## Geeft als resultaat de uitkomst van een deling als geheel getal
|
||||
RADIANS = RADIALEN ## Converteert graden naar radialen
|
||||
RAND = ASELECT ## Geeft als resultaat een willekeurig getal tussen 0 en 1
|
||||
RANDBETWEEN = ASELECTTUSSEN ## Geeft een willekeurig getal tussen de getallen die u hebt opgegeven
|
||||
ROMAN = ROMEINS ## Converteert een Arabisch getal naar een Romeins getal en geeft het resultaat weer in de vorm van tekst
|
||||
ROUND = AFRONDEN ## Rondt een getal af op het opgegeven aantal decimalen
|
||||
ROUNDDOWN = AFRONDEN.NAAR.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af
|
||||
ROUNDUP = AFRONDEN.NAAR.BOVEN ## Rondt de absolute waarde van een getal naar boven af
|
||||
SERIESSUM = SOM.MACHTREEKS ## Geeft als resultaat de som van een machtreeks die is gebaseerd op de formule
|
||||
SIGN = POS.NEG ## Geeft als resultaat het teken van een getal
|
||||
SIN = SIN ## Geeft als resultaat de sinus van de opgegeven hoek
|
||||
SINH = SINH ## Geeft als resultaat de sinus hyperbolicus van een getal
|
||||
SQRT = WORTEL ## Geeft als resultaat de positieve vierkantswortel van een getal
|
||||
SQRTPI = WORTEL.PI ## Geeft als resultaat de vierkantswortel van (getal * pi)
|
||||
SUBTOTAL = SUBTOTAAL ## Geeft als resultaat een subtotaal voor een bereik
|
||||
SUM = SOM ## Telt de argumenten op
|
||||
SUMIF = SOM.ALS ## Telt de getallen bij elkaar op die voldoen aan een bepaald criterium
|
||||
SUMIFS = SOMMEN.ALS ## Telt de cellen in een bereik op die aan meerdere criteria voldoen
|
||||
SUMPRODUCT = SOMPRODUCT ## Geeft als resultaat de som van de producten van de corresponderende matrixelementen
|
||||
SUMSQ = KWADRATENSOM ## Geeft als resultaat de som van de kwadraten van de argumenten
|
||||
SUMX2MY2 = SOM.X2MINY2 ## Geeft als resultaat de som van het verschil tussen de kwadraten van corresponderende waarden in twee matrices
|
||||
SUMX2PY2 = SOM.X2PLUSY2 ## Geeft als resultaat de som van de kwadratensom van corresponderende waarden in twee matrices
|
||||
SUMXMY2 = SOM.XMINY.2 ## Geeft als resultaat de som van de kwadraten van de verschillen tussen de corresponderende waarden in twee matrices
|
||||
TAN = TAN ## Geeft als resultaat de tangens van een getal
|
||||
TANH = TANH ## Geeft als resultaat de tangens hyperbolicus van een getal
|
||||
TRUNC = GEHEEL ## Kapt een getal af tot een geheel getal
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Statistische functies
|
||||
##
|
||||
AVEDEV = GEM.DEVIATIE ## Geeft als resultaat het gemiddelde van de absolute deviaties van gegevenspunten ten opzichte van hun gemiddelde waarde
|
||||
AVERAGE = GEMIDDELDE ## Geeft als resultaat het gemiddelde van de argumenten
|
||||
AVERAGEA = GEMIDDELDEA ## Geeft als resultaat het gemiddelde van de argumenten, inclusief getallen, tekst en logische waarden
|
||||
AVERAGEIF = GEMIDDELDE.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen in een bereik die voldoen aan de opgegeven criteria
|
||||
AVERAGEIFS = GEMIDDELDEN.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen die aan meerdere criteria voldoen
|
||||
BETADIST = BETA.VERD ## Geeft als resultaat de cumulatieve bèta-verdelingsfunctie
|
||||
BETAINV = BETA.INV ## Geeft als resultaat de inverse van de cumulatieve verdelingsfunctie voor een gegeven bèta-verdeling
|
||||
BINOMDIST = BINOMIALE.VERD ## Geeft als resultaat de binomiale verdeling
|
||||
CHIDIST = CHI.KWADRAAT ## Geeft als resultaat de eenzijdige kans van de chi-kwadraatverdeling
|
||||
CHIINV = CHI.KWADRAAT.INV ## Geeft als resultaat de inverse van een eenzijdige kans van de chi-kwadraatverdeling
|
||||
CHITEST = CHI.TOETS ## Geeft als resultaat de onafhankelijkheidstoets
|
||||
CONFIDENCE = BETROUWBAARHEID ## Geeft als resultaat het betrouwbaarheidsinterval van een gemiddelde waarde voor de elementen van een populatie
|
||||
CORREL = CORRELATIE ## Geeft als resultaat de correlatiecoëfficiënt van twee gegevensverzamelingen
|
||||
COUNT = AANTAL ## Telt het aantal getallen in de argumentenlijst
|
||||
COUNTA = AANTALARG ## Telt het aantal waarden in de argumentenlijst
|
||||
COUNTBLANK = AANTAL.LEGE.CELLEN ## Telt het aantal lege cellen in een bereik
|
||||
COUNTIF = AANTAL.ALS ## Telt in een bereik het aantal cellen die voldoen aan een bepaald criterium
|
||||
COUNTIFS = AANTALLEN.ALS ## Telt in een bereik het aantal cellen die voldoen aan meerdere criteria
|
||||
COVAR = COVARIANTIE ## Geeft als resultaat de covariantie, het gemiddelde van de producten van de gepaarde deviaties
|
||||
CRITBINOM = CRIT.BINOM ## Geeft als resultaat de kleinste waarde waarvoor de binomiale verdeling kleiner is dan of gelijk is aan het criterium
|
||||
DEVSQ = DEV.KWAD ## Geeft als resultaat de som van de deviaties in het kwadraat
|
||||
EXPONDIST = EXPON.VERD ## Geeft als resultaat de exponentiële verdeling
|
||||
FDIST = F.VERDELING ## Geeft als resultaat de F-verdeling
|
||||
FINV = F.INVERSE ## Geeft als resultaat de inverse van de F-verdeling
|
||||
FISHER = FISHER ## Geeft als resultaat de Fisher-transformatie
|
||||
FISHERINV = FISHER.INV ## Geeft als resultaat de inverse van de Fisher-transformatie
|
||||
FORECAST = VOORSPELLEN ## Geeft als resultaat een waarde op basis van een lineaire trend
|
||||
FREQUENCY = FREQUENTIE ## Geeft als resultaat een frequentieverdeling in de vorm van een verticale matrix
|
||||
FTEST = F.TOETS ## Geeft als resultaat een F-toets
|
||||
GAMMADIST = GAMMA.VERD ## Geeft als resultaat de gamma-verdeling
|
||||
GAMMAINV = GAMMA.INV ## Geeft als resultaat de inverse van de cumulatieve gamma-verdeling
|
||||
GAMMALN = GAMMA.LN ## Geeft als resultaat de natuurlijke logaritme van de gamma-functie, G(x)
|
||||
GEOMEAN = MEETK.GEM ## Geeft als resultaat het meetkundige gemiddelde
|
||||
GROWTH = GROEI ## Geeft als resultaat de waarden voor een exponentiële trend
|
||||
HARMEAN = HARM.GEM ## Geeft als resultaat het harmonische gemiddelde
|
||||
HYPGEOMDIST = HYPERGEO.VERD ## Geeft als resultaat de hypergeometrische verdeling
|
||||
INTERCEPT = SNIJPUNT ## Geeft als resultaat het snijpunt van de lineaire regressielijn met de y-as
|
||||
KURT = KURTOSIS ## Geeft als resultaat de kurtosis van een gegevensverzameling
|
||||
LARGE = GROOTSTE ## Geeft als resultaat de op k-1 na grootste waarde in een gegevensverzameling
|
||||
LINEST = LIJNSCH ## Geeft als resultaat de parameters van een lineaire trend
|
||||
LOGEST = LOGSCH ## Geeft als resultaat de parameters van een exponentiële trend
|
||||
LOGINV = LOG.NORM.INV ## Geeft als resultaat de inverse van de logaritmische normale verdeling
|
||||
LOGNORMDIST = LOG.NORM.VERD ## Geeft als resultaat de cumulatieve logaritmische normale verdeling
|
||||
MAX = MAX ## Geeft als resultaat de maximumwaarde in een lijst met argumenten
|
||||
MAXA = MAXA ## Geeft als resultaat de maximumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden
|
||||
MEDIAN = MEDIAAN ## Geeft als resultaat de mediaan van de opgegeven getallen
|
||||
MIN = MIN ## Geeft als resultaat de minimumwaarde in een lijst met argumenten
|
||||
MINA = MINA ## Geeft als resultaat de minimumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden
|
||||
MODE = MODUS ## Geeft als resultaat de meest voorkomende waarde in een gegevensverzameling
|
||||
NEGBINOMDIST = NEG.BINOM.VERD ## Geeft als resultaat de negatieve binomiaalverdeling
|
||||
NORMDIST = NORM.VERD ## Geeft als resultaat de cumulatieve normale verdeling
|
||||
NORMINV = NORM.INV ## Geeft als resultaat de inverse van de cumulatieve standaardnormale verdeling
|
||||
NORMSDIST = STAND.NORM.VERD ## Geeft als resultaat de cumulatieve standaardnormale verdeling
|
||||
NORMSINV = STAND.NORM.INV ## Geeft als resultaat de inverse van de cumulatieve normale verdeling
|
||||
PEARSON = PEARSON ## Geeft als resultaat de correlatiecoëfficiënt van Pearson
|
||||
PERCENTILE = PERCENTIEL ## Geeft als resultaat het k-de percentiel van waarden in een bereik
|
||||
PERCENTRANK = PERCENT.RANG ## Geeft als resultaat de positie, in procenten uitgedrukt, van een waarde in de rangorde van een gegevensverzameling
|
||||
PERMUT = PERMUTATIES ## Geeft als resultaat het aantal permutaties voor een gegeven aantal objecten
|
||||
POISSON = POISSON ## Geeft als resultaat de Poisson-verdeling
|
||||
PROB = KANS ## Geeft als resultaat de kans dat waarden zich tussen twee grenzen bevinden
|
||||
QUARTILE = KWARTIEL ## Geeft als resultaat het kwartiel van een gegevensverzameling
|
||||
RANK = RANG ## Geeft als resultaat het rangnummer van een getal in een lijst getallen
|
||||
RSQ = R.KWADRAAT ## Geeft als resultaat het kwadraat van de Pearson-correlatiecoëfficiënt
|
||||
SKEW = SCHEEFHEID ## Geeft als resultaat de mate van asymmetrie van een verdeling
|
||||
SLOPE = RICHTING ## Geeft als resultaat de richtingscoëfficiënt van een lineaire regressielijn
|
||||
SMALL = KLEINSTE ## Geeft als resultaat de op k-1 na kleinste waarde in een gegevensverzameling
|
||||
STANDARDIZE = NORMALISEREN ## Geeft als resultaat een genormaliseerde waarde
|
||||
STDEV = STDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef
|
||||
STDEVA = STDEVA ## Maakt een schatting van de standaarddeviatie op basis van een steekproef, inclusief getallen, tekst en logische waarden
|
||||
STDEVP = STDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie
|
||||
STDEVPA = STDEVPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden
|
||||
STEYX = STAND.FOUT.YX ## Geeft als resultaat de standaardfout in de voorspelde y-waarde voor elke x in een regressie
|
||||
TDIST = T.VERD ## Geeft als resultaat de Student T-verdeling
|
||||
TINV = T.INV ## Geeft als resultaat de inverse van de Student T-verdeling
|
||||
TREND = TREND ## Geeft als resultaat de waarden voor een lineaire trend
|
||||
TRIMMEAN = GETRIMD.GEM ## Geeft als resultaat het gemiddelde van waarden in een gegevensverzameling
|
||||
TTEST = T.TOETS ## Geeft als resultaat de kans met behulp van de Student T-toets
|
||||
VAR = VAR ## Maakt een schatting van de variantie op basis van een steekproef
|
||||
VARA = VARA ## Maakt een schatting van de variantie op basis van een steekproef, inclusief getallen, tekst en logische waarden
|
||||
VARP = VARP ## Berekent de variantie op basis van de volledige populatie
|
||||
VARPA = VARPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden
|
||||
WEIBULL = WEIBULL ## Geeft als resultaat de Weibull-verdeling
|
||||
ZTEST = Z.TOETS ## Geeft als resultaat de eenzijdige kanswaarde van een Z-toets
|
||||
|
||||
|
||||
##
|
||||
## Text functions Tekstfuncties
|
||||
##
|
||||
ASC = ASC ## Wijzigt Nederlandse letters of katakanatekens over de volle breedte (dubbel-bytetekens) binnen een tekenreeks in tekens over de halve breedte (enkel-bytetekens)
|
||||
BAHTTEXT = BAHT.TEKST ## Converteert een getal naar tekst met de valutanotatie ß (baht)
|
||||
CHAR = TEKEN ## Geeft als resultaat het teken dat hoort bij de opgegeven code
|
||||
CLEAN = WISSEN.CONTROL ## Verwijdert alle niet-afdrukbare tekens uit een tekst
|
||||
CODE = CODE ## Geeft als resultaat de numerieke code voor het eerste teken in een tekenreeks
|
||||
CONCATENATE = TEKST.SAMENVOEGEN ## Voegt verschillende tekstfragmenten samen tot één tekstfragment
|
||||
DOLLAR = EURO ## Converteert een getal naar tekst met de valutanotatie € (euro)
|
||||
EXACT = GELIJK ## Controleert of twee tekenreeksen identiek zijn
|
||||
FIND = VIND.ALLES ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
|
||||
FINDB = VIND.ALLES.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
|
||||
FIXED = VAST ## Maakt een getal als tekst met een vast aantal decimalen op
|
||||
JIS = JIS ## Wijzigt Nederlandse letters of katakanatekens over de halve breedte (enkel-bytetekens) binnen een tekenreeks in tekens over de volle breedte (dubbel-bytetekens)
|
||||
LEFT = LINKS ## Geeft als resultaat de meest linkse tekens in een tekenreeks
|
||||
LEFTB = LINKSB ## Geeft als resultaat de meest linkse tekens in een tekenreeks
|
||||
LEN = LENGTE ## Geeft als resultaat het aantal tekens in een tekenreeks
|
||||
LENB = LENGTEB ## Geeft als resultaat het aantal tekens in een tekenreeks
|
||||
LOWER = KLEINE.LETTERS ## Zet tekst om in kleine letters
|
||||
MID = MIDDEN ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft
|
||||
MIDB = DEELB ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft
|
||||
PHONETIC = FONETISCH ## Haalt de fonetische tekens (furigana) uit een tekenreeks op
|
||||
PROPER = BEGINLETTERS ## Zet de eerste letter van elk woord in een tekst om in een hoofdletter
|
||||
REPLACE = VERVANG ## Vervangt tekens binnen een tekst
|
||||
REPLACEB = VERVANGENB ## Vervangt tekens binnen een tekst
|
||||
REPT = HERHALING ## Herhaalt een tekst een aantal malen
|
||||
RIGHT = RECHTS ## Geeft als resultaat de meest rechtse tekens in een tekenreeks
|
||||
RIGHTB = RECHTSB ## Geeft als resultaat de meest rechtse tekens in een tekenreeks
|
||||
SEARCH = VIND.SPEC ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
|
||||
SEARCHB = VIND.SPEC.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
|
||||
SUBSTITUTE = SUBSTITUEREN ## Vervangt oude tekst door nieuwe tekst in een tekenreeks
|
||||
T = T ## Converteert de argumenten naar tekst
|
||||
TEXT = TEKST ## Maakt een getal op en converteert het getal naar tekst
|
||||
TRIM = SPATIES.WISSEN ## Verwijdert de spaties uit een tekst
|
||||
UPPER = HOOFDLETTERS ## Zet tekst om in hoofdletters
|
||||
VALUE = WAARDE ## Converteert tekst naar een getal
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = kr
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NULL!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #VERDI!
|
||||
REF = #REF!
|
||||
NAME = #NAVN?
|
||||
NUM = #NUM!
|
||||
NA = #I/T
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Funksjonene Tillegg og Automatisering
|
||||
##
|
||||
GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data som er lagret i en pivottabellrapport
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Kubefunksjoner
|
||||
##
|
||||
CUBEKPIMEMBER = KUBEKPIMEDLEM ## Returnerer navnet, egenskapen og målet for en viktig ytelsesindikator (KPI), og viser navnet og egenskapen i cellen. En KPI er en målbar enhet, for eksempel månedlig bruttoinntjening eller kvartalsvis inntjening per ansatt, og brukes til å overvåke ytelsen i en organisasjon.
|
||||
CUBEMEMBER = KUBEMEDLEM ## Returnerer et medlem eller en tuppel i et kubehierarki. Brukes til å validere at medlemmet eller tuppelen finnes i kuben.
|
||||
CUBEMEMBERPROPERTY = KUBEMEDLEMEGENSKAP ## Returnerer verdien til en medlemsegenskap i kuben. Brukes til å validere at et medlemsnavn finnes i kuben, og til å returnere den angitte egenskapen for dette medlemmet.
|
||||
CUBERANKEDMEMBER = KUBERANGERTMEDLEM ## Returnerer det n-te, eller rangerte, medlemmet i et sett. Brukes til å returnere ett eller flere elementer i et sett, for eksempel de 10 beste studentene.
|
||||
CUBESET = KUBESETT ## Definerer et beregnet sett av medlemmer eller tuppeler ved å sende et settuttrykk til kuben på serveren, noe som oppretter settet og deretter returnerer dette settet til Microsoft Office Excel.
|
||||
CUBESETCOUNT = KUBESETTANTALL ## Returnerer antallet elementer i et sett.
|
||||
CUBEVALUE = KUBEVERDI ## Returnerer en aggregert verdi fra en kube.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Databasefunksjoner
|
||||
##
|
||||
DAVERAGE = DGJENNOMSNITT ## Returnerer gjennomsnittet av merkede databaseposter
|
||||
DCOUNT = DANTALL ## Teller celler som inneholder tall i en database
|
||||
DCOUNTA = DANTALLA ## Teller celler som ikke er tomme i en database
|
||||
DGET = DHENT ## Trekker ut fra en database en post som oppfyller angitte vilkår
|
||||
DMAX = DMAKS ## Returnerer maksimumsverdien fra merkede databaseposter
|
||||
DMIN = DMIN ## Returnerer minimumsverdien fra merkede databaseposter
|
||||
DPRODUCT = DPRODUKT ## Multipliserer verdiene i et bestemt felt med poster som oppfyller vilkårene i en database
|
||||
DSTDEV = DSTDAV ## Estimerer standardavviket basert på et utvalg av merkede databaseposter
|
||||
DSTDEVP = DSTAVP ## Beregner standardavviket basert på at merkede databaseposter utgjør hele populasjonen
|
||||
DSUM = DSUMMER ## Legger til tallene i feltkolonnen med poster, i databasen som oppfyller vilkårene
|
||||
DVAR = DVARIANS ## Estimerer variansen basert på et utvalg av merkede databaseposter
|
||||
DVARP = DVARIANSP ## Beregner variansen basert på at merkede databaseposter utgjør hele populasjonen
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Dato- og tidsfunksjoner
|
||||
##
|
||||
DATE = DATO ## Returnerer serienummeret som svarer til en bestemt dato
|
||||
DATEVALUE = DATOVERDI ## Konverterer en dato med tekstformat til et serienummer
|
||||
DAY = DAG ## Konverterer et serienummer til en dag i måneden
|
||||
DAYS360 = DAGER360 ## Beregner antall dager mellom to datoer basert på et år med 360 dager
|
||||
EDATE = DAG.ETTER ## Returnerer serienummeret som svarer til datoen som er det indikerte antall måneder før eller etter startdatoen
|
||||
EOMONTH = MÅNEDSSLUTT ## Returnerer serienummeret som svarer til siste dag i måneden, før eller etter et angitt antall måneder
|
||||
HOUR = TIME ## Konverterer et serienummer til en time
|
||||
MINUTE = MINUTT ## Konverterer et serienummer til et minutt
|
||||
MONTH = MÅNED ## Konverterer et serienummer til en måned
|
||||
NETWORKDAYS = NETT.ARBEIDSDAGER ## Returnerer antall hele arbeidsdager mellom to datoer
|
||||
NOW = NÅ ## Returnerer serienummeret som svarer til gjeldende dato og klokkeslett
|
||||
SECOND = SEKUND ## Konverterer et serienummer til et sekund
|
||||
TIME = TID ## Returnerer serienummeret som svarer til et bestemt klokkeslett
|
||||
TIMEVALUE = TIDSVERDI ## Konverterer et klokkeslett i tekstformat til et serienummer
|
||||
TODAY = IDAG ## Returnerer serienummeret som svarer til dagens dato
|
||||
WEEKDAY = UKEDAG ## Konverterer et serienummer til en ukedag
|
||||
WEEKNUM = UKENR ## Konverterer et serienummer til et tall som representerer hvilket nummer uken har i et år
|
||||
WORKDAY = ARBEIDSDAG ## Returnerer serienummeret som svarer til datoen før eller etter et angitt antall arbeidsdager
|
||||
YEAR = ÅR ## Konverterer et serienummer til et år
|
||||
YEARFRAC = ÅRDEL ## Returnerer brøkdelen for året, som svarer til antall hele dager mellom startdato og sluttdato
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Tekniske funksjoner
|
||||
##
|
||||
BESSELI = BESSELI ## Returnerer den endrede Bessel-funksjonen In(x)
|
||||
BESSELJ = BESSELJ ## Returnerer Bessel-funksjonen Jn(x)
|
||||
BESSELK = BESSELK ## Returnerer den endrede Bessel-funksjonen Kn(x)
|
||||
BESSELY = BESSELY ## Returnerer Bessel-funksjonen Yn(x)
|
||||
BIN2DEC = BINTILDES ## Konverterer et binært tall til et desimaltall
|
||||
BIN2HEX = BINTILHEKS ## Konverterer et binært tall til et heksadesimaltall
|
||||
BIN2OCT = BINTILOKT ## Konverterer et binært tall til et oktaltall
|
||||
COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koeffisienter til et komplekst tall
|
||||
CONVERT = KONVERTER ## Konverterer et tall fra ett målsystem til et annet
|
||||
DEC2BIN = DESTILBIN ## Konverterer et desimaltall til et binærtall
|
||||
DEC2HEX = DESTILHEKS ## Konverterer et heltall i 10-tallsystemet til et heksadesimalt tall
|
||||
DEC2OCT = DESTILOKT ## Konverterer et heltall i 10-tallsystemet til et oktaltall
|
||||
DELTA = DELTA ## Undersøker om to verdier er like
|
||||
ERF = FEILF ## Returnerer feilfunksjonen
|
||||
ERFC = FEILFK ## Returnerer den komplementære feilfunksjonen
|
||||
GESTEP = GRENSEVERDI ## Tester om et tall er større enn en terskelverdi
|
||||
HEX2BIN = HEKSTILBIN ## Konverterer et heksadesimaltall til et binært tall
|
||||
HEX2DEC = HEKSTILDES ## Konverterer et heksadesimalt tall til et heltall i 10-tallsystemet
|
||||
HEX2OCT = HEKSTILOKT ## Konverterer et heksadesimalt tall til et oktaltall
|
||||
IMABS = IMABS ## Returnerer absoluttverdien (koeffisienten) til et komplekst tall
|
||||
IMAGINARY = IMAGINÆR ## Returnerer den imaginære koeffisienten til et komplekst tall
|
||||
IMARGUMENT = IMARGUMENT ## Returnerer argumentet theta, som er en vinkel uttrykt i radianer
|
||||
IMCONJUGATE = IMKONJUGERT ## Returnerer den komplekse konjugaten til et komplekst tall
|
||||
IMCOS = IMCOS ## Returnerer cosinus til et komplekst tall
|
||||
IMDIV = IMDIV ## Returnerer kvotienten til to komplekse tall
|
||||
IMEXP = IMEKSP ## Returnerer eksponenten til et komplekst tall
|
||||
IMLN = IMLN ## Returnerer den naturlige logaritmen for et komplekst tall
|
||||
IMLOG10 = IMLOG10 ## Returnerer logaritmen med grunntall 10 for et komplekst tall
|
||||
IMLOG2 = IMLOG2 ## Returnerer logaritmen med grunntall 2 for et komplekst tall
|
||||
IMPOWER = IMOPPHØY ## Returnerer et komplekst tall opphøyd til en heltallspotens
|
||||
IMPRODUCT = IMPRODUKT ## Returnerer produktet av komplekse tall
|
||||
IMREAL = IMREELL ## Returnerer den reelle koeffisienten til et komplekst tall
|
||||
IMSIN = IMSIN ## Returnerer sinus til et komplekst tall
|
||||
IMSQRT = IMROT ## Returnerer kvadratroten av et komplekst tall
|
||||
IMSUB = IMSUB ## Returnerer differansen mellom to komplekse tall
|
||||
IMSUM = IMSUMMER ## Returnerer summen av komplekse tall
|
||||
OCT2BIN = OKTTILBIN ## Konverterer et oktaltall til et binært tall
|
||||
OCT2DEC = OKTTILDES ## Konverterer et oktaltall til et desimaltall
|
||||
OCT2HEX = OKTTILHEKS ## Konverterer et oktaltall til et heksadesimaltall
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Økonomiske funksjoner
|
||||
##
|
||||
ACCRINT = PÅLØPT.PERIODISK.RENTE ## Returnerer påløpte renter for et verdipapir som betaler periodisk rente
|
||||
ACCRINTM = PÅLØPT.FORFALLSRENTE ## Returnerer den påløpte renten for et verdipapir som betaler rente ved forfall
|
||||
AMORDEGRC = AMORDEGRC ## Returnerer avskrivningen for hver regnskapsperiode ved hjelp av en avskrivingskoeffisient
|
||||
AMORLINC = AMORLINC ## Returnerer avskrivingen for hver regnskapsperiode
|
||||
COUPDAYBS = OBLIG.DAGER.FF ## Returnerer antall dager fra begynnelsen av den rentebærende perioden til innløsningsdatoen
|
||||
COUPDAYS = OBLIG.DAGER ## Returnerer antall dager i den rentebærende perioden som inneholder innløsningsdatoen
|
||||
COUPDAYSNC = OBLIG.DAGER.NF ## Returnerer antall dager fra betalingsdato til neste renteinnbetalingsdato
|
||||
COUPNCD = OBLIG.DAGER.EF ## Returnerer obligasjonsdatoen som kommer etter oppgjørsdatoen
|
||||
COUPNUM = OBLIG.ANTALL ## Returnerer antall obligasjoner som skal betales mellom oppgjørsdatoen og forfallsdatoen
|
||||
COUPPCD = OBLIG.DAG.FORRIGE ## Returnerer obligasjonsdatoen som kommer før oppgjørsdatoen
|
||||
CUMIPMT = SAMLET.RENTE ## Returnerer den kumulative renten som er betalt mellom to perioder
|
||||
CUMPRINC = SAMLET.HOVEDSTOL ## Returnerer den kumulative hovedstolen som er betalt for et lån mellom to perioder
|
||||
DB = DAVSKR ## Returnerer avskrivningen for et aktivum i en angitt periode, foretatt med fast degressiv avskrivning
|
||||
DDB = DEGRAVS ## Returnerer avskrivningen for et aktivum for en gitt periode, ved hjelp av dobbel degressiv avskrivning eller en metode som du selv angir
|
||||
DISC = DISKONTERT ## Returnerer diskonteringsraten for et verdipapir
|
||||
DOLLARDE = DOLLARDE ## Konverterer en valutapris uttrykt som en brøk, til en valutapris uttrykt som et desimaltall
|
||||
DOLLARFR = DOLLARBR ## Konverterer en valutapris uttrykt som et desimaltall, til en valutapris uttrykt som en brøk
|
||||
DURATION = VARIGHET ## Returnerer årlig varighet for et verdipapir med renter som betales periodisk
|
||||
EFFECT = EFFEKTIV.RENTE ## Returnerer den effektive årlige rentesatsen
|
||||
FV = SLUTTVERDI ## Returnerer fremtidig verdi for en investering
|
||||
FVSCHEDULE = SVPLAN ## Returnerer den fremtidige verdien av en inngående hovedstol etter å ha anvendt en serie med sammensatte rentesatser
|
||||
INTRATE = RENTESATS ## Returnerer rentefoten av et fullfinansiert verdipapir
|
||||
IPMT = RAVDRAG ## Returnerer betalte renter på en investering for en gitt periode
|
||||
IRR = IR ## Returnerer internrenten for en serie kontantstrømmer
|
||||
ISPMT = ER.AVDRAG ## Beregner renten som er betalt for en investering i løpet av en bestemt periode
|
||||
MDURATION = MVARIGHET ## Returnerer Macauleys modifiserte varighet for et verdipapir med en antatt pålydende verdi på kr 100,00
|
||||
MIRR = MODIR ## Returnerer internrenten der positive og negative kontantstrømmer finansieres med forskjellige satser
|
||||
NOMINAL = NOMINELL ## Returnerer årlig nominell rentesats
|
||||
NPER = PERIODER ## Returnerer antall perioder for en investering
|
||||
NPV = NNV ## Returnerer netto nåverdi for en investering, basert på en serie periodiske kontantstrømmer og en rentesats
|
||||
ODDFPRICE = AVVIKFP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde første periode
|
||||
ODDFYIELD = AVVIKFP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde første periode
|
||||
ODDLPRICE = AVVIKSP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde siste periode
|
||||
ODDLYIELD = AVVIKSP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde siste periode
|
||||
PMT = AVDRAG ## Returnerer periodisk betaling for en annuitet
|
||||
PPMT = AMORT ## Returnerer betalingen på hovedstolen for en investering i en gitt periode
|
||||
PRICE = PRIS ## Returnerer prisen per pålydende kr 100 for et verdipapir som gir periodisk avkastning
|
||||
PRICEDISC = PRIS.DISKONTERT ## Returnerer prisen per pålydende kr 100 for et diskontert verdipapir
|
||||
PRICEMAT = PRIS.FORFALL ## Returnerer prisen per pålydende kr 100 av et verdipapir som betaler rente ved forfall
|
||||
PV = NÅVERDI ## Returnerer nåverdien av en investering
|
||||
RATE = RENTE ## Returnerer rentesatsen per periode for en annuitet
|
||||
RECEIVED = MOTTATT.AVKAST ## Returnerer summen som mottas ved forfallsdato for et fullinvestert verdipapir
|
||||
SLN = LINAVS ## Returnerer den lineære avskrivningen for et aktivum i én periode
|
||||
SYD = ÅRSAVS ## Returnerer årsavskrivningen for et aktivum i en angitt periode
|
||||
TBILLEQ = TBILLEKV ## Returnerer den obligasjonsekvivalente avkastningen for en statsobligasjon
|
||||
TBILLPRICE = TBILLPRIS ## Returnerer prisen per pålydende kr 100 for en statsobligasjon
|
||||
TBILLYIELD = TBILLAVKASTNING ## Returnerer avkastningen til en statsobligasjon
|
||||
VDB = VERDIAVS ## Returnerer avskrivningen for et aktivum i en angitt periode eller delperiode, ved hjelp av degressiv avskrivning
|
||||
XIRR = XIR ## Returnerer internrenten for en serie kontantstrømmer som ikke nødvendigvis er periodiske
|
||||
XNPV = XNNV ## Returnerer netto nåverdi for en serie kontantstrømmer som ikke nødvendigvis er periodiske
|
||||
YIELD = AVKAST ## Returnerer avkastningen på et verdipapir som betaler periodisk rente
|
||||
YIELDDISC = AVKAST.DISKONTERT ## Returnerer årlig avkastning for et diskontert verdipapir, for eksempel en statskasseveksel
|
||||
YIELDMAT = AVKAST.FORFALL ## Returnerer den årlige avkastningen for et verdipapir som betaler rente ved forfallsdato
|
||||
|
||||
|
||||
##
|
||||
## Information functions Informasjonsfunksjoner
|
||||
##
|
||||
CELL = CELLE ## Returnerer informasjon om formatering, plassering eller innholdet til en celle
|
||||
ERROR.TYPE = FEIL.TYPE ## Returnerer et tall som svarer til en feiltype
|
||||
INFO = INFO ## Returnerer informasjon om gjeldende operativmiljø
|
||||
ISBLANK = ERTOM ## Returnerer SANN hvis verdien er tom
|
||||
ISERR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst annen feilverdi enn #I/T
|
||||
ISERROR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst feilverdi
|
||||
ISEVEN = ERPARTALL ## Returnerer SANN hvis tallet er et partall
|
||||
ISLOGICAL = ERLOGISK ## Returnerer SANN hvis verdien er en logisk verdi
|
||||
ISNA = ERIT ## Returnerer SANN hvis verdien er feilverdien #I/T
|
||||
ISNONTEXT = ERIKKETEKST ## Returnerer SANN hvis verdien ikke er tekst
|
||||
ISNUMBER = ERTALL ## Returnerer SANN hvis verdien er et tall
|
||||
ISODD = ERODDETALL ## Returnerer SANN hvis tallet er et oddetall
|
||||
ISREF = ERREF ## Returnerer SANN hvis verdien er en referanse
|
||||
ISTEXT = ERTEKST ## Returnerer SANN hvis verdien er tekst
|
||||
N = N ## Returnerer en verdi som er konvertert til et tall
|
||||
NA = IT ## Returnerer feilverdien #I/T
|
||||
TYPE = VERDITYPE ## Returnerer et tall som indikerer datatypen til en verdi
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Logiske funksjoner
|
||||
##
|
||||
AND = OG ## Returnerer SANN hvis alle argumentene er lik SANN
|
||||
FALSE = USANN ## Returnerer den logiske verdien USANN
|
||||
IF = HVIS ## Angir en logisk test som skal utføres
|
||||
IFERROR = HVISFEIL ## Returnerer en verdi du angir hvis en formel evaluerer til en feil. Ellers returnerer den resultatet av formelen.
|
||||
NOT = IKKE ## Reverserer logikken til argumentet
|
||||
OR = ELLER ## Returnerer SANN hvis ett eller flere argumenter er lik SANN
|
||||
TRUE = SANN ## Returnerer den logiske verdien SANN
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Oppslag- og referansefunksjoner
|
||||
##
|
||||
ADDRESS = ADRESSE ## Returnerer en referanse som tekst til en enkelt celle i et regneark
|
||||
AREAS = OMRÅDER ## Returnerer antall områder i en referanse
|
||||
CHOOSE = VELG ## Velger en verdi fra en liste med verdier
|
||||
COLUMN = KOLONNE ## Returnerer kolonnenummeret for en referanse
|
||||
COLUMNS = KOLONNER ## Returnerer antall kolonner i en referanse
|
||||
HLOOKUP = FINN.KOLONNE ## Leter i den øverste raden i en matrise og returnerer verdien for den angitte cellen
|
||||
HYPERLINK = HYPERKOBLING ## Oppretter en snarvei eller et hopp som åpner et dokument som er lagret på en nettverksserver, et intranett eller Internett
|
||||
INDEX = INDEKS ## Bruker en indeks til å velge en verdi fra en referanse eller matrise
|
||||
INDIRECT = INDIREKTE ## Returnerer en referanse angitt av en tekstverdi
|
||||
LOOKUP = SLÅ.OPP ## Slår opp verdier i en vektor eller matrise
|
||||
MATCH = SAMMENLIGNE ## Slår opp verdier i en referanse eller matrise
|
||||
OFFSET = FORSKYVNING ## Returnerer en referanseforskyvning fra en gitt referanse
|
||||
ROW = RAD ## Returnerer radnummeret for en referanse
|
||||
ROWS = RADER ## Returnerer antall rader i en referanse
|
||||
RTD = RTD ## Henter sanntidsdata fra et program som støtter COM-automatisering (automatisering: En måte å arbeide på med programobjekter fra et annet program- eller utviklingsverktøy. Tidligere kalt OLE-automatisering. Automatisering er en bransjestandard og en funksjon i Component Object Model (COM).)
|
||||
TRANSPOSE = TRANSPONER ## Returnerer transponeringen av en matrise
|
||||
VLOOKUP = FINN.RAD ## Leter i den første kolonnen i en matrise og flytter bortover raden for å returnere verdien til en celle
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Matematikk- og trigonometrifunksjoner
|
||||
##
|
||||
ABS = ABS ## Returnerer absoluttverdien til et tall
|
||||
ACOS = ARCCOS ## Returnerer arcus cosinus til et tall
|
||||
ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus til et tall
|
||||
ASIN = ARCSIN ## Returnerer arcus sinus til et tall
|
||||
ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus til et tall
|
||||
ATAN = ARCTAN ## Returnerer arcus tangens til et tall
|
||||
ATAN2 = ARCTAN2 ## Returnerer arcus tangens fra x- og y-koordinater
|
||||
ATANH = ARCTANH ## Returnerer den inverse hyperbolske tangens til et tall
|
||||
CEILING = AVRUND.GJELDENDE.MULTIPLUM ## Runder av et tall til nærmeste heltall eller til nærmeste signifikante multiplum
|
||||
COMBIN = KOMBINASJON ## Returnerer antall kombinasjoner for ett gitt antall objekter
|
||||
COS = COS ## Returnerer cosinus til et tall
|
||||
COSH = COSH ## Returnerer den hyperbolske cosinus til et tall
|
||||
DEGREES = GRADER ## Konverterer radianer til grader
|
||||
EVEN = AVRUND.TIL.PARTALL ## Runder av et tall oppover til nærmeste heltall som er et partall
|
||||
EXP = EKSP ## Returnerer e opphøyd i en angitt potens
|
||||
FACT = FAKULTET ## Returnerer fakultet til et tall
|
||||
FACTDOUBLE = DOBBELFAKT ## Returnerer et talls doble fakultet
|
||||
FLOOR = AVRUND.GJELDENDE.MULTIPLUM.NED ## Avrunder et tall nedover, mot null
|
||||
GCD = SFF ## Returnerer høyeste felles divisor
|
||||
INT = HELTALL ## Avrunder et tall nedover til nærmeste heltall
|
||||
LCM = MFM ## Returnerer minste felles multiplum
|
||||
LN = LN ## Returnerer den naturlige logaritmen til et tall
|
||||
LOG = LOG ## Returnerer logaritmen for et tall til et angitt grunntall
|
||||
LOG10 = LOG10 ## Returnerer logaritmen med grunntall 10 for et tall
|
||||
MDETERM = MDETERM ## Returnerer matrisedeterminanten til en matrise
|
||||
MINVERSE = MINVERS ## Returnerer den inverse matrisen til en matrise
|
||||
MMULT = MMULT ## Returnerer matriseproduktet av to matriser
|
||||
MOD = REST ## Returnerer resten fra en divisjon
|
||||
MROUND = MRUND ## Returnerer et tall avrundet til det ønskede multiplum
|
||||
MULTINOMIAL = MULTINOMINELL ## Returnerer det multinominelle for et sett med tall
|
||||
ODD = AVRUND.TIL.ODDETALL ## Runder av et tall oppover til nærmeste heltall som er et oddetall
|
||||
PI = PI ## Returnerer verdien av pi
|
||||
POWER = OPPHØYD.I ## Returnerer resultatet av et tall opphøyd i en potens
|
||||
PRODUCT = PRODUKT ## Multipliserer argumentene
|
||||
QUOTIENT = KVOTIENT ## Returnerer heltallsdelen av en divisjon
|
||||
RADIANS = RADIANER ## Konverterer grader til radianer
|
||||
RAND = TILFELDIG ## Returnerer et tilfeldig tall mellom 0 og 1
|
||||
RANDBETWEEN = TILFELDIGMELLOM ## Returnerer et tilfeldig tall innenfor et angitt område
|
||||
ROMAN = ROMERTALL ## Konverterer vanlige tall til romertall, som tekst
|
||||
ROUND = AVRUND ## Avrunder et tall til et angitt antall sifre
|
||||
ROUNDDOWN = AVRUND.NED ## Avrunder et tall nedover, mot null
|
||||
ROUNDUP = AVRUND.OPP ## Runder av et tall oppover, bort fra null
|
||||
SERIESSUM = SUMMER.REKKE ## Returnerer summen av en geometrisk rekke, basert på formelen
|
||||
SIGN = FORTEGN ## Returnerer fortegnet for et tall
|
||||
SIN = SIN ## Returnerer sinus til en gitt vinkel
|
||||
SINH = SINH ## Returnerer den hyperbolske sinus til et tall
|
||||
SQRT = ROT ## Returnerer en positiv kvadratrot
|
||||
SQRTPI = ROTPI ## Returnerer kvadratroten av (tall * pi)
|
||||
SUBTOTAL = DELSUM ## Returnerer en delsum i en liste eller database
|
||||
SUM = SUMMER ## Legger sammen argumentene
|
||||
SUMIF = SUMMERHVIS ## Legger sammen cellene angitt ved et gitt vilkår
|
||||
SUMIFS = SUMMER.HVIS.SETT ## Legger sammen cellene i et område som oppfyller flere vilkår
|
||||
SUMPRODUCT = SUMMERPRODUKT ## Returnerer summen av produktene av tilsvarende matrisekomponenter
|
||||
SUMSQ = SUMMERKVADRAT ## Returnerer kvadratsummen av argumentene
|
||||
SUMX2MY2 = SUMMERX2MY2 ## Returnerer summen av differansen av kvadratene for tilsvarende verdier i to matriser
|
||||
SUMX2PY2 = SUMMERX2PY2 ## Returnerer summen av kvadratsummene for tilsvarende verdier i to matriser
|
||||
SUMXMY2 = SUMMERXMY2 ## Returnerer summen av kvadratene av differansen for tilsvarende verdier i to matriser
|
||||
TAN = TAN ## Returnerer tangens for et tall
|
||||
TANH = TANH ## Returnerer den hyperbolske tangens for et tall
|
||||
TRUNC = AVKORT ## Korter av et tall til et heltall
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Statistiske funksjoner
|
||||
##
|
||||
AVEDEV = GJENNOMSNITTSAVVIK ## Returnerer datapunktenes gjennomsnittlige absoluttavvik fra middelverdien
|
||||
AVERAGE = GJENNOMSNITT ## Returnerer gjennomsnittet for argumentene
|
||||
AVERAGEA = GJENNOMSNITTA ## Returnerer gjennomsnittet for argumentene, inkludert tall, tekst og logiske verdier
|
||||
AVERAGEIF = GJENNOMSNITTHVIS ## Returnerer gjennomsnittet (aritmetisk gjennomsnitt) av alle cellene i et område som oppfyller et bestemt vilkår
|
||||
AVERAGEIFS = GJENNOMSNITT.HVIS.SETT ## Returnerer gjennomsnittet (aritmetisk middelverdi) av alle celler som oppfyller flere vilkår.
|
||||
BETADIST = BETA.FORDELING ## Returnerer den kumulative betafordelingsfunksjonen
|
||||
BETAINV = INVERS.BETA.FORDELING ## Returnerer den inverse verdien til fordelingsfunksjonen for en angitt betafordeling
|
||||
BINOMDIST = BINOM.FORDELING ## Returnerer den individuelle binomiske sannsynlighetsfordelingen
|
||||
CHIDIST = KJI.FORDELING ## Returnerer den ensidige sannsynligheten for en kjikvadrert fordeling
|
||||
CHIINV = INVERS.KJI.FORDELING ## Returnerer den inverse av den ensidige sannsynligheten for den kjikvadrerte fordelingen
|
||||
CHITEST = KJI.TEST ## Utfører testen for uavhengighet
|
||||
CONFIDENCE = KONFIDENS ## Returnerer konfidensintervallet til gjennomsnittet for en populasjon
|
||||
CORREL = KORRELASJON ## Returnerer korrelasjonskoeffisienten mellom to datasett
|
||||
COUNT = ANTALL ## Teller hvor mange tall som er i argumentlisten
|
||||
COUNTA = ANTALLA ## Teller hvor mange verdier som er i argumentlisten
|
||||
COUNTBLANK = TELLBLANKE ## Teller antall tomme celler i et område.
|
||||
COUNTIF = ANTALL.HVIS ## Teller antall celler i et område som oppfyller gitte vilkår
|
||||
COUNTIFS = ANTALL.HVIS.SETT ## Teller antallet ikke-tomme celler i et område som oppfyller flere vilkår
|
||||
COVAR = KOVARIANS ## Returnerer kovariansen, gjennomsnittet av produktene av parvise avvik
|
||||
CRITBINOM = GRENSE.BINOM ## Returnerer den minste verdien der den kumulative binomiske fordelingen er mindre enn eller lik en vilkårsverdi
|
||||
DEVSQ = AVVIK.KVADRERT ## Returnerer summen av kvadrerte avvik
|
||||
EXPONDIST = EKSP.FORDELING ## Returnerer eksponentialfordelingen
|
||||
FDIST = FFORDELING ## Returnerer F-sannsynlighetsfordelingen
|
||||
FINV = FFORDELING.INVERS ## Returnerer den inverse av den sannsynlige F-fordelingen
|
||||
FISHER = FISHER ## Returnerer Fisher-transformasjonen
|
||||
FISHERINV = FISHERINV ## Returnerer den inverse av Fisher-transformasjonen
|
||||
FORECAST = PROGNOSE ## Returnerer en verdi langs en lineær trend
|
||||
FREQUENCY = FREKVENS ## Returnerer en frekvensdistribusjon som en loddrett matrise
|
||||
FTEST = FTEST ## Returnerer resultatet av en F-test
|
||||
GAMMADIST = GAMMAFORDELING ## Returnerer gammafordelingen
|
||||
GAMMAINV = GAMMAINV ## Returnerer den inverse av den gammakumulative fordelingen
|
||||
GAMMALN = GAMMALN ## Returnerer den naturlige logaritmen til gammafunksjonen G(x)
|
||||
GEOMEAN = GJENNOMSNITT.GEOMETRISK ## Returnerer den geometriske middelverdien
|
||||
GROWTH = VEKST ## Returnerer verdier langs en eksponentiell trend
|
||||
HARMEAN = GJENNOMSNITT.HARMONISK ## Returnerer den harmoniske middelverdien
|
||||
HYPGEOMDIST = HYPGEOM.FORDELING ## Returnerer den hypergeometriske fordelingen
|
||||
INTERCEPT = SKJÆRINGSPUNKT ## Returnerer skjæringspunktet til den lineære regresjonslinjen
|
||||
KURT = KURT ## Returnerer kurtosen til et datasett
|
||||
LARGE = N.STØRST ## Returnerer den n-te største verdien i et datasett
|
||||
LINEST = RETTLINJE ## Returnerer parameterne til en lineær trend
|
||||
LOGEST = KURVE ## Returnerer parameterne til en eksponentiell trend
|
||||
LOGINV = LOGINV ## Returnerer den inverse lognormale fordelingen
|
||||
LOGNORMDIST = LOGNORMFORD ## Returnerer den kumulative lognormale fordelingen
|
||||
MAX = STØRST ## Returnerer maksimumsverdien i en argumentliste
|
||||
MAXA = MAKSA ## Returnerer maksimumsverdien i en argumentliste, inkludert tall, tekst og logiske verdier
|
||||
MEDIAN = MEDIAN ## Returnerer medianen til tallene som er gitt
|
||||
MIN = MIN ## Returnerer minimumsverdien i en argumentliste
|
||||
MINA = MINA ## Returnerer den minste verdien i en argumentliste, inkludert tall, tekst og logiske verdier
|
||||
MODE = MODUS ## Returnerer den vanligste verdien i et datasett
|
||||
NEGBINOMDIST = NEGBINOM.FORDELING ## Returnerer den negative binomiske fordelingen
|
||||
NORMDIST = NORMALFORDELING ## Returnerer den kumulative normalfordelingen
|
||||
NORMINV = NORMINV ## Returnerer den inverse kumulative normalfordelingen
|
||||
NORMSDIST = NORMSFORDELING ## Returnerer standard kumulativ normalfordeling
|
||||
NORMSINV = NORMSINV ## Returnerer den inverse av den den kumulative standard normalfordelingen
|
||||
PEARSON = PEARSON ## Returnerer produktmomentkorrelasjonskoeffisienten, Pearson
|
||||
PERCENTILE = PERSENTIL ## Returnerer den n-te persentil av verdiene i et område
|
||||
PERCENTRANK = PROSENTDEL ## Returnerer prosentrangeringen av en verdi i et datasett
|
||||
PERMUT = PERMUTER ## Returnerer antall permutasjoner for et gitt antall objekter
|
||||
POISSON = POISSON ## Returnerer Poissons sannsynlighetsfordeling
|
||||
PROB = SANNSYNLIG ## Returnerer sannsynligheten for at verdier i et område ligger mellom to grenser
|
||||
QUARTILE = KVARTIL ## Returnerer kvartilen til et datasett
|
||||
RANK = RANG ## Returnerer rangeringen av et tall, eller plassen tallet har i en rekke
|
||||
RSQ = RKVADRAT ## Returnerer kvadratet av produktmomentkorrelasjonskoeffisienten (Pearsons r)
|
||||
SKEW = SKJEVFORDELING ## Returnerer skjevheten i en fordeling
|
||||
SLOPE = STIGNINGSTALL ## Returnerer stigningtallet for den lineære regresjonslinjen
|
||||
SMALL = N.MINST ## Returnerer den n-te minste verdien i et datasett
|
||||
STANDARDIZE = NORMALISER ## Returnerer en normalisert verdi
|
||||
STDEV = STDAV ## Estimere standardavvik på grunnlag av et utvalg
|
||||
STDEVA = STDAVVIKA ## Estimerer standardavvik basert på et utvalg, inkludert tall, tekst og logiske verdier
|
||||
STDEVP = STDAVP ## Beregner standardavvik basert på hele populasjonen
|
||||
STDEVPA = STDAVVIKPA ## Beregner standardavvik basert på hele populasjonen, inkludert tall, tekst og logiske verdier
|
||||
STEYX = STANDARDFEIL ## Returnerer standardfeilen for den predikerte y-verdien for hver x i regresjonen
|
||||
TDIST = TFORDELING ## Returnerer en Student t-fordeling
|
||||
TINV = TINV ## Returnerer den inverse Student t-fordelingen
|
||||
TREND = TREND ## Returnerer verdier langs en lineær trend
|
||||
TRIMMEAN = TRIMMET.GJENNOMSNITT ## Returnerer den interne middelverdien til et datasett
|
||||
TTEST = TTEST ## Returnerer sannsynligheten assosiert med en Student t-test
|
||||
VAR = VARIANS ## Estimerer varians basert på et utvalg
|
||||
VARA = VARIANSA ## Estimerer varians basert på et utvalg, inkludert tall, tekst og logiske verdier
|
||||
VARP = VARIANSP ## Beregner varians basert på hele populasjonen
|
||||
VARPA = VARIANSPA ## Beregner varians basert på hele populasjonen, inkludert tall, tekst og logiske verdier
|
||||
WEIBULL = WEIBULL.FORDELING ## Returnerer Weibull-fordelingen
|
||||
ZTEST = ZTEST ## Returnerer den ensidige sannsynlighetsverdien for en z-test
|
||||
|
||||
|
||||
##
|
||||
## Text functions Tekstfunksjoner
|
||||
##
|
||||
ASC = STIGENDE ## Endrer fullbreddes (dobbeltbyte) engelske bokstaver eller katakana i en tegnstreng, til halvbreddes (enkeltbyte) tegn
|
||||
BAHTTEXT = BAHTTEKST ## Konverterer et tall til tekst, og bruker valutaformatet ß (baht)
|
||||
CHAR = TEGNKODE ## Returnerer tegnet som svarer til kodenummeret
|
||||
CLEAN = RENSK ## Fjerner alle tegn som ikke kan skrives ut, fra teksten
|
||||
CODE = KODE ## Returnerer en numerisk kode for det første tegnet i en tekststreng
|
||||
CONCATENATE = KJEDE.SAMMEN ## Slår sammen flere tekstelementer til ett tekstelement
|
||||
DOLLAR = VALUTA ## Konverterer et tall til tekst, og bruker valutaformatet $ (dollar)
|
||||
EXACT = EKSAKT ## Kontrollerer om to tekstverdier er like
|
||||
FIND = FINN ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver)
|
||||
FINDB = FINNB ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver)
|
||||
FIXED = FASTSATT ## Formaterer et tall som tekst med et bestemt antall desimaler
|
||||
JIS = JIS ## Endrer halvbreddes (enkeltbyte) engelske bokstaver eller katakana i en tegnstreng, til fullbreddes (dobbeltbyte) tegn
|
||||
LEFT = VENSTRE ## Returnerer tegnene lengst til venstre i en tekstverdi
|
||||
LEFTB = VENSTREB ## Returnerer tegnene lengst til venstre i en tekstverdi
|
||||
LEN = LENGDE ## Returnerer antall tegn i en tekststreng
|
||||
LENB = LENGDEB ## Returnerer antall tegn i en tekststreng
|
||||
LOWER = SMÅ ## Konverterer tekst til små bokstaver
|
||||
MID = DELTEKST ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir
|
||||
MIDB = DELTEKSTB ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir
|
||||
PHONETIC = FURIGANA ## Trekker ut fonetiske tegn (furigana) fra en tekststreng
|
||||
PROPER = STOR.FORBOKSTAV ## Gir den første bokstaven i hvert ord i en tekstverdi stor forbokstav
|
||||
REPLACE = ERSTATT ## Erstatter tegn i en tekst
|
||||
REPLACEB = ERSTATTB ## Erstatter tegn i en tekst
|
||||
REPT = GJENTA ## Gjentar tekst et gitt antall ganger
|
||||
RIGHT = HØYRE ## Returnerer tegnene lengst til høyre i en tekstverdi
|
||||
RIGHTB = HØYREB ## Returnerer tegnene lengst til høyre i en tekstverdi
|
||||
SEARCH = SØK ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver)
|
||||
SEARCHB = SØKB ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver)
|
||||
SUBSTITUTE = BYTT.UT ## Bytter ut gammel tekst med ny tekst i en tekststreng
|
||||
T = T ## Konverterer argumentene til tekst
|
||||
TEXT = TEKST ## Formaterer et tall og konverterer det til tekst
|
||||
TRIM = TRIMME ## Fjerner mellomrom fra tekst
|
||||
UPPER = STORE ## Konverterer tekst til store bokstaver
|
||||
VALUE = VERDI ## Konverterer et tekstargument til et tall
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = zł
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #ZERO!
|
||||
DIV0 = #DZIEL/0!
|
||||
VALUE = #ARG!
|
||||
REF = #ADR!
|
||||
NAME = #NAZWA?
|
||||
NUM = #LICZBA!
|
||||
NA = #N/D!
|
@ -1,416 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
## Data in this file derived from https://www.excel-function-translation.com/
|
||||
##
|
||||
##
|
||||
|
||||
|
||||
##
|
||||
## Add-in and Automation functions Funkcje dodatków i automatyzacji
|
||||
##
|
||||
GETPIVOTDATA = WEŹDANETABELI ## Zwraca dane przechowywane w raporcie tabeli przestawnej.
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Funkcje modułów
|
||||
##
|
||||
CUBEKPIMEMBER = ELEMENT.KPI.MODUŁU ## Zwraca nazwę, właściwość i miarę kluczowego wskaźnika wydajności (KPI) oraz wyświetla nazwę i właściwość w komórce. Wskaźnik KPI jest miarą ilościową, taką jak miesięczny zysk brutto lub kwartalna fluktuacja pracowników, używaną do monitorowania wydajności organizacji.
|
||||
CUBEMEMBER = ELEMENT.MODUŁU ## Zwraca element lub krotkę z hierarchii modułu. Służy do sprawdzania, czy element lub krotka istnieje w module.
|
||||
CUBEMEMBERPROPERTY = WŁAŚCIWOŚĆ.ELEMENTU.MODUŁU ## Zwraca wartość właściwości elementu w module. Służy do sprawdzania, czy nazwa elementu istnieje w module, i zwracania określonej właściwości dla tego elementu.
|
||||
CUBERANKEDMEMBER = USZEREGOWANY.ELEMENT.MODUŁU ## Zwraca n-ty (albo uszeregowany) element zestawu. Służy do zwracania elementu lub elementów zestawu, na przykład najlepszego sprzedawcy lub 10 najlepszych studentów.
|
||||
CUBESET = ZESTAW.MODUŁÓW ## Definiuje obliczony zestaw elementów lub krotek, wysyłając wyrażenie zestawu do serwera modułu, który tworzy zestaw i zwraca go do programu Microsoft Office Excel.
|
||||
CUBESETCOUNT = LICZNIK.MODUŁÓW.ZESTAWU ## Zwraca liczbę elementów zestawu.
|
||||
CUBEVALUE = WARTOŚĆ.MODUŁU ## Zwraca zagregowaną wartość z modułu.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Funkcje baz danych
|
||||
##
|
||||
DAVERAGE = BD.ŚREDNIA ## Zwraca wartość średniej wybranych wpisów bazy danych.
|
||||
DCOUNT = BD.ILE.REKORDÓW ## Zlicza komórki zawierające liczby w bazie danych.
|
||||
DCOUNTA = BD.ILE.REKORDÓW.A ## Zlicza niepuste komórki w bazie danych.
|
||||
DGET = BD.POLE ## Wyodrębnia z bazy danych jeden rekord spełniający określone kryteria.
|
||||
DMAX = BD.MAX ## Zwraca wartość maksymalną z wybranych wpisów bazy danych.
|
||||
DMIN = BD.MIN ## Zwraca wartość minimalną z wybranych wpisów bazy danych.
|
||||
DPRODUCT = BD.ILOCZYN ## Mnoży wartości w konkretnym, spełniającym kryteria polu rekordów bazy danych.
|
||||
DSTDEV = BD.ODCH.STANDARD ## Szacuje odchylenie standardowe na podstawie próbki z wybranych wpisów bazy danych.
|
||||
DSTDEVP = BD.ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji wybranych wpisów bazy danych.
|
||||
DSUM = BD.SUMA ## Dodaje liczby w kolumnie pól rekordów bazy danych, które spełniają kryteria.
|
||||
DVAR = BD.WARIANCJA ## Szacuje wariancję na podstawie próbki z wybranych wpisów bazy danych.
|
||||
DVARP = BD.WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji wybranych wpisów bazy danych.
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Funkcje dat, godzin i czasu
|
||||
##
|
||||
DATE = DATA ## Zwraca liczbę seryjną dla wybranej daty.
|
||||
DATEVALUE = DATA.WARTOŚĆ ## Konwertuje datę w formie tekstu na liczbę seryjną.
|
||||
DAY = DZIEŃ ## Konwertuje liczbę seryjną na dzień miesiąca.
|
||||
DAYS360 = DNI.360 ## Oblicza liczbę dni między dwiema datami na podstawie roku 360-dniowego.
|
||||
EDATE = UPŁDNI ## Zwraca liczbę seryjną daty jako wskazaną liczbę miesięcy przed określoną datą początkową lub po niej.
|
||||
EOMONTH = EOMONTH ## Zwraca liczbę seryjną ostatniego dnia miesiąca przed określoną liczbą miesięcy lub po niej.
|
||||
HOUR = GODZINA ## Konwertuje liczbę seryjną na godzinę.
|
||||
MINUTE = MINUTA ## Konwertuje liczbę seryjną na minutę.
|
||||
MONTH = MIESIĄC ## Konwertuje liczbę seryjną na miesiąc.
|
||||
NETWORKDAYS = NETWORKDAYS ## Zwraca liczbę pełnych dni roboczych między dwiema datami.
|
||||
NOW = TERAZ ## Zwraca liczbę seryjną bieżącej daty i godziny.
|
||||
SECOND = SEKUNDA ## Konwertuje liczbę seryjną na sekundę.
|
||||
TIME = CZAS ## Zwraca liczbę seryjną określonego czasu.
|
||||
TIMEVALUE = CZAS.WARTOŚĆ ## Konwertuje czas w formie tekstu na liczbę seryjną.
|
||||
TODAY = DZIŚ ## Zwraca liczbę seryjną dla daty bieżącej.
|
||||
WEEKDAY = DZIEŃ.TYG ## Konwertuje liczbę seryjną na dzień tygodnia.
|
||||
WEEKNUM = WEEKNUM ## Konwertuje liczbę seryjną na liczbę reprezentującą numer tygodnia w roku.
|
||||
WORKDAY = WORKDAY ## Zwraca liczbę seryjną dla daty przed określoną liczbą dni roboczych lub po niej.
|
||||
YEAR = ROK ## Konwertuje liczbę seryjną na rok.
|
||||
YEARFRAC = YEARFRAC ## Zwraca część roku reprezentowaną przez pełną liczbę dni między datą początkową a datą końcową.
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Funkcje inżynierskie
|
||||
##
|
||||
BESSELI = BESSELI ## Zwraca wartość zmodyfikowanej funkcji Bessela In(x).
|
||||
BESSELJ = BESSELJ ## Zwraca wartość funkcji Bessela Jn(x).
|
||||
BESSELK = BESSELK ## Zwraca wartość zmodyfikowanej funkcji Bessela Kn(x).
|
||||
BESSELY = BESSELY ## Zwraca wartość funkcji Bessela Yn(x).
|
||||
BIN2DEC = BIN2DEC ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci dziesiętnej.
|
||||
BIN2HEX = BIN2HEX ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci szesnastkowej.
|
||||
BIN2OCT = BIN2OCT ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci ósemkowej.
|
||||
COMPLEX = COMPLEX ## Konwertuje część rzeczywistą i urojoną na liczbę zespoloną.
|
||||
CONVERT = CONVERT ## Konwertuje liczbę z jednego systemu miar na inny.
|
||||
DEC2BIN = DEC2BIN ## Konwertuje liczbę w postaci dziesiętnej na postać dwójkową.
|
||||
DEC2HEX = DEC2HEX ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci szesnastkowej.
|
||||
DEC2OCT = DEC2OCT ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci ósemkowej.
|
||||
DELTA = DELTA ## Sprawdza, czy dwie wartości są równe.
|
||||
ERF = ERF ## Zwraca wartość funkcji błędu.
|
||||
ERFC = ERFC ## Zwraca wartość komplementarnej funkcji błędu.
|
||||
GESTEP = GESTEP ## Sprawdza, czy liczba jest większa niż wartość progowa.
|
||||
HEX2BIN = HEX2BIN ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dwójkowej.
|
||||
HEX2DEC = HEX2DEC ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dziesiętnej.
|
||||
HEX2OCT = HEX2OCT ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci ósemkowej.
|
||||
IMABS = IMABS ## Zwraca wartość bezwzględną (moduł) liczby zespolonej.
|
||||
IMAGINARY = IMAGINARY ## Zwraca wartość części urojonej liczby zespolonej.
|
||||
IMARGUMENT = IMARGUMENT ## Zwraca wartość argumentu liczby zespolonej, przy czym kąt wyrażony jest w radianach.
|
||||
IMCONJUGATE = IMCONJUGATE ## Zwraca wartość liczby sprzężonej danej liczby zespolonej.
|
||||
IMCOS = IMCOS ## Zwraca wartość cosinusa liczby zespolonej.
|
||||
IMDIV = IMDIV ## Zwraca wartość ilorazu dwóch liczb zespolonych.
|
||||
IMEXP = IMEXP ## Zwraca postać wykładniczą liczby zespolonej.
|
||||
IMLN = IMLN ## Zwraca wartość logarytmu naturalnego liczby zespolonej.
|
||||
IMLOG10 = IMLOG10 ## Zwraca wartość logarytmu dziesiętnego liczby zespolonej.
|
||||
IMLOG2 = IMLOG2 ## Zwraca wartość logarytmu liczby zespolonej przy podstawie 2.
|
||||
IMPOWER = IMPOWER ## Zwraca wartość liczby zespolonej podniesionej do potęgi całkowitej.
|
||||
IMPRODUCT = IMPRODUCT ## Zwraca wartość iloczynu liczb zespolonych.
|
||||
IMREAL = IMREAL ## Zwraca wartość części rzeczywistej liczby zespolonej.
|
||||
IMSIN = IMSIN ## Zwraca wartość sinusa liczby zespolonej.
|
||||
IMSQRT = IMSQRT ## Zwraca wartość pierwiastka kwadratowego z liczby zespolonej.
|
||||
IMSUB = IMSUB ## Zwraca wartość różnicy dwóch liczb zespolonych.
|
||||
IMSUM = IMSUM ## Zwraca wartość sumy liczb zespolonych.
|
||||
OCT2BIN = OCT2BIN ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dwójkowej.
|
||||
OCT2DEC = OCT2DEC ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dziesiętnej.
|
||||
OCT2HEX = OCT2HEX ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci szesnastkowej.
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Funkcje finansowe
|
||||
##
|
||||
ACCRINT = ACCRINT ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem okresowym.
|
||||
ACCRINTM = ACCRINTM ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem w terminie wykupu.
|
||||
AMORDEGRC = AMORDEGRC ## Zwraca amortyzację dla każdego okresu rozliczeniowego z wykorzystaniem współczynnika amortyzacji.
|
||||
AMORLINC = AMORLINC ## Zwraca amortyzację dla każdego okresu rozliczeniowego.
|
||||
COUPDAYBS = COUPDAYBS ## Zwraca liczbę dni od początku okresu dywidendy do dnia rozliczeniowego.
|
||||
COUPDAYS = COUPDAYS ## Zwraca liczbę dni w okresie dywidendy, z uwzględnieniem dnia rozliczeniowego.
|
||||
COUPDAYSNC = COUPDAYSNC ## Zwraca liczbę dni od dnia rozliczeniowego do daty następnego dnia dywidendy.
|
||||
COUPNCD = COUPNCD ## Zwraca dzień następnej dywidendy po dniu rozliczeniowym.
|
||||
COUPNUM = COUPNUM ## Zwraca liczbę dywidend płatnych między dniem rozliczeniowym a dniem wykupu.
|
||||
COUPPCD = COUPPCD ## Zwraca dzień poprzedniej dywidendy przed dniem rozliczeniowym.
|
||||
CUMIPMT = CUMIPMT ## Zwraca wartość procentu składanego płatnego między dwoma okresami.
|
||||
CUMPRINC = CUMPRINC ## Zwraca wartość kapitału skumulowanego spłaty pożyczki między dwoma okresami.
|
||||
DB = DB ## Zwraca amortyzację środka trwałego w danym okresie metodą degresywną z zastosowaniem stałej bazowej.
|
||||
DDB = DDB ## Zwraca amortyzację środka trwałego za podany okres metodą degresywną z zastosowaniem podwójnej bazowej lub metodą określoną przez użytkownika.
|
||||
DISC = DISC ## Zwraca wartość stopy dyskontowej papieru wartościowego.
|
||||
DOLLARDE = DOLLARDE ## Konwertuje cenę w postaci ułamkowej na cenę wyrażoną w postaci dziesiętnej.
|
||||
DOLLARFR = DOLLARFR ## Konwertuje cenę wyrażoną w postaci dziesiętnej na cenę wyrażoną w postaci ułamkowej.
|
||||
DURATION = DURATION ## Zwraca wartość rocznego przychodu z papieru wartościowego o okresowych wypłatach oprocentowania.
|
||||
EFFECT = EFFECT ## Zwraca wartość efektywnej rocznej stopy procentowej.
|
||||
FV = FV ## Zwraca przyszłą wartość lokaty.
|
||||
FVSCHEDULE = FVSCHEDULE ## Zwraca przyszłą wartość kapitału początkowego wraz z szeregiem procentów składanych.
|
||||
INTRATE = INTRATE ## Zwraca wartość stopy procentowej papieru wartościowego całkowicie ulokowanego.
|
||||
IPMT = IPMT ## Zwraca wysokość spłaty oprocentowania lokaty za dany okres.
|
||||
IRR = IRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii przepływów gotówkowych.
|
||||
ISPMT = ISPMT ## Oblicza wysokość spłaty oprocentowania za dany okres lokaty.
|
||||
MDURATION = MDURATION ## Zwraca wartość zmodyfikowanego okresu Macauleya dla papieru wartościowego o założonej wartości nominalnej 100 zł.
|
||||
MIRR = MIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla przypadku, gdy dodatnie i ujemne przepływy gotówkowe mają różne stopy.
|
||||
NOMINAL = NOMINAL ## Zwraca wysokość nominalnej rocznej stopy procentowej.
|
||||
NPER = NPER ## Zwraca liczbę okresów dla lokaty.
|
||||
NPV = NPV ## Zwraca wartość bieżącą netto lokaty na podstawie szeregu okresowych przepływów gotówkowych i stopy dyskontowej.
|
||||
ODDFPRICE = ODDFPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym pierwszym okresem.
|
||||
ODDFYIELD = ODDFYIELD ## Zwraca rentowność papieru wartościowego z nietypowym pierwszym okresem.
|
||||
ODDLPRICE = ODDLPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym ostatnim okresem.
|
||||
ODDLYIELD = ODDLYIELD ## Zwraca rentowność papieru wartościowego z nietypowym ostatnim okresem.
|
||||
PMT = PMT ## Zwraca wartość okresowej płatności raty rocznej.
|
||||
PPMT = PPMT ## Zwraca wysokość spłaty kapitału w przypadku lokaty dla danego okresu.
|
||||
PRICE = PRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem okresowym.
|
||||
PRICEDISC = PRICEDISC ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego zdyskontowanego.
|
||||
PRICEMAT = PRICEMAT ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem w terminie wykupu.
|
||||
PV = PV ## Zwraca wartość bieżącą lokaty.
|
||||
RATE = RATE ## Zwraca wysokość stopy procentowej w okresie raty rocznej.
|
||||
RECEIVED = RECEIVED ## Zwraca wartość kapitału otrzymanego przy wykupie papieru wartościowego całkowicie ulokowanego.
|
||||
SLN = SLN ## Zwraca amortyzację środka trwałego za jeden okres metodą liniową.
|
||||
SYD = SYD ## Zwraca amortyzację środka trwałego za dany okres metodą sumy cyfr lat amortyzacji.
|
||||
TBILLEQ = TBILLEQ ## Zwraca rentowność ekwiwalentu obligacji dla bonu skarbowego.
|
||||
TBILLPRICE = TBILLPRICE ## Zwraca cenę za 100 zł wartości nominalnej bonu skarbowego.
|
||||
TBILLYIELD = TBILLYIELD ## Zwraca rentowność bonu skarbowego.
|
||||
VDB = VDB ## Oblicza amortyzację środka trwałego w danym okresie lub jego części metodą degresywną.
|
||||
XIRR = XIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych.
|
||||
XNPV = XNPV ## Zwraca wartość bieżącą netto dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych.
|
||||
YIELD = YIELD ## Zwraca rentowność papieru wartościowego z oprocentowaniem okresowym.
|
||||
YIELDDISC = YIELDDISC ## Zwraca roczną rentowność zdyskontowanego papieru wartościowego, na przykład bonu skarbowego.
|
||||
YIELDMAT = YIELDMAT ## Zwraca roczną rentowność papieru wartościowego oprocentowanego przy wykupie.
|
||||
|
||||
|
||||
##
|
||||
## Information functions Funkcje informacyjne
|
||||
##
|
||||
CELL = KOMÓRKA ## Zwraca informacje o formacie, położeniu lub zawartości komórki.
|
||||
ERROR.TYPE = NR.BŁĘDU ## Zwraca liczbę odpowiadającą typowi błędu.
|
||||
INFO = INFO ## Zwraca informację o aktualnym środowisku pracy.
|
||||
ISBLANK = CZY.PUSTA ## Zwraca wartość PRAWDA, jeśli wartość jest pusta.
|
||||
ISERR = CZY.BŁ ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu, z wyjątkiem #N/D!.
|
||||
ISERROR = CZY.BŁĄD ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu.
|
||||
ISEVEN = ISEVEN ## Zwraca wartość PRAWDA, jeśli liczba jest parzysta.
|
||||
ISLOGICAL = CZY.LOGICZNA ## Zwraca wartość PRAWDA, jeśli wartość jest wartością logiczną.
|
||||
ISNA = CZY.BRAK ## Zwraca wartość PRAWDA, jeśli wartość jest wartością błędu #N/D!.
|
||||
ISNONTEXT = CZY.NIE.TEKST ## Zwraca wartość PRAWDA, jeśli wartość nie jest tekstem.
|
||||
ISNUMBER = CZY.LICZBA ## Zwraca wartość PRAWDA, jeśli wartość jest liczbą.
|
||||
ISODD = ISODD ## Zwraca wartość PRAWDA, jeśli liczba jest nieparzysta.
|
||||
ISREF = CZY.ADR ## Zwraca wartość PRAWDA, jeśli wartość jest odwołaniem.
|
||||
ISTEXT = CZY.TEKST ## Zwraca wartość PRAWDA, jeśli wartość jest tekstem.
|
||||
N = L ## Zwraca wartość przekonwertowaną na postać liczbową.
|
||||
NA = BRAK ## Zwraca wartość błędu #N/D!.
|
||||
TYPE = TYP ## Zwraca liczbę wskazującą typ danych wartości.
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Funkcje logiczne
|
||||
##
|
||||
AND = ORAZ ## Zwraca wartość PRAWDA, jeśli wszystkie argumenty mają wartość PRAWDA.
|
||||
FALSE = FAŁSZ ## Zwraca wartość logiczną FAŁSZ.
|
||||
IF = JEŻELI ## Określa warunek logiczny do sprawdzenia.
|
||||
IFERROR = JEŻELI.BŁĄD ## Zwraca określoną wartość, jeśli wynikiem obliczenia formuły jest błąd; w przeciwnym przypadku zwraca wynik formuły.
|
||||
NOT = NIE ## Odwraca wartość logiczną argumentu.
|
||||
OR = LUB ## Zwraca wartość PRAWDA, jeśli co najmniej jeden z argumentów ma wartość PRAWDA.
|
||||
TRUE = PRAWDA ## Zwraca wartość logiczną PRAWDA.
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Funkcje wyszukiwania i odwołań
|
||||
##
|
||||
ADDRESS = ADRES ## Zwraca odwołanie do jednej komórki w arkuszu jako wartość tekstową.
|
||||
AREAS = OBSZARY ## Zwraca liczbę obszarów występujących w odwołaniu.
|
||||
CHOOSE = WYBIERZ ## Wybiera wartość z listy wartości.
|
||||
COLUMN = NR.KOLUMNY ## Zwraca numer kolumny z odwołania.
|
||||
COLUMNS = LICZBA.KOLUMN ## Zwraca liczbę kolumn dla danego odwołania.
|
||||
HLOOKUP = WYSZUKAJ.POZIOMO ## Przegląda górny wiersz tablicy i zwraca wartość wskazanej komórki.
|
||||
HYPERLINK = HIPERŁĄCZE ## Tworzy skrót lub skok, który pozwala otwierać dokument przechowywany na serwerze sieciowym, w sieci intranet lub w Internecie.
|
||||
INDEX = INDEKS ## Używa indeksu do wybierania wartości z odwołania lub tablicy.
|
||||
INDIRECT = ADR.POŚR ## Zwraca odwołanie określone przez wartość tekstową.
|
||||
LOOKUP = WYSZUKAJ ## Wyszukuje wartości w wektorze lub tablicy.
|
||||
MATCH = PODAJ.POZYCJĘ ## Wyszukuje wartości w odwołaniu lub w tablicy.
|
||||
OFFSET = PRZESUNIĘCIE ## Zwraca adres przesunięty od danego odwołania.
|
||||
ROW = WIERSZ ## Zwraca numer wiersza odwołania.
|
||||
ROWS = ILE.WIERSZY ## Zwraca liczbę wierszy dla danego odwołania.
|
||||
RTD = RTD ## Pobiera dane w czasie rzeczywistym z programu obsługującego automatyzację COM (Automatyzacja: Sposób pracy z obiektami aplikacji pochodzącymi z innej aplikacji lub narzędzia projektowania. Nazywana wcześniej Automatyzacją OLE, Automatyzacja jest standardem przemysłowym i funkcją obiektowego modelu składników (COM, Component Object Model).).
|
||||
TRANSPOSE = TRANSPONUJ ## Zwraca transponowaną tablicę.
|
||||
VLOOKUP = WYSZUKAJ.PIONOWO ## Przeszukuje pierwszą kolumnę tablicy i przechodzi wzdłuż wiersza, aby zwrócić wartość komórki.
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Funkcje matematyczne i trygonometryczne
|
||||
##
|
||||
ABS = MODUŁ.LICZBY ## Zwraca wartość absolutną liczby.
|
||||
ACOS = ACOS ## Zwraca arcus cosinus liczby.
|
||||
ACOSH = ACOSH ## Zwraca arcus cosinus hiperboliczny liczby.
|
||||
ASIN = ASIN ## Zwraca arcus sinus liczby.
|
||||
ASINH = ASINH ## Zwraca arcus sinus hiperboliczny liczby.
|
||||
ATAN = ATAN ## Zwraca arcus tangens liczby.
|
||||
ATAN2 = ATAN2 ## Zwraca arcus tangens liczby na podstawie współrzędnych x i y.
|
||||
ATANH = ATANH ## Zwraca arcus tangens hiperboliczny liczby.
|
||||
CEILING = ZAOKR.W.GÓRĘ ## Zaokrągla liczbę do najbliższej liczby całkowitej lub do najbliższej wielokrotności dokładności.
|
||||
COMBIN = KOMBINACJE ## Zwraca liczbę kombinacji dla danej liczby obiektów.
|
||||
COS = COS ## Zwraca cosinus liczby.
|
||||
COSH = COSH ## Zwraca cosinus hiperboliczny liczby.
|
||||
DEGREES = STOPNIE ## Konwertuje radiany na stopnie.
|
||||
EVEN = ZAOKR.DO.PARZ ## Zaokrągla liczbę w górę do najbliższej liczby parzystej.
|
||||
EXP = EXP ## Zwraca wartość liczby e podniesionej do potęgi określonej przez podaną liczbę.
|
||||
FACT = SILNIA ## Zwraca silnię liczby.
|
||||
FACTDOUBLE = FACTDOUBLE ## Zwraca podwójną silnię liczby.
|
||||
FLOOR = ZAOKR.W.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera.
|
||||
GCD = GCD ## Zwraca największy wspólny dzielnik.
|
||||
INT = ZAOKR.DO.CAŁK ## Zaokrągla liczbę w dół do najbliższej liczby całkowitej.
|
||||
LCM = LCM ## Zwraca najmniejszą wspólną wielokrotność.
|
||||
LN = LN ## Zwraca logarytm naturalny podanej liczby.
|
||||
LOG = LOG ## Zwraca logarytm danej liczby przy zadanej podstawie.
|
||||
LOG10 = LOG10 ## Zwraca logarytm dziesiętny liczby.
|
||||
MDETERM = WYZNACZNIK.MACIERZY ## Zwraca wyznacznik macierzy tablicy.
|
||||
MINVERSE = MACIERZ.ODW ## Zwraca odwrotność macierzy tablicy.
|
||||
MMULT = MACIERZ.ILOCZYN ## Zwraca iloczyn macierzy dwóch tablic.
|
||||
MOD = MOD ## Zwraca resztę z dzielenia.
|
||||
MROUND = MROUND ## Zwraca liczbę zaokrągloną do żądanej wielokrotności.
|
||||
MULTINOMIAL = MULTINOMIAL ## Zwraca wielomian dla zbioru liczb.
|
||||
ODD = ZAOKR.DO.NPARZ ## Zaokrągla liczbę w górę do najbliższej liczby nieparzystej.
|
||||
PI = PI ## Zwraca wartość liczby Pi.
|
||||
POWER = POTĘGA ## Zwraca liczbę podniesioną do potęgi.
|
||||
PRODUCT = ILOCZYN ## Mnoży argumenty.
|
||||
QUOTIENT = QUOTIENT ## Zwraca iloraz (całkowity).
|
||||
RADIANS = RADIANY ## Konwertuje stopnie na radiany.
|
||||
RAND = LOS ## Zwraca liczbę pseudolosową z zakresu od 0 do 1.
|
||||
RANDBETWEEN = RANDBETWEEN ## Zwraca liczbę pseudolosową z zakresu określonego przez podane argumenty.
|
||||
ROMAN = RZYMSKIE ## Konwertuje liczbę arabską na rzymską jako tekst.
|
||||
ROUND = ZAOKR ## Zaokrągla liczbę do określonej liczby cyfr.
|
||||
ROUNDDOWN = ZAOKR.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera.
|
||||
ROUNDUP = ZAOKR.GÓRA ## Zaokrągla liczbę w górę, w kierunku od zera.
|
||||
SERIESSUM = SERIESSUM ## Zwraca sumę szeregu potęgowego na podstawie wzoru.
|
||||
SIGN = ZNAK.LICZBY ## Zwraca znak liczby.
|
||||
SIN = SIN ## Zwraca sinus danego kąta.
|
||||
SINH = SINH ## Zwraca sinus hiperboliczny liczby.
|
||||
SQRT = PIERWIASTEK ## Zwraca dodatni pierwiastek kwadratowy.
|
||||
SQRTPI = SQRTPI ## Zwraca pierwiastek kwadratowy iloczynu (liczba * Pi).
|
||||
SUBTOTAL = SUMY.POŚREDNIE ## Zwraca sumę częściową listy lub bazy danych.
|
||||
SUM = SUMA ## Dodaje argumenty.
|
||||
SUMIF = SUMA.JEŻELI ## Dodaje komórki określone przez podane kryterium.
|
||||
SUMIFS = SUMA.WARUNKÓW ## Dodaje komórki w zakresie, które spełniają wiele kryteriów.
|
||||
SUMPRODUCT = SUMA.ILOCZYNÓW ## Zwraca sumę iloczynów odpowiednich elementów tablicy.
|
||||
SUMSQ = SUMA.KWADRATÓW ## Zwraca sumę kwadratów argumentów.
|
||||
SUMX2MY2 = SUMA.X2.M.Y2 ## Zwraca sumę różnic kwadratów odpowiednich wartości w dwóch tablicach.
|
||||
SUMX2PY2 = SUMA.X2.P.Y2 ## Zwraca sumę sum kwadratów odpowiednich wartości w dwóch tablicach.
|
||||
SUMXMY2 = SUMA.XMY.2 ## Zwraca sumę kwadratów różnic odpowiednich wartości w dwóch tablicach.
|
||||
TAN = TAN ## Zwraca tangens liczby.
|
||||
TANH = TANH ## Zwraca tangens hiperboliczny liczby.
|
||||
TRUNC = LICZBA.CAŁK ## Przycina liczbę do wartości całkowitej.
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Funkcje statystyczne
|
||||
##
|
||||
AVEDEV = ODCH.ŚREDNIE ## Zwraca średnią wartość odchyleń absolutnych punktów danych od ich wartości średniej.
|
||||
AVERAGE = ŚREDNIA ## Zwraca wartość średnią argumentów.
|
||||
AVERAGEA = ŚREDNIA.A ## Zwraca wartość średnią argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
|
||||
AVERAGEIF = ŚREDNIA.JEŻELI ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek w zakresie, które spełniają podane kryteria.
|
||||
AVERAGEIFS = ŚREDNIA.WARUNKÓW ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek, które spełniają jedno lub więcej kryteriów.
|
||||
BETADIST = ROZKŁAD.BETA ## Zwraca skumulowaną funkcję gęstości prawdopodobieństwa beta.
|
||||
BETAINV = ROZKŁAD.BETA.ODW ## Zwraca odwrotność skumulowanej funkcji gęstości prawdopodobieństwa beta.
|
||||
BINOMDIST = ROZKŁAD.DWUM ## Zwraca pojedynczy składnik dwumianowego rozkładu prawdopodobieństwa.
|
||||
CHIDIST = ROZKŁAD.CHI ## Zwraca wartość jednostronnego prawdopodobieństwa rozkładu chi-kwadrat.
|
||||
CHIINV = ROZKŁAD.CHI.ODW ## Zwraca odwrotność wartości jednostronnego prawdopodobieństwa rozkładu chi-kwadrat.
|
||||
CHITEST = TEST.CHI ## Zwraca test niezależności.
|
||||
CONFIDENCE = UFNOŚĆ ## Zwraca interwał ufności dla średniej populacji.
|
||||
CORREL = WSP.KORELACJI ## Zwraca współczynnik korelacji dwóch zbiorów danych.
|
||||
COUNT = ILE.LICZB ## Zlicza liczby znajdujące się na liście argumentów.
|
||||
COUNTA = ILE.NIEPUSTYCH ## Zlicza wartości znajdujące się na liście argumentów.
|
||||
COUNTBLANK = LICZ.PUSTE ## Zwraca liczbę pustych komórek w pewnym zakresie.
|
||||
COUNTIF = LICZ.JEŻELI ## Zlicza komórki wewnątrz zakresu, które spełniają podane kryteria.
|
||||
COUNTIFS = LICZ.WARUNKI ## Zlicza komórki wewnątrz zakresu, które spełniają wiele kryteriów.
|
||||
COVAR = KOWARIANCJA ## Zwraca kowariancję, czyli średnią wartość iloczynów odpowiednich odchyleń.
|
||||
CRITBINOM = PRÓG.ROZKŁAD.DWUM ## Zwraca najmniejszą wartość, dla której skumulowany rozkład dwumianowy jest mniejszy niż wartość kryterium lub równy jej.
|
||||
DEVSQ = ODCH.KWADRATOWE ## Zwraca sumę kwadratów odchyleń.
|
||||
EXPONDIST = ROZKŁAD.EXP ## Zwraca rozkład wykładniczy.
|
||||
FDIST = ROZKŁAD.F ## Zwraca rozkład prawdopodobieństwa F.
|
||||
FINV = ROZKŁAD.F.ODW ## Zwraca odwrotność rozkładu prawdopodobieństwa F.
|
||||
FISHER = ROZKŁAD.FISHER ## Zwraca transformację Fishera.
|
||||
FISHERINV = ROZKŁAD.FISHER.ODW ## Zwraca odwrotność transformacji Fishera.
|
||||
FORECAST = REGLINX ## Zwraca wartość trendu liniowego.
|
||||
FREQUENCY = CZĘSTOŚĆ ## Zwraca rozkład częstotliwości jako tablicę pionową.
|
||||
FTEST = TEST.F ## Zwraca wynik testu F.
|
||||
GAMMADIST = ROZKŁAD.GAMMA ## Zwraca rozkład gamma.
|
||||
GAMMAINV = ROZKŁAD.GAMMA.ODW ## Zwraca odwrotność skumulowanego rozkładu gamma.
|
||||
GAMMALN = ROZKŁAD.LIN.GAMMA ## Zwraca logarytm naturalny funkcji gamma, Γ(x).
|
||||
GEOMEAN = ŚREDNIA.GEOMETRYCZNA ## Zwraca średnią geometryczną.
|
||||
GROWTH = REGEXPW ## Zwraca wartości trendu wykładniczego.
|
||||
HARMEAN = ŚREDNIA.HARMONICZNA ## Zwraca średnią harmoniczną.
|
||||
HYPGEOMDIST = ROZKŁAD.HIPERGEOM ## Zwraca rozkład hipergeometryczny.
|
||||
INTERCEPT = ODCIĘTA ## Zwraca punkt przecięcia osi pionowej z linią regresji liniowej.
|
||||
KURT = KURTOZA ## Zwraca kurtozę zbioru danych.
|
||||
LARGE = MAX.K ## Zwraca k-tą największą wartość ze zbioru danych.
|
||||
LINEST = REGLINP ## Zwraca parametry trendu liniowego.
|
||||
LOGEST = REGEXPP ## Zwraca parametry trendu wykładniczego.
|
||||
LOGINV = ROZKŁAD.LOG.ODW ## Zwraca odwrotność rozkładu logarytmu naturalnego.
|
||||
LOGNORMDIST = ROZKŁAD.LOG ## Zwraca skumulowany rozkład logarytmu naturalnego.
|
||||
MAX = MAX ## Zwraca maksymalną wartość listy argumentów.
|
||||
MAXA = MAX.A ## Zwraca maksymalną wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
|
||||
MEDIAN = MEDIANA ## Zwraca medianę podanych liczb.
|
||||
MIN = MIN ## Zwraca minimalną wartość listy argumentów.
|
||||
MINA = MIN.A ## Zwraca najmniejszą wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
|
||||
MODE = WYST.NAJCZĘŚCIEJ ## Zwraca wartość najczęściej występującą w zbiorze danych.
|
||||
NEGBINOMDIST = ROZKŁAD.DWUM.PRZEC ## Zwraca ujemny rozkład dwumianowy.
|
||||
NORMDIST = ROZKŁAD.NORMALNY ## Zwraca rozkład normalny skumulowany.
|
||||
NORMINV = ROZKŁAD.NORMALNY.ODW ## Zwraca odwrotność rozkładu normalnego skumulowanego.
|
||||
NORMSDIST = ROZKŁAD.NORMALNY.S ## Zwraca standardowy rozkład normalny skumulowany.
|
||||
NORMSINV = ROZKŁAD.NORMALNY.S.ODW ## Zwraca odwrotność standardowego rozkładu normalnego skumulowanego.
|
||||
PEARSON = PEARSON ## Zwraca współczynnik korelacji momentu iloczynu Pearsona.
|
||||
PERCENTILE = PERCENTYL ## Wyznacza k-ty percentyl wartości w zakresie.
|
||||
PERCENTRANK = PROCENT.POZYCJA ## Zwraca procentową pozycję wartości w zbiorze danych.
|
||||
PERMUT = PERMUTACJE ## Zwraca liczbę permutacji dla danej liczby obiektów.
|
||||
POISSON = ROZKŁAD.POISSON ## Zwraca rozkład Poissona.
|
||||
PROB = PRAWDPD ## Zwraca prawdopodobieństwo, że wartości w zakresie leżą pomiędzy dwiema granicami.
|
||||
QUARTILE = KWARTYL ## Wyznacza kwartyl zbioru danych.
|
||||
RANK = POZYCJA ## Zwraca pozycję liczby na liście liczb.
|
||||
RSQ = R.KWADRAT ## Zwraca kwadrat współczynnika korelacji momentu iloczynu Pearsona.
|
||||
SKEW = SKOŚNOŚĆ ## Zwraca skośność rozkładu.
|
||||
SLOPE = NACHYLENIE ## Zwraca nachylenie linii regresji liniowej.
|
||||
SMALL = MIN.K ## Zwraca k-tą najmniejszą wartość ze zbioru danych.
|
||||
STANDARDIZE = NORMALIZUJ ## Zwraca wartość znormalizowaną.
|
||||
STDEV = ODCH.STANDARDOWE ## Szacuje odchylenie standardowe na podstawie próbki.
|
||||
STDEVA = ODCH.STANDARDOWE.A ## Szacuje odchylenie standardowe na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych.
|
||||
STDEVP = ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji.
|
||||
STDEVPA = ODCH.STANDARD.POPUL.A ## Oblicza odchylenie standardowe na podstawie całej populacji, z uwzględnieniem liczb, teksów i wartości logicznych.
|
||||
STEYX = REGBŁSTD ## Zwraca błąd standardowy przewidzianej wartości y dla każdej wartości x w regresji.
|
||||
TDIST = ROZKŁAD.T ## Zwraca rozkład t-Studenta.
|
||||
TINV = ROZKŁAD.T.ODW ## Zwraca odwrotność rozkładu t-Studenta.
|
||||
TREND = REGLINW ## Zwraca wartości trendu liniowego.
|
||||
TRIMMEAN = ŚREDNIA.WEWN ## Zwraca średnią wartość dla wnętrza zbioru danych.
|
||||
TTEST = TEST.T ## Zwraca prawdopodobieństwo związane z testem t-Studenta.
|
||||
VAR = WARIANCJA ## Szacuje wariancję na podstawie próbki.
|
||||
VARA = WARIANCJA.A ## Szacuje wariancję na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych.
|
||||
VARP = WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji.
|
||||
VARPA = WARIANCJA.POPUL.A ## Oblicza wariancję na podstawie całej populacji, z uwzględnieniem liczb, tekstów i wartości logicznych.
|
||||
WEIBULL = ROZKŁAD.WEIBULL ## Zwraca rozkład Weibulla.
|
||||
ZTEST = TEST.Z ## Zwraca wartość jednostronnego prawdopodobieństwa testu z.
|
||||
|
||||
|
||||
##
|
||||
## Text functions Funkcje tekstowe
|
||||
##
|
||||
ASC = ASC ## Zamienia litery angielskie lub katakana o pełnej szerokości (dwubajtowe) w ciągu znaków na znaki o szerokości połówkowej (jednobajtowe).
|
||||
BAHTTEXT = BAHTTEXT ## Konwertuje liczbę na tekst, stosując format walutowy ß (baht).
|
||||
CHAR = ZNAK ## Zwraca znak o podanym numerze kodu.
|
||||
CLEAN = OCZYŚĆ ## Usuwa z tekstu wszystkie znaki, które nie mogą być drukowane.
|
||||
CODE = KOD ## Zwraca kod numeryczny pierwszego znaku w ciągu tekstowym.
|
||||
CONCATENATE = ZŁĄCZ.TEKSTY ## Łączy kilka oddzielnych tekstów w jeden tekst.
|
||||
DOLLAR = KWOTA ## Konwertuje liczbę na tekst, stosując format walutowy $ (dolar).
|
||||
EXACT = PORÓWNAJ ## Sprawdza identyczność dwóch wartości tekstowych.
|
||||
FIND = ZNAJDŹ ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter).
|
||||
FINDB = ZNAJDŹB ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter).
|
||||
FIXED = ZAOKR.DO.TEKST ## Formatuje liczbę jako tekst przy stałej liczbie miejsc dziesiętnych.
|
||||
JIS = JIS ## Zmienia litery angielskie lub katakana o szerokości połówkowej (jednobajtowe) w ciągu znaków na znaki o pełnej szerokości (dwubajtowe).
|
||||
LEFT = LEWY ## Zwraca skrajne lewe znaki z wartości tekstowej.
|
||||
LEFTB = LEWYB ## Zwraca skrajne lewe znaki z wartości tekstowej.
|
||||
LEN = DŁ ## Zwraca liczbę znaków ciągu tekstowego.
|
||||
LENB = DŁ.B ## Zwraca liczbę znaków ciągu tekstowego.
|
||||
LOWER = LITERY.MAŁE ## Konwertuje wielkie litery tekstu na małe litery.
|
||||
MID = FRAGMENT.TEKSTU ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji.
|
||||
MIDB = FRAGMENT.TEKSTU.B ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji.
|
||||
PHONETIC = PHONETIC ## Wybiera znaki fonetyczne (furigana) z ciągu tekstowego.
|
||||
PROPER = Z.WIELKIEJ.LITERY ## Zastępuje pierwszą literę każdego wyrazu tekstu wielką literą.
|
||||
REPLACE = ZASTĄP ## Zastępuje znaki w tekście.
|
||||
REPLACEB = ZASTĄP.B ## Zastępuje znaki w tekście.
|
||||
REPT = POWT ## Powiela tekst daną liczbę razy.
|
||||
RIGHT = PRAWY ## Zwraca skrajne prawe znaki z wartości tekstowej.
|
||||
RIGHTB = PRAWYB ## Zwraca skrajne prawe znaki z wartości tekstowej.
|
||||
SEARCH = SZUKAJ.TEKST ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter).
|
||||
SEARCHB = SZUKAJ.TEKST.B ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter).
|
||||
SUBSTITUTE = PODSTAW ## Podstawia nowy tekst w miejsce poprzedniego tekstu w ciągu tekstowym.
|
||||
T = T ## Konwertuje argumenty na tekst.
|
||||
TEXT = TEKST ## Formatuje liczbę i konwertuje ją na tekst.
|
||||
TRIM = USUŃ.ZBĘDNE.ODSTĘPY ## Usuwa spacje z tekstu.
|
||||
UPPER = LITERY.WIELKIE ## Konwertuje znaki tekstu na wielkie litery.
|
||||
VALUE = WARTOŚĆ ## Konwertuje argument tekstowy na liczbę.
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = R$
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NULO!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #VALOR!
|
||||
REF = #REF!
|
||||
NAME = #NOME?
|
||||
NUM = #NÚM!
|
||||
NA = #N/D
|
@ -1,408 +0,0 @@
|
||||
##
|
||||
## Add-in and Automation functions Funções Suplemento e Automação
|
||||
##
|
||||
GETPIVOTDATA = INFODADOSTABELADINÂMICA ## Retorna os dados armazenados em um relatório de tabela dinâmica
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Funções de Cubo
|
||||
##
|
||||
CUBEKPIMEMBER = MEMBROKPICUBO ## Retorna o nome de um KPI (indicador de desempenho-chave), uma propriedade e uma medida e exibe o nome e a propriedade na célula. Um KPI é uma medida quantificável, como o lucro bruto mensal ou a rotatividade trimestral dos funcionários, usada para monitorar o desempenho de uma organização.
|
||||
CUBEMEMBER = MEMBROCUBO ## Retorna um membro ou tupla em uma hierarquia de cubo. Use para validar se o membro ou tupla existe no cubo.
|
||||
CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Retorna o valor da propriedade de um membro no cubo. Usada para validar a existência do nome do membro no cubo e para retornar a propriedade especificada para esse membro.
|
||||
CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Retorna o enésimo membro, ou o membro ordenado, em um conjunto. Use para retornar um ou mais elementos em um conjunto, assim como o melhor vendedor ou os dez melhores alunos.
|
||||
CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou tuplas enviando uma expressão do conjunto para o cubo no servidor, que cria o conjunto e o retorna para o Microsoft Office Excel.
|
||||
CUBESETCOUNT = CONTAGEMCONJUNTOCUBO ## Retorna o número de itens em um conjunto.
|
||||
CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Funções de banco de dados
|
||||
##
|
||||
DAVERAGE = BDMÉDIA ## Retorna a média das entradas selecionadas de um banco de dados
|
||||
DCOUNT = BDCONTAR ## Conta as células que contêm números em um banco de dados
|
||||
DCOUNTA = BDCONTARA ## Conta células não vazias em um banco de dados
|
||||
DGET = BDEXTRAIR ## Extrai de um banco de dados um único registro que corresponde a um critério específico
|
||||
DMAX = BDMÁX ## Retorna o valor máximo de entradas selecionadas de um banco de dados
|
||||
DMIN = BDMÍN ## Retorna o valor mínimo de entradas selecionadas de um banco de dados
|
||||
DPRODUCT = BDMULTIPL ## Multiplica os valores em um campo específico de registros que correspondem ao critério em um banco de dados
|
||||
DSTDEV = BDEST ## Estima o desvio padrão com base em uma amostra de entradas selecionadas de um banco de dados
|
||||
DSTDEVP = BDDESVPA ## Calcula o desvio padrão com base na população inteira de entradas selecionadas de um banco de dados
|
||||
DSUM = BDSOMA ## Adiciona os números à coluna de campos de registros do banco de dados que correspondem ao critério
|
||||
DVAR = BDVAREST ## Estima a variância com base em uma amostra de entradas selecionadas de um banco de dados
|
||||
DVARP = BDVARP ## Calcula a variância com base na população inteira de entradas selecionadas de um banco de dados
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Funções de data e hora
|
||||
##
|
||||
DATE = DATA ## Retorna o número de série de uma data específica
|
||||
DATEVALUE = DATA.VALOR ## Converte uma data na forma de texto para um número de série
|
||||
DAY = DIA ## Converte um número de série em um dia do mês
|
||||
DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base em um ano de 360 dias
|
||||
EDATE = DATAM ## Retorna o número de série da data que é o número indicado de meses antes ou depois da data inicial
|
||||
EOMONTH = FIMMÊS ## Retorna o número de série do último dia do mês antes ou depois de um número especificado de meses
|
||||
HOUR = HORA ## Converte um número de série em uma hora
|
||||
MINUTE = MINUTO ## Converte um número de série em um minuto
|
||||
MONTH = MÊS ## Converte um número de série em um mês
|
||||
NETWORKDAYS = DIATRABALHOTOTAL ## Retorna o número de dias úteis inteiros entre duas datas
|
||||
NOW = AGORA ## Retorna o número de série seqüencial da data e hora atuais
|
||||
SECOND = SEGUNDO ## Converte um número de série em um segundo
|
||||
TIME = HORA ## Retorna o número de série de uma hora específica
|
||||
TIMEVALUE = VALOR.TEMPO ## Converte um horário na forma de texto para um número de série
|
||||
TODAY = HOJE ## Retorna o número de série da data de hoje
|
||||
WEEKDAY = DIA.DA.SEMANA ## Converte um número de série em um dia da semana
|
||||
WEEKNUM = NÚMSEMANA ## Converte um número de série em um número que representa onde a semana cai numericamente em um ano
|
||||
WORKDAY = DIATRABALHO ## Retorna o número de série da data antes ou depois de um número específico de dias úteis
|
||||
YEAR = ANO ## Converte um número de série em um ano
|
||||
YEARFRAC = FRAÇÃOANO ## Retorna a fração do ano que representa o número de dias entre data_inicial e data_final
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Funções de engenharia
|
||||
##
|
||||
BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada
|
||||
BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x)
|
||||
BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada
|
||||
BESSELY = BESSELY ## Retorna a função de Bessel Yn(x)
|
||||
BIN2DEC = BIN2DEC ## Converte um número binário em decimal
|
||||
BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal
|
||||
BIN2OCT = BIN2OCT ## Converte um número binário em octal
|
||||
COMPLEX = COMPLEX ## Converte coeficientes reais e imaginários e um número complexo
|
||||
CONVERT = CONVERTER ## Converte um número de um sistema de medida para outro
|
||||
DEC2BIN = DECABIN ## Converte um número decimal em binário
|
||||
DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
|
||||
DEC2OCT = DECAOCT ## Converte um número decimal em octal
|
||||
DELTA = DELTA ## Testa se dois valores são iguais
|
||||
ERF = FUNERRO ## Retorna a função de erro
|
||||
ERFC = FUNERROCOMPL ## Retorna a função de erro complementar
|
||||
GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
|
||||
HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
|
||||
HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
|
||||
HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
|
||||
IMABS = IMABS ## Retorna o valor absoluto (módulo) de um número complexo
|
||||
IMAGINARY = IMAGINÁRIO ## Retorna o coeficiente imaginário de um número complexo
|
||||
IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos
|
||||
IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo
|
||||
IMCOS = IMCOS ## Retorna o cosseno de um número complexo
|
||||
IMDIV = IMDIV ## Retorna o quociente de dois números complexos
|
||||
IMEXP = IMEXP ## Retorna o exponencial de um número complexo
|
||||
IMLN = IMLN ## Retorna o logaritmo natural de um número complexo
|
||||
IMLOG10 = IMLOG10 ## Retorna o logaritmo de base 10 de um número complexo
|
||||
IMLOG2 = IMLOG2 ## Retorna o logaritmo de base 2 de um número complexo
|
||||
IMPOWER = IMPOT ## Retorna um número complexo elevado a uma potência inteira
|
||||
IMPRODUCT = IMPROD ## Retorna o produto de números complexos
|
||||
IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo
|
||||
IMSIN = IMSENO ## Retorna o seno de um número complexo
|
||||
IMSQRT = IMRAIZ ## Retorna a raiz quadrada de um número complexo
|
||||
IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos
|
||||
IMSUM = IMSOMA ## Retorna a soma de números complexos
|
||||
OCT2BIN = OCTABIN ## Converte um número octal em binário
|
||||
OCT2DEC = OCTADEC ## Converte um número octal em decimal
|
||||
OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Funções financeiras
|
||||
##
|
||||
ACCRINT = JUROSACUM ## Retorna a taxa de juros acumulados de um título que paga uma taxa periódica de juros
|
||||
ACCRINTM = JUROSACUMV ## Retorna os juros acumulados de um título que paga juros no vencimento
|
||||
AMORDEGRC = AMORDEGRC ## Retorna a depreciação para cada período contábil usando o coeficiente de depreciação
|
||||
AMORLINC = AMORLINC ## Retorna a depreciação para cada período contábil
|
||||
COUPDAYBS = CUPDIASINLIQ ## Retorna o número de dias do início do período de cupom até a data de liquidação
|
||||
COUPDAYS = CUPDIAS ## Retorna o número de dias no período de cupom que contém a data de quitação
|
||||
COUPDAYSNC = CUPDIASPRÓX ## Retorna o número de dias da data de liquidação até a data do próximo cupom
|
||||
COUPNCD = CUPDATAPRÓX ## Retorna a próxima data de cupom após a data de quitação
|
||||
COUPNUM = CUPNÚM ## Retorna o número de cupons pagáveis entre as datas de quitação e vencimento
|
||||
COUPPCD = CUPDATAANT ## Retorna a data de cupom anterior à data de quitação
|
||||
CUMIPMT = PGTOJURACUM ## Retorna os juros acumulados pagos entre dois períodos
|
||||
CUMPRINC = PGTOCAPACUM ## Retorna o capital acumulado pago sobre um empréstimo entre dois períodos
|
||||
DB = BD ## Retorna a depreciação de um ativo para um período especificado, usando o método de balanço de declínio fixo
|
||||
DDB = BDD ## Retorna a depreciação de um ativo com relação a um período especificado usando o método de saldos decrescentes duplos ou qualquer outro método especificado por você
|
||||
DISC = DESC ## Retorna a taxa de desconto de um título
|
||||
DOLLARDE = MOEDADEC ## Converte um preço em formato de moeda, na forma fracionária, em um preço na forma decimal
|
||||
DOLLARFR = MOEDAFRA ## Converte um preço, apresentado na forma decimal, em um preço apresentado na forma fracionária
|
||||
DURATION = DURAÇÃO ## Retorna a duração anual de um título com pagamentos de juros periódicos
|
||||
EFFECT = EFETIVA ## Retorna a taxa de juros anual efetiva
|
||||
FV = VF ## Retorna o valor futuro de um investimento
|
||||
FVSCHEDULE = VFPLANO ## Retorna o valor futuro de um capital inicial após a aplicação de uma série de taxas de juros compostas
|
||||
INTRATE = TAXAJUROS ## Retorna a taxa de juros de um título totalmente investido
|
||||
IPMT = IPGTO ## Retorna o pagamento de juros para um investimento em um determinado período
|
||||
IRR = TIR ## Retorna a taxa interna de retorno de uma série de fluxos de caixa
|
||||
ISPMT = ÉPGTO ## Calcula os juros pagos durante um período específico de um investimento
|
||||
MDURATION = MDURAÇÃO ## Retorna a duração de Macauley modificada para um título com um valor de paridade equivalente a R$ 100
|
||||
MIRR = MTIR ## Calcula a taxa interna de retorno em que fluxos de caixa positivos e negativos são financiados com diferentes taxas
|
||||
NOMINAL = NOMINAL ## Retorna a taxa de juros nominal anual
|
||||
NPER = NPER ## Retorna o número de períodos de um investimento
|
||||
NPV = VPL ## Retorna o valor líquido atual de um investimento com base em uma série de fluxos de caixa periódicos e em uma taxa de desconto
|
||||
ODDFPRICE = PREÇOPRIMINC ## Retorna o preço por R$ 100 de valor nominal de um título com um primeiro período indefinido
|
||||
ODDFYIELD = LUCROPRIMINC ## Retorna o rendimento de um título com um primeiro período indefinido
|
||||
ODDLPRICE = PREÇOÚLTINC ## Retorna o preço por R$ 100 de valor nominal de um título com um último período de cupom indefinido
|
||||
ODDLYIELD = LUCROÚLTINC ## Retorna o rendimento de um título com um último período indefinido
|
||||
PMT = PGTO ## Retorna o pagamento periódico de uma anuidade
|
||||
PPMT = PPGTO ## Retorna o pagamento de capital para determinado período de investimento
|
||||
PRICE = PREÇO ## Retorna a preço por R$ 100,00 de valor nominal de um título que paga juros periódicos
|
||||
PRICEDISC = PREÇODESC ## Retorna o preço por R$ 100,00 de valor nominal de um título descontado
|
||||
PRICEMAT = PREÇOVENC ## Retorna o preço por R$ 100,00 de valor nominal de um título que paga juros no vencimento
|
||||
PV = VP ## Retorna o valor presente de um investimento
|
||||
RATE = TAXA ## Retorna a taxa de juros por período de uma anuidade
|
||||
RECEIVED = RECEBER ## Retorna a quantia recebida no vencimento de um título totalmente investido
|
||||
SLN = DPD ## Retorna a depreciação em linha reta de um ativo durante um período
|
||||
SYD = SDA ## Retorna a depreciação dos dígitos da soma dos anos de um ativo para um período especificado
|
||||
TBILLEQ = OTN ## Retorna o rendimento de um título equivalente a uma obrigação do Tesouro
|
||||
TBILLPRICE = OTNVALOR ## Retorna o preço por R$ 100,00 de valor nominal de uma obrigação do Tesouro
|
||||
TBILLYIELD = OTNLUCRO ## Retorna o rendimento de uma obrigação do Tesouro
|
||||
VDB = BDV ## Retorna a depreciação de um ativo para um período especificado ou parcial usando um método de balanço declinante
|
||||
XIRR = XTIR ## Fornece a taxa interna de retorno para um programa de fluxos de caixa que não é necessariamente periódico
|
||||
XNPV = XVPL ## Retorna o valor presente líquido de um programa de fluxos de caixa que não é necessariamente periódico
|
||||
YIELD = LUCRO ## Retorna o lucro de um título que paga juros periódicos
|
||||
YIELDDISC = LUCRODESC ## Retorna o rendimento anual de um título descontado. Por exemplo, uma obrigação do Tesouro
|
||||
YIELDMAT = LUCROVENC ## Retorna o lucro anual de um título que paga juros no vencimento
|
||||
|
||||
|
||||
##
|
||||
## Information functions Funções de informação
|
||||
##
|
||||
CELL = CÉL ## Retorna informações sobre formatação, localização ou conteúdo de uma célula
|
||||
ERROR.TYPE = TIPO.ERRO ## Retorna um número correspondente a um tipo de erro
|
||||
INFO = INFORMAÇÃO ## Retorna informações sobre o ambiente operacional atual
|
||||
ISBLANK = ÉCÉL.VAZIA ## Retorna VERDADEIRO se o valor for vazio
|
||||
ISERR = ÉERRO ## Retorna VERDADEIRO se o valor for um valor de erro diferente de #N/D
|
||||
ISERROR = ÉERROS ## Retorna VERDADEIRO se o valor for um valor de erro
|
||||
ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par
|
||||
ISLOGICAL = ÉLÓGICO ## Retorna VERDADEIRO se o valor for um valor lógico
|
||||
ISNA = É.NÃO.DISP ## Retorna VERDADEIRO se o valor for o valor de erro #N/D
|
||||
ISNONTEXT = É.NÃO.TEXTO ## Retorna VERDADEIRO se o valor for diferente de texto
|
||||
ISNUMBER = ÉNÚM ## Retorna VERDADEIRO se o valor for um número
|
||||
ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar
|
||||
ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência
|
||||
ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto
|
||||
N = N ## Retorna um valor convertido em um número
|
||||
NA = NÃO.DISP ## Retorna o valor de erro #N/D
|
||||
TYPE = TIPO ## Retorna um número indicando o tipo de dados de um valor
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Funções lógicas
|
||||
##
|
||||
AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS
|
||||
FALSE = FALSO ## Retorna o valor lógico FALSO
|
||||
IF = SE ## Especifica um teste lógico a ser executado
|
||||
IFERROR = SEERRO ## Retornará um valor que você especifica se uma fórmula for avaliada para um erro; do contrário, retornará o resultado da fórmula
|
||||
NOT = NÃO ## Inverte o valor lógico do argumento
|
||||
OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO
|
||||
TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Funções de pesquisa e referência
|
||||
##
|
||||
ADDRESS = ENDEREÇO ## Retorna uma referência como texto para uma única célula em uma planilha
|
||||
AREAS = ÁREAS ## Retorna o número de áreas em uma referência
|
||||
CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores
|
||||
COLUMN = COL ## Retorna o número da coluna de uma referência
|
||||
COLUMNS = COLS ## Retorna o número de colunas em uma referência
|
||||
HLOOKUP = PROCH ## Procura na linha superior de uma matriz e retorna o valor da célula especificada
|
||||
HYPERLINK = HYPERLINK ## Cria um atalho ou salto que abre um documento armazenado em um servidor de rede, uma intranet ou na Internet
|
||||
INDEX = ÍNDICE ## Usa um índice para escolher um valor de uma referência ou matriz
|
||||
INDIRECT = INDIRETO ## Retorna uma referência indicada por um valor de texto
|
||||
LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz
|
||||
MATCH = CORRESP ## Procura valores em uma referência ou em uma matriz
|
||||
OFFSET = DESLOC ## Retorna um deslocamento de referência com base em uma determinada referência
|
||||
ROW = LIN ## Retorna o número da linha de uma referência
|
||||
ROWS = LINS ## Retorna o número de linhas em uma referência
|
||||
RTD = RTD ## Recupera dados em tempo real de um programa que ofereça suporte a automação COM (automação: uma forma de trabalhar com objetos de um aplicativo a partir de outro aplicativo ou ferramenta de desenvolvimento. Chamada inicialmente de automação OLE, a automação é um padrão industrial e um recurso do modelo de objeto componente (COM).)
|
||||
TRANSPOSE = TRANSPOR ## Retorna a transposição de uma matriz
|
||||
VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e move ao longo da linha para retornar o valor de uma célula
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Funções matemáticas e trigonométricas
|
||||
##
|
||||
ABS = ABS ## Retorna o valor absoluto de um número
|
||||
ACOS = ACOS ## Retorna o arco cosseno de um número
|
||||
ACOSH = ACOSH ## Retorna o cosseno hiperbólico inverso de um número
|
||||
ASIN = ASEN ## Retorna o arco seno de um número
|
||||
ASINH = ASENH ## Retorna o seno hiperbólico inverso de um número
|
||||
ATAN = ATAN ## Retorna o arco tangente de um número
|
||||
ATAN2 = ATAN2 ## Retorna o arco tangente das coordenadas x e y especificadas
|
||||
ATANH = ATANH ## Retorna a tangente hiperbólica inversa de um número
|
||||
CEILING = TETO ## Arredonda um número para o inteiro mais próximo ou para o múltiplo mais próximo de significância
|
||||
COMBIN = COMBIN ## Retorna o número de combinações de um determinado número de objetos
|
||||
COS = COS ## Retorna o cosseno de um número
|
||||
COSH = COSH ## Retorna o cosseno hiperbólico de um número
|
||||
DEGREES = GRAUS ## Converte radianos em graus
|
||||
EVEN = PAR ## Arredonda um número para cima até o inteiro par mais próximo
|
||||
EXP = EXP ## Retorna e elevado à potência de um número especificado
|
||||
FACT = FATORIAL ## Retorna o fatorial de um número
|
||||
FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número
|
||||
FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero
|
||||
GCD = MDC ## Retorna o máximo divisor comum
|
||||
INT = INT ## Arredonda um número para baixo até o número inteiro mais próximo
|
||||
LCM = MMC ## Retorna o mínimo múltiplo comum
|
||||
LN = LN ## Retorna o logaritmo natural de um número
|
||||
LOG = LOG ## Retorna o logaritmo de um número de uma base especificada
|
||||
LOG10 = LOG10 ## Retorna o logaritmo de base 10 de um número
|
||||
MDETERM = MATRIZ.DETERM ## Retorna o determinante de uma matriz de uma variável do tipo matriz
|
||||
MINVERSE = MATRIZ.INVERSO ## Retorna a matriz inversa de uma matriz
|
||||
MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes
|
||||
MOD = RESTO ## Retorna o resto da divisão
|
||||
MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado
|
||||
MULTINOMIAL = MULTINOMIAL ## Retorna o multinomial de um conjunto de números
|
||||
ODD = ÍMPAR ## Arredonda um número para cima até o inteiro ímpar mais próximo
|
||||
PI = PI ## Retorna o valor de Pi
|
||||
POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência
|
||||
PRODUCT = MULT ## Multiplica seus argumentos
|
||||
QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão
|
||||
RADIANS = RADIANOS ## Converte graus em radianos
|
||||
RAND = ALEATÓRIO ## Retorna um número aleatório entre 0 e 1
|
||||
RANDBETWEEN = ALEATÓRIOENTRE ## Retorna um número aleatório entre os números especificados
|
||||
ROMAN = ROMANO ## Converte um algarismo arábico em romano, como texto
|
||||
ROUND = ARRED ## Arredonda um número até uma quantidade especificada de dígitos
|
||||
ROUNDDOWN = ARREDONDAR.PARA.BAIXO ## Arredonda um número para baixo até zero
|
||||
ROUNDUP = ARREDONDAR.PARA.CIMA ## Arredonda um número para cima, afastando-o de zero
|
||||
SERIESSUM = SOMASEQÜÊNCIA ## Retorna a soma de uma série polinomial baseada na fórmula
|
||||
SIGN = SINAL ## Retorna o sinal de um número
|
||||
SIN = SEN ## Retorna o seno de um ângulo dado
|
||||
SINH = SENH ## Retorna o seno hiperbólico de um número
|
||||
SQRT = RAIZ ## Retorna uma raiz quadrada positiva
|
||||
SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi)
|
||||
SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados
|
||||
SUM = SOMA ## Soma seus argumentos
|
||||
SUMIF = SOMASE ## Adiciona as células especificadas por um determinado critério
|
||||
SUMIFS = SOMASE ## Adiciona as células em um intervalo que atende a vários critérios
|
||||
SUMPRODUCT = SOMARPRODUTO ## Retorna a soma dos produtos de componentes correspondentes de matrizes
|
||||
SUMSQ = SOMAQUAD ## Retorna a soma dos quadrados dos argumentos
|
||||
SUMX2MY2 = SOMAX2DY2 ## Retorna a soma da diferença dos quadrados dos valores correspondentes em duas matrizes
|
||||
SUMX2PY2 = SOMAX2SY2 ## Retorna a soma da soma dos quadrados dos valores correspondentes em duas matrizes
|
||||
SUMXMY2 = SOMAXMY2 ## Retorna a soma dos quadrados das diferenças dos valores correspondentes em duas matrizes
|
||||
TAN = TAN ## Retorna a tangente de um número
|
||||
TANH = TANH ## Retorna a tangente hiperbólica de um número
|
||||
TRUNC = TRUNCAR ## Trunca um número para um inteiro
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Funções estatísticas
|
||||
##
|
||||
AVEDEV = DESV.MÉDIO ## Retorna a média aritmética dos desvios médios dos pontos de dados a partir de sua média
|
||||
AVERAGE = MÉDIA ## Retorna a média dos argumentos
|
||||
AVERAGEA = MÉDIAA ## Retorna a média dos argumentos, inclusive números, texto e valores lógicos
|
||||
AVERAGEIF = MÉDIASE ## Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério
|
||||
AVERAGEIFS = MÉDIASES ## Retorna a média (média aritmética) de todas as células que atendem a múltiplos critérios.
|
||||
BETADIST = DISTBETA ## Retorna a função de distribuição cumulativa beta
|
||||
BETAINV = BETA.ACUM.INV ## Retorna o inverso da função de distribuição cumulativa para uma distribuição beta especificada
|
||||
BINOMDIST = DISTRBINOM ## Retorna a probabilidade de distribuição binomial do termo individual
|
||||
CHIDIST = DIST.QUI ## Retorna a probabilidade unicaudal da distribuição qui-quadrada
|
||||
CHIINV = INV.QUI ## Retorna o inverso da probabilidade uni-caudal da distribuição qui-quadrada
|
||||
CHITEST = TESTE.QUI ## Retorna o teste para independência
|
||||
CONFIDENCE = INT.CONFIANÇA ## Retorna o intervalo de confiança para uma média da população
|
||||
CORREL = CORREL ## Retorna o coeficiente de correlação entre dois conjuntos de dados
|
||||
COUNT = CONT.NÚM ## Calcula quantos números há na lista de argumentos
|
||||
COUNTA = CONT.VALORES ## Calcula quantos valores há na lista de argumentos
|
||||
COUNTBLANK = CONTAR.VAZIO ## Conta o número de células vazias no intervalo especificado
|
||||
COUNTIF = CONT.SE ## Calcula o número de células não vazias em um intervalo que corresponde a determinados critérios
|
||||
COUNTIFS = CONT.SES ## Conta o número de células dentro de um intervalo que atende a múltiplos critérios
|
||||
COVAR = COVAR ## Retorna a covariância, a média dos produtos dos desvios pares
|
||||
CRITBINOM = CRIT.BINOM ## Retorna o menor valor para o qual a distribuição binomial cumulativa é menor ou igual ao valor padrão
|
||||
DEVSQ = DESVQ ## Retorna a soma dos quadrados dos desvios
|
||||
EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial
|
||||
FDIST = DISTF ## Retorna a distribuição de probabilidade F
|
||||
FINV = INVF ## Retorna o inverso da distribuição de probabilidades F
|
||||
FISHER = FISHER ## Retorna a transformação Fisher
|
||||
FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher
|
||||
FORECAST = PREVISÃO ## Retorna um valor ao longo de uma linha reta
|
||||
FREQUENCY = FREQÜÊNCIA ## Retorna uma distribuição de freqüência como uma matriz vertical
|
||||
FTEST = TESTEF ## Retorna o resultado de um teste F
|
||||
GAMMADIST = DISTGAMA ## Retorna a distribuição gama
|
||||
GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama
|
||||
GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x)
|
||||
GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica
|
||||
GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial
|
||||
HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica
|
||||
HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica
|
||||
INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear
|
||||
KURT = CURT ## Retorna a curtose de um conjunto de dados
|
||||
LARGE = MAIOR ## Retorna o maior valor k-ésimo de um conjunto de dados
|
||||
LINEST = PROJ.LIN ## Retorna os parâmetros de uma tendência linear
|
||||
LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial
|
||||
LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal
|
||||
LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa
|
||||
MAX = MÁXIMO ## Retorna o valor máximo em uma lista de argumentos
|
||||
MAXA = MÁXIMOA ## Retorna o maior valor em uma lista de argumentos, inclusive números, texto e valores lógicos
|
||||
MEDIAN = MED ## Retorna a mediana dos números indicados
|
||||
MIN = MÍNIMO ## Retorna o valor mínimo em uma lista de argumentos
|
||||
MINA = MÍNIMOA ## Retorna o menor valor em uma lista de argumentos, inclusive números, texto e valores lógicos
|
||||
MODE = MODO ## Retorna o valor mais comum em um conjunto de dados
|
||||
NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa
|
||||
NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal
|
||||
NORMINV = INV.NORM ## Retorna o inverso da distribuição cumulativa normal
|
||||
NORMSDIST = DIST.NORMP ## Retorna a distribuição cumulativa normal padrão
|
||||
NORMSINV = INV.NORMP ## Retorna o inverso da distribuição cumulativa normal padrão
|
||||
PEARSON = PEARSON ## Retorna o coeficiente de correlação do momento do produto Pearson
|
||||
PERCENTILE = PERCENTIL ## Retorna o k-ésimo percentil de valores em um intervalo
|
||||
PERCENTRANK = ORDEM.PORCENTUAL ## Retorna a ordem percentual de um valor em um conjunto de dados
|
||||
PERMUT = PERMUT ## Retorna o número de permutações de um determinado número de objetos
|
||||
POISSON = POISSON ## Retorna a distribuição Poisson
|
||||
PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites
|
||||
QUARTILE = QUARTIL ## Retorna o quartil do conjunto de dados
|
||||
RANK = ORDEM ## Retorna a posição de um número em uma lista de números
|
||||
RSQ = RQUAD ## Retorna o quadrado do coeficiente de correlação do momento do produto de Pearson
|
||||
SKEW = DISTORÇÃO ## Retorna a distorção de uma distribuição
|
||||
SLOPE = INCLINAÇÃO ## Retorna a inclinação da linha de regressão linear
|
||||
SMALL = MENOR ## Retorna o menor valor k-ésimo do conjunto de dados
|
||||
STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado
|
||||
STDEV = DESVPAD ## Estima o desvio padrão com base em uma amostra
|
||||
STDEVA = DESVPADA ## Estima o desvio padrão com base em uma amostra, inclusive números, texto e valores lógicos
|
||||
STDEVP = DESVPADP ## Calcula o desvio padrão com base na população total
|
||||
STDEVPA = DESVPADPA ## Calcula o desvio padrão com base na população total, inclusive números, texto e valores lógicos
|
||||
STEYX = EPADYX ## Retorna o erro padrão do valor-y previsto para cada x da regressão
|
||||
TDIST = DISTT ## Retorna a distribuição t de Student
|
||||
TINV = INVT ## Retorna o inverso da distribuição t de Student
|
||||
TREND = TENDÊNCIA ## Retorna valores ao longo de uma tendência linear
|
||||
TRIMMEAN = MÉDIA.INTERNA ## Retorna a média do interior de um conjunto de dados
|
||||
TTEST = TESTET ## Retorna a probabilidade associada ao teste t de Student
|
||||
VAR = VAR ## Estima a variância com base em uma amostra
|
||||
VARA = VARA ## Estima a variância com base em uma amostra, inclusive números, texto e valores lógicos
|
||||
VARP = VARP ## Calcula a variância com base na população inteira
|
||||
VARPA = VARPA ## Calcula a variância com base na população total, inclusive números, texto e valores lógicos
|
||||
WEIBULL = WEIBULL ## Retorna a distribuição Weibull
|
||||
ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z
|
||||
|
||||
|
||||
##
|
||||
## Text functions Funções de texto
|
||||
##
|
||||
ASC = ASC ## Altera letras do inglês ou katakana de largura total (bytes duplos) dentro de uma seqüência de caracteres para caracteres de meia largura (byte único)
|
||||
BAHTTEXT = BAHTTEXT ## Converte um número em um texto, usando o formato de moeda ß (baht)
|
||||
CHAR = CARACT ## Retorna o caractere especificado pelo número de código
|
||||
CLEAN = TIRAR ## Remove todos os caracteres do texto que não podem ser impressos
|
||||
CODE = CÓDIGO ## Retorna um código numérico para o primeiro caractere de uma seqüência de caracteres de texto
|
||||
CONCATENATE = CONCATENAR ## Agrupa vários itens de texto em um único item de texto
|
||||
DOLLAR = MOEDA ## Converte um número em texto, usando o formato de moeda $ (dólar)
|
||||
EXACT = EXATO ## Verifica se dois valores de texto são idênticos
|
||||
FIND = PROCURAR ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)
|
||||
FINDB = PROCURARB ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)
|
||||
FIXED = DEF.NÚM.DEC ## Formata um número como texto com um número fixo de decimais
|
||||
JIS = JIS ## Altera letras do inglês ou katakana de meia largura (byte único) dentro de uma seqüência de caracteres para caracteres de largura total (bytes duplos)
|
||||
LEFT = ESQUERDA ## Retorna os caracteres mais à esquerda de um valor de texto
|
||||
LEFTB = ESQUERDAB ## Retorna os caracteres mais à esquerda de um valor de texto
|
||||
LEN = NÚM.CARACT ## Retorna o número de caracteres em uma seqüência de texto
|
||||
LENB = NÚM.CARACTB ## Retorna o número de caracteres em uma seqüência de texto
|
||||
LOWER = MINÚSCULA ## Converte texto para minúsculas
|
||||
MID = EXT.TEXTO ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada
|
||||
MIDB = EXT.TEXTOB ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada
|
||||
PHONETIC = FONÉTICA ## Extrai os caracteres fonéticos (furigana) de uma seqüência de caracteres de texto
|
||||
PROPER = PRI.MAIÚSCULA ## Coloca a primeira letra de cada palavra em maiúscula em um valor de texto
|
||||
REPLACE = MUDAR ## Muda os caracteres dentro do texto
|
||||
REPLACEB = MUDARB ## Muda os caracteres dentro do texto
|
||||
REPT = REPT ## Repete o texto um determinado número de vezes
|
||||
RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto
|
||||
RIGHTB = DIREITAB ## Retorna os caracteres mais à direita de um valor de texto
|
||||
SEARCH = LOCALIZAR ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas)
|
||||
SEARCHB = LOCALIZARB ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas)
|
||||
SUBSTITUTE = SUBSTITUIR ## Substitui um novo texto por um texto antigo em uma seqüência de texto
|
||||
T = T ## Converte os argumentos em texto
|
||||
TEXT = TEXTO ## Formata um número e o converte em texto
|
||||
TRIM = ARRUMAR ## Remove espaços do texto
|
||||
UPPER = MAIÚSCULA ## Converte o texto em maiúsculas
|
||||
VALUE = VALOR ## Converte um argumento de texto em um número
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = €
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #NULO!
|
||||
DIV0 = #DIV/0!
|
||||
VALUE = #VALOR!
|
||||
REF = #REF!
|
||||
NAME = #NOME?
|
||||
NUM = #NÚM!
|
||||
NA = #N/D
|
@ -1,408 +0,0 @@
|
||||
##
|
||||
## Add-in and Automation functions Funções de Suplemento e Automatização
|
||||
##
|
||||
GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Funções de cubo
|
||||
##
|
||||
CUBEKPIMEMBER = MEMBROKPICUBO ## Devolve o nome, propriedade e medição de um KPI (key performance indicator) e apresenta o nome e a propriedade na célula. Um KPI é uma medida quantificável, como, por exemplo, o lucro mensal bruto ou a rotatividade trimestral de pessoal, utilizada para monitorizar o desempenho de uma organização.
|
||||
CUBEMEMBER = MEMBROCUBO ## Devolve um membro ou cadeia de identificação numa hierarquia de cubo. Utilizada para validar a existência do membro ou cadeia de identificação no cubo.
|
||||
CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Devolve o valor de uma propriedade de membro no cubo. Utilizada para validar a existência de um nome de membro no cubo e para devolver a propriedade especificada para esse membro.
|
||||
CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Devolve o enésimo ou a classificação mais alta num conjunto. Utilizada para devolver um ou mais elementos num conjunto, tal como o melhor vendedor ou os 10 melhores alunos.
|
||||
CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou cadeias de identificação enviando uma expressão de conjunto para o cubo no servidor, que cria o conjunto e, em seguida, devolve o conjunto ao Microsoft Office Excel.
|
||||
CUBESETCOUNT = CONTARCONJUNTOCUBO ## Devolve o número de itens num conjunto.
|
||||
CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Funções de base de dados
|
||||
##
|
||||
DAVERAGE = BDMÉDIA ## Devolve a média das entradas da base de dados seleccionadas
|
||||
DCOUNT = BDCONTAR ## Conta as células que contêm números numa base de dados
|
||||
DCOUNTA = BDCONTAR.VAL ## Conta as células que não estejam em branco numa base de dados
|
||||
DGET = BDOBTER ## Extrai de uma base de dados um único registo que corresponde aos critérios especificados
|
||||
DMAX = BDMÁX ## Devolve o valor máximo das entradas da base de dados seleccionadas
|
||||
DMIN = BDMÍN ## Devolve o valor mínimo das entradas da base de dados seleccionadas
|
||||
DPRODUCT = BDMULTIPL ## Multiplica os valores de um determinado campo de registos que correspondem aos critérios numa base de dados
|
||||
DSTDEV = BDDESVPAD ## Calcula o desvio-padrão com base numa amostra de entradas da base de dados seleccionadas
|
||||
DSTDEVP = BDDESVPADP ## Calcula o desvio-padrão com base na população total das entradas da base de dados seleccionadas
|
||||
DSUM = BDSOMA ## Adiciona os números na coluna de campo dos registos de base de dados que correspondem aos critérios
|
||||
DVAR = BDVAR ## Calcula a variância com base numa amostra das entradas de base de dados seleccionadas
|
||||
DVARP = BDVARP ## Calcula a variância com base na população total das entradas de base de dados seleccionadas
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Funções de data e hora
|
||||
##
|
||||
DATE = DATA ## Devolve o número de série de uma determinada data
|
||||
DATEVALUE = DATA.VALOR ## Converte uma data em forma de texto num número de série
|
||||
DAY = DIA ## Converte um número de série num dia do mês
|
||||
DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base num ano com 360 dias
|
||||
EDATE = DATAM ## Devolve um número de série de data que corresponde ao número de meses indicado antes ou depois da data de início
|
||||
EOMONTH = FIMMÊS ## Devolve o número de série do último dia do mês antes ou depois de um número de meses especificado
|
||||
HOUR = HORA ## Converte um número de série numa hora
|
||||
MINUTE = MINUTO ## Converte um número de série num minuto
|
||||
MONTH = MÊS ## Converte um número de série num mês
|
||||
NETWORKDAYS = DIATRABALHOTOTAL ## Devolve o número total de dias úteis entre duas datas
|
||||
NOW = AGORA ## Devolve o número de série da data e hora actuais
|
||||
SECOND = SEGUNDO ## Converte um número de série num segundo
|
||||
TIME = TEMPO ## Devolve o número de série de um determinado tempo
|
||||
TIMEVALUE = VALOR.TEMPO ## Converte um tempo em forma de texto num número de série
|
||||
TODAY = HOJE ## Devolve o número de série da data actual
|
||||
WEEKDAY = DIA.SEMANA ## Converte um número de série num dia da semana
|
||||
WEEKNUM = NÚMSEMANA ## Converte um número de série num número que representa o número da semana num determinado ano
|
||||
WORKDAY = DIA.TRABALHO ## Devolve o número de série da data antes ou depois de um número de dias úteis especificado
|
||||
YEAR = ANO ## Converte um número de série num ano
|
||||
YEARFRAC = FRACÇÃOANO ## Devolve a fracção de ano que representa o número de dias inteiros entre a data_de_início e a data_de_fim
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Funções de engenharia
|
||||
##
|
||||
BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x)
|
||||
BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x)
|
||||
BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x)
|
||||
BESSELY = BESSELY ## Devolve a função de Bessel Yn(x)
|
||||
BIN2DEC = BINADEC ## Converte um número binário em decimal
|
||||
BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal
|
||||
BIN2OCT = BINAOCT ## Converte um número binário em octal
|
||||
COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo
|
||||
CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro
|
||||
DEC2BIN = DECABIN ## Converte um número decimal em binário
|
||||
DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
|
||||
DEC2OCT = DECAOCT ## Converte um número decimal em octal
|
||||
DELTA = DELTA ## Testa se dois valores são iguais
|
||||
ERF = FUNCERRO ## Devolve a função de erro
|
||||
ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar
|
||||
GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
|
||||
HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
|
||||
HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
|
||||
HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
|
||||
IMABS = IMABS ## Devolve o valor absoluto (módulo) de um número complexo
|
||||
IMAGINARY = IMAGINÁRIO ## Devolve o coeficiente imaginário de um número complexo
|
||||
IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos
|
||||
IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo
|
||||
IMCOS = IMCOS ## Devolve o co-seno de um número complexo
|
||||
IMDIV = IMDIV ## Devolve o quociente de dois números complexos
|
||||
IMEXP = IMEXP ## Devolve o exponencial de um número complexo
|
||||
IMLN = IMLN ## Devolve o logaritmo natural de um número complexo
|
||||
IMLOG10 = IMLOG10 ## Devolve o logaritmo de base 10 de um número complexo
|
||||
IMLOG2 = IMLOG2 ## Devolve o logaritmo de base 2 de um número complexo
|
||||
IMPOWER = IMPOT ## Devolve um número complexo elevado a uma potência inteira
|
||||
IMPRODUCT = IMPROD ## Devolve o produto de números complexos
|
||||
IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo
|
||||
IMSIN = IMSENO ## Devolve o seno de um número complexo
|
||||
IMSQRT = IMRAIZ ## Devolve a raiz quadrada de um número complexo
|
||||
IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos
|
||||
IMSUM = IMSOMA ## Devolve a soma de números complexos
|
||||
OCT2BIN = OCTABIN ## Converte um número octal em binário
|
||||
OCT2DEC = OCTADEC ## Converte um número octal em decimal
|
||||
OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Funções financeiras
|
||||
##
|
||||
ACCRINT = JUROSACUM ## Devolve os juros acumulados de um título que paga juros periódicos
|
||||
ACCRINTM = JUROSACUMV ## Devolve os juros acumulados de um título que paga juros no vencimento
|
||||
AMORDEGRC = AMORDEGRC ## Devolve a depreciação correspondente a cada período contabilístico utilizando um coeficiente de depreciação
|
||||
AMORLINC = AMORLINC ## Devolve a depreciação correspondente a cada período contabilístico
|
||||
COUPDAYBS = CUPDIASINLIQ ## Devolve o número de dias entre o início do período do cupão e a data de regularização
|
||||
COUPDAYS = CUPDIAS ## Devolve o número de dias no período do cupão que contém a data de regularização
|
||||
COUPDAYSNC = CUPDIASPRÓX ## Devolve o número de dias entre a data de regularização e a data do cupão seguinte
|
||||
COUPNCD = CUPDATAPRÓX ## Devolve a data do cupão seguinte após a data de regularização
|
||||
COUPNUM = CUPNÚM ## Devolve o número de cupões a serem pagos entre a data de regularização e a data de vencimento
|
||||
COUPPCD = CUPDATAANT ## Devolve a data do cupão anterior antes da data de regularização
|
||||
CUMIPMT = PGTOJURACUM ## Devolve os juros cumulativos pagos entre dois períodos
|
||||
CUMPRINC = PGTOCAPACUM ## Devolve o capital cumulativo pago a título de empréstimo entre dois períodos
|
||||
DB = BD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas fixas
|
||||
DDB = BDD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas duplas ou qualquer outro método especificado
|
||||
DISC = DESC ## Devolve a taxa de desconto de um título
|
||||
DOLLARDE = MOEDADEC ## Converte um preço em unidade monetária, expresso como uma fracção, num preço em unidade monetária, expresso como um número decimal
|
||||
DOLLARFR = MOEDAFRA ## Converte um preço em unidade monetária, expresso como um número decimal, num preço em unidade monetária, expresso como uma fracção
|
||||
DURATION = DURAÇÃO ## Devolve a duração anual de um título com pagamentos de juros periódicos
|
||||
EFFECT = EFECTIVA ## Devolve a taxa de juros anual efectiva
|
||||
FV = VF ## Devolve o valor futuro de um investimento
|
||||
FVSCHEDULE = VFPLANO ## Devolve o valor futuro de um capital inicial após a aplicação de uma série de taxas de juro compostas
|
||||
INTRATE = TAXAJUROS ## Devolve a taxa de juros de um título investido na totalidade
|
||||
IPMT = IPGTO ## Devolve o pagamento dos juros de um investimento durante um determinado período
|
||||
IRR = TIR ## Devolve a taxa de rentabilidade interna para uma série de fluxos monetários
|
||||
ISPMT = É.PGTO ## Calcula os juros pagos durante um período específico de um investimento
|
||||
MDURATION = MDURAÇÃO ## Devolve a duração modificada de Macauley de um título com um valor de paridade equivalente a € 100
|
||||
MIRR = MTIR ## Devolve a taxa interna de rentabilidade em que os fluxos monetários positivos e negativos são financiados com taxas diferentes
|
||||
NOMINAL = NOMINAL ## Devolve a taxa de juros nominal anual
|
||||
NPER = NPER ## Devolve o número de períodos de um investimento
|
||||
NPV = VAL ## Devolve o valor actual líquido de um investimento com base numa série de fluxos monetários periódicos e numa taxa de desconto
|
||||
ODDFPRICE = PREÇOPRIMINC ## Devolve o preço por € 100 do valor nominal de um título com um período inicial incompleto
|
||||
ODDFYIELD = LUCROPRIMINC ## Devolve o lucro de um título com um período inicial incompleto
|
||||
ODDLPRICE = PREÇOÚLTINC ## Devolve o preço por € 100 do valor nominal de um título com um período final incompleto
|
||||
ODDLYIELD = LUCROÚLTINC ## Devolve o lucro de um título com um período final incompleto
|
||||
PMT = PGTO ## Devolve o pagamento periódico de uma anuidade
|
||||
PPMT = PPGTO ## Devolve o pagamento sobre o capital de um investimento num determinado período
|
||||
PRICE = PREÇO ## Devolve o preço por € 100 do valor nominal de um título que paga juros periódicos
|
||||
PRICEDISC = PREÇODESC ## Devolve o preço por € 100 do valor nominal de um título descontado
|
||||
PRICEMAT = PREÇOVENC ## Devolve o preço por € 100 do valor nominal de um título que paga juros no vencimento
|
||||
PV = VA ## Devolve o valor actual de um investimento
|
||||
RATE = TAXA ## Devolve a taxa de juros por período de uma anuidade
|
||||
RECEIVED = RECEBER ## Devolve o montante recebido no vencimento de um título investido na totalidade
|
||||
SLN = AMORT ## Devolve uma depreciação linear de um activo durante um período
|
||||
SYD = AMORTD ## Devolve a depreciação por algarismos da soma dos anos de um activo durante um período especificado
|
||||
TBILLEQ = OTN ## Devolve o lucro de um título equivalente a uma Obrigação do Tesouro
|
||||
TBILLPRICE = OTNVALOR ## Devolve o preço por € 100 de valor nominal de uma Obrigação do Tesouro
|
||||
TBILLYIELD = OTNLUCRO ## Devolve o lucro de uma Obrigação do Tesouro
|
||||
VDB = BDV ## Devolve a depreciação de um activo relativo a um período específico ou parcial utilizando um método de quotas degressivas
|
||||
XIRR = XTIR ## Devolve a taxa interna de rentabilidade de um plano de fluxos monetários que não seja necessariamente periódica
|
||||
XNPV = XVAL ## Devolve o valor actual líquido de um plano de fluxos monetários que não seja necessariamente periódico
|
||||
YIELD = LUCRO ## Devolve o lucro de um título que paga juros periódicos
|
||||
YIELDDISC = LUCRODESC ## Devolve o lucro anual de um título emitido abaixo do valor nominal, por exemplo, uma Obrigação do Tesouro
|
||||
YIELDMAT = LUCROVENC ## Devolve o lucro anual de um título que paga juros na data de vencimento
|
||||
|
||||
|
||||
##
|
||||
## Information functions Funções de informação
|
||||
##
|
||||
CELL = CÉL ## Devolve informações sobre a formatação, localização ou conteúdo de uma célula
|
||||
ERROR.TYPE = TIPO.ERRO ## Devolve um número correspondente a um tipo de erro
|
||||
INFO = INFORMAÇÃO ## Devolve informações sobre o ambiente de funcionamento actual
|
||||
ISBLANK = É.CÉL.VAZIA ## Devolve VERDADEIRO se o valor estiver em branco
|
||||
ISERR = É.ERROS ## Devolve VERDADEIRO se o valor for um valor de erro diferente de #N/D
|
||||
ISERROR = É.ERRO ## Devolve VERDADEIRO se o valor for um valor de erro
|
||||
ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par
|
||||
ISLOGICAL = É.LÓGICO ## Devolve VERDADEIRO se o valor for lógico
|
||||
ISNA = É.NÃO.DISP ## Devolve VERDADEIRO se o valor for o valor de erro #N/D
|
||||
ISNONTEXT = É.NÃO.TEXTO ## Devolve VERDADEIRO se o valor não for texto
|
||||
ISNUMBER = É.NÚM ## Devolve VERDADEIRO se o valor for um número
|
||||
ISODD = ÉÍMPAR ## Devolve VERDADEIRO se o número for ímpar
|
||||
ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência
|
||||
ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto
|
||||
N = N ## Devolve um valor convertido num número
|
||||
NA = NÃO.DISP ## Devolve o valor de erro #N/D
|
||||
TYPE = TIPO ## Devolve um número que indica o tipo de dados de um valor
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Funções lógicas
|
||||
##
|
||||
AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO
|
||||
FALSE = FALSO ## Devolve o valor lógico FALSO
|
||||
IF = SE ## Especifica um teste lógico a ser executado
|
||||
IFERROR = SE.ERRO ## Devolve um valor definido pelo utilizador se ocorrer um erro na fórmula, e devolve o resultado da fórmula se não ocorrer nenhum erro
|
||||
NOT = NÃO ## Inverte a lógica do respectivo argumento
|
||||
OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO
|
||||
TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Funções de pesquisa e referência
|
||||
##
|
||||
ADDRESS = ENDEREÇO ## Devolve uma referência a uma única célula numa folha de cálculo como texto
|
||||
AREAS = ÁREAS ## Devolve o número de áreas numa referência
|
||||
CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores
|
||||
COLUMN = COL ## Devolve o número da coluna de uma referência
|
||||
COLUMNS = COLS ## Devolve o número de colunas numa referência
|
||||
HLOOKUP = PROCH ## Procura na linha superior de uma matriz e devolve o valor da célula indicada
|
||||
HYPERLINK = HIPERLIGAÇÃO ## Cria um atalho ou hiperligação que abre um documento armazenado num servidor de rede, numa intranet ou na Internet
|
||||
INDEX = ÍNDICE ## Utiliza um índice para escolher um valor de uma referência ou de uma matriz
|
||||
INDIRECT = INDIRECTO ## Devolve uma referência indicada por um valor de texto
|
||||
LOOKUP = PROC ## Procura valores num vector ou numa matriz
|
||||
MATCH = CORRESP ## Procura valores numa referência ou numa matriz
|
||||
OFFSET = DESLOCAMENTO ## Devolve o deslocamento de referência de uma determinada referência
|
||||
ROW = LIN ## Devolve o número da linha de uma referência
|
||||
ROWS = LINS ## Devolve o número de linhas numa referência
|
||||
RTD = RTD ## Obtém dados em tempo real a partir de um programa que suporte automatização COM (automatização: modo de trabalhar com objectos de uma aplicação a partir de outra aplicação ou ferramenta de desenvolvimento. Anteriormente conhecida como automatização OLE, a automatização é uma norma da indústria de software e uma funcionalidade COM (Component Object Model).)
|
||||
TRANSPOSE = TRANSPOR ## Devolve a transposição de uma matriz
|
||||
VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e percorre a linha para devolver o valor de uma célula
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Funções matemáticas e trigonométricas
|
||||
##
|
||||
ABS = ABS ## Devolve o valor absoluto de um número
|
||||
ACOS = ACOS ## Devolve o arco de co-seno de um número
|
||||
ACOSH = ACOSH ## Devolve o co-seno hiperbólico inverso de um número
|
||||
ASIN = ASEN ## Devolve o arco de seno de um número
|
||||
ASINH = ASENH ## Devolve o seno hiperbólico inverso de um número
|
||||
ATAN = ATAN ## Devolve o arco de tangente de um número
|
||||
ATAN2 = ATAN2 ## Devolve o arco de tangente das coordenadas x e y
|
||||
ATANH = ATANH ## Devolve a tangente hiperbólica inversa de um número
|
||||
CEILING = ARRED.EXCESSO ## Arredonda um número para o número inteiro mais próximo ou para o múltiplo de significância mais próximo
|
||||
COMBIN = COMBIN ## Devolve o número de combinações de um determinado número de objectos
|
||||
COS = COS ## Devolve o co-seno de um número
|
||||
COSH = COSH ## Devolve o co-seno hiperbólico de um número
|
||||
DEGREES = GRAUS ## Converte radianos em graus
|
||||
EVEN = PAR ## Arredonda um número por excesso para o número inteiro mais próximo
|
||||
EXP = EXP ## Devolve e elevado à potência de um determinado número
|
||||
FACT = FACTORIAL ## Devolve o factorial de um número
|
||||
FACTDOUBLE = FACTDUPLO ## Devolve o factorial duplo de um número
|
||||
FLOOR = ARRED.DEFEITO ## Arredonda um número por defeito até zero
|
||||
GCD = MDC ## Devolve o maior divisor comum
|
||||
INT = INT ## Arredonda um número por defeito para o número inteiro mais próximo
|
||||
LCM = MMC ## Devolve o mínimo múltiplo comum
|
||||
LN = LN ## Devolve o logaritmo natural de um número
|
||||
LOG = LOG ## Devolve o logaritmo de um número com uma base especificada
|
||||
LOG10 = LOG10 ## Devolve o logaritmo de base 10 de um número
|
||||
MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz
|
||||
MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz
|
||||
MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes
|
||||
MOD = RESTO ## Devolve o resto da divisão
|
||||
MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido
|
||||
MULTINOMIAL = POLINOMIAL ## Devolve o polinomial de um conjunto de números
|
||||
ODD = ÍMPAR ## Arredonda por excesso um número para o número inteiro ímpar mais próximo
|
||||
PI = PI ## Devolve o valor de pi
|
||||
POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência
|
||||
PRODUCT = PRODUTO ## Multiplica os respectivos argumentos
|
||||
QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão
|
||||
RADIANS = RADIANOS ## Converte graus em radianos
|
||||
RAND = ALEATÓRIO ## Devolve um número aleatório entre 0 e 1
|
||||
RANDBETWEEN = ALEATÓRIOENTRE ## Devolve um número aleatório entre os números especificados
|
||||
ROMAN = ROMANO ## Converte um número árabe em romano, como texto
|
||||
ROUND = ARRED ## Arredonda um número para um número de dígitos especificado
|
||||
ROUNDDOWN = ARRED.PARA.BAIXO ## Arredonda um número por defeito até zero
|
||||
ROUNDUP = ARRED.PARA.CIMA ## Arredonda um número por excesso, afastando-o de zero
|
||||
SERIESSUM = SOMASÉRIE ## Devolve a soma de uma série de potências baseada na fórmula
|
||||
SIGN = SINAL ## Devolve o sinal de um número
|
||||
SIN = SEN ## Devolve o seno de um determinado ângulo
|
||||
SINH = SENH ## Devolve o seno hiperbólico de um número
|
||||
SQRT = RAIZQ ## Devolve uma raiz quadrada positiva
|
||||
SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi)
|
||||
SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados
|
||||
SUM = SOMA ## Adiciona os respectivos argumentos
|
||||
SUMIF = SOMA.SE ## Adiciona as células especificadas por um determinado critério
|
||||
SUMIFS = SOMA.SE.S ## Adiciona as células num intervalo que cumpre vários critérios
|
||||
SUMPRODUCT = SOMARPRODUTO ## Devolve a soma dos produtos de componentes de matrizes correspondentes
|
||||
SUMSQ = SOMARQUAD ## Devolve a soma dos quadrados dos argumentos
|
||||
SUMX2MY2 = SOMAX2DY2 ## Devolve a soma da diferença dos quadrados dos valores correspondentes em duas matrizes
|
||||
SUMX2PY2 = SOMAX2SY2 ## Devolve a soma da soma dos quadrados dos valores correspondentes em duas matrizes
|
||||
SUMXMY2 = SOMAXMY2 ## Devolve a soma dos quadrados da diferença dos valores correspondentes em duas matrizes
|
||||
TAN = TAN ## Devolve a tangente de um número
|
||||
TANH = TANH ## Devolve a tangente hiperbólica de um número
|
||||
TRUNC = TRUNCAR ## Trunca um número para um número inteiro
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Funções estatísticas
|
||||
##
|
||||
AVEDEV = DESV.MÉDIO ## Devolve a média aritmética dos desvios absolutos à média dos pontos de dados
|
||||
AVERAGE = MÉDIA ## Devolve a média dos respectivos argumentos
|
||||
AVERAGEA = MÉDIAA ## Devolve uma média dos respectivos argumentos, incluindo números, texto e valores lógicos
|
||||
AVERAGEIF = MÉDIA.SE ## Devolve a média aritmética de todas as células num intervalo que cumprem determinado critério
|
||||
AVERAGEIFS = MÉDIA.SE.S ## Devolve a média aritmética de todas as células que cumprem múltiplos critérios
|
||||
BETADIST = DISTBETA ## Devolve a função de distribuição cumulativa beta
|
||||
BETAINV = BETA.ACUM.INV ## Devolve o inverso da função de distribuição cumulativa relativamente a uma distribuição beta específica
|
||||
BINOMDIST = DISTRBINOM ## Devolve a probabilidade de distribuição binomial de termo individual
|
||||
CHIDIST = DIST.CHI ## Devolve a probabilidade unicaudal da distribuição qui-quadrada
|
||||
CHIINV = INV.CHI ## Devolve o inverso da probabilidade unicaudal da distribuição qui-quadrada
|
||||
CHITEST = TESTE.CHI ## Devolve o teste para independência
|
||||
CONFIDENCE = INT.CONFIANÇA ## Devolve o intervalo de confiança correspondente a uma média de população
|
||||
CORREL = CORREL ## Devolve o coeficiente de correlação entre dois conjuntos de dados
|
||||
COUNT = CONTAR ## Conta os números que existem na lista de argumentos
|
||||
COUNTA = CONTAR.VAL ## Conta os valores que existem na lista de argumentos
|
||||
COUNTBLANK = CONTAR.VAZIO ## Conta o número de células em branco num intervalo
|
||||
COUNTIF = CONTAR.SE ## Calcula o número de células num intervalo que corresponde aos critérios determinados
|
||||
COUNTIFS = CONTAR.SE.S ## Conta o número de células num intervalo que cumprem múltiplos critérios
|
||||
COVAR = COVAR ## Devolve a covariância, que é a média dos produtos de desvios de pares
|
||||
CRITBINOM = CRIT.BINOM ## Devolve o menor valor em que a distribuição binomial cumulativa é inferior ou igual a um valor de critério
|
||||
DEVSQ = DESVQ ## Devolve a soma dos quadrados dos desvios
|
||||
EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial
|
||||
FDIST = DISTF ## Devolve a distribuição da probabilidade F
|
||||
FINV = INVF ## Devolve o inverso da distribuição da probabilidade F
|
||||
FISHER = FISHER ## Devolve a transformação Fisher
|
||||
FISHERINV = FISHERINV ## Devolve o inverso da transformação Fisher
|
||||
FORECAST = PREVISÃO ## Devolve um valor ao longo de uma tendência linear
|
||||
FREQUENCY = FREQUÊNCIA ## Devolve uma distribuição de frequência como uma matriz vertical
|
||||
FTEST = TESTEF ## Devolve o resultado de um teste F
|
||||
GAMMADIST = DISTGAMA ## Devolve a distribuição gama
|
||||
GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa
|
||||
GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x)
|
||||
GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica
|
||||
GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial
|
||||
HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica
|
||||
HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica
|
||||
INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear
|
||||
KURT = CURT ## Devolve a curtose de um conjunto de dados
|
||||
LARGE = MAIOR ## Devolve o maior valor k-ésimo de um conjunto de dados
|
||||
LINEST = PROJ.LIN ## Devolve os parâmetros de uma tendência linear
|
||||
LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial
|
||||
LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica
|
||||
LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa
|
||||
MAX = MÁXIMO ## Devolve o valor máximo numa lista de argumentos
|
||||
MAXA = MÁXIMOA ## Devolve o valor máximo numa lista de argumentos, incluindo números, texto e valores lógicos
|
||||
MEDIAN = MED ## Devolve a mediana dos números indicados
|
||||
MIN = MÍNIMO ## Devolve o valor mínimo numa lista de argumentos
|
||||
MINA = MÍNIMOA ## Devolve o valor mínimo numa lista de argumentos, incluindo números, texto e valores lógicos
|
||||
MODE = MODA ## Devolve o valor mais comum num conjunto de dados
|
||||
NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa
|
||||
NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal
|
||||
NORMINV = INV.NORM ## Devolve o inverso da distribuição cumulativa normal
|
||||
NORMSDIST = DIST.NORMP ## Devolve a distribuição cumulativa normal padrão
|
||||
NORMSINV = INV.NORMP ## Devolve o inverso da distribuição cumulativa normal padrão
|
||||
PEARSON = PEARSON ## Devolve o coeficiente de correlação momento/produto de Pearson
|
||||
PERCENTILE = PERCENTIL ## Devolve o k-ésimo percentil de valores num intervalo
|
||||
PERCENTRANK = ORDEM.PERCENTUAL ## Devolve a ordem percentual de um valor num conjunto de dados
|
||||
PERMUT = PERMUTAR ## Devolve o número de permutações de um determinado número de objectos
|
||||
POISSON = POISSON ## Devolve a distribuição de Poisson
|
||||
PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites
|
||||
QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados
|
||||
RANK = ORDEM ## Devolve a ordem de um número numa lista numérica
|
||||
RSQ = RQUAD ## Devolve o quadrado do coeficiente de correlação momento/produto de Pearson
|
||||
SKEW = DISTORÇÃO ## Devolve a distorção de uma distribuição
|
||||
SLOPE = DECLIVE ## Devolve o declive da linha de regressão linear
|
||||
SMALL = MENOR ## Devolve o menor valor de k-ésimo de um conjunto de dados
|
||||
STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado
|
||||
STDEV = DESVPAD ## Calcula o desvio-padrão com base numa amostra
|
||||
STDEVA = DESVPADA ## Calcula o desvio-padrão com base numa amostra, incluindo números, texto e valores lógicos
|
||||
STDEVP = DESVPADP ## Calcula o desvio-padrão com base na população total
|
||||
STDEVPA = DESVPADPA ## Calcula o desvio-padrão com base na população total, incluindo números, texto e valores lógicos
|
||||
STEYX = EPADYX ## Devolve o erro-padrão do valor de y previsto para cada x na regressão
|
||||
TDIST = DISTT ## Devolve a distribuição t de Student
|
||||
TINV = INVT ## Devolve o inverso da distribuição t de Student
|
||||
TREND = TENDÊNCIA ## Devolve valores ao longo de uma tendência linear
|
||||
TRIMMEAN = MÉDIA.INTERNA ## Devolve a média do interior de um conjunto de dados
|
||||
TTEST = TESTET ## Devolve a probabilidade associada ao teste t de Student
|
||||
VAR = VAR ## Calcula a variância com base numa amostra
|
||||
VARA = VARA ## Calcula a variância com base numa amostra, incluindo números, texto e valores lógicos
|
||||
VARP = VARP ## Calcula a variância com base na população total
|
||||
VARPA = VARPA ## Calcula a variância com base na população total, incluindo números, texto e valores lógicos
|
||||
WEIBULL = WEIBULL ## Devolve a distribuição Weibull
|
||||
ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z
|
||||
|
||||
|
||||
##
|
||||
## Text functions Funções de texto
|
||||
##
|
||||
ASC = ASC ## Altera letras ou katakana de largura total (byte duplo) numa cadeia de caracteres para caracteres de largura média (byte único)
|
||||
BAHTTEXT = TEXTO.BAHT ## Converte um número em texto, utilizando o formato monetário ß (baht)
|
||||
CHAR = CARÁCT ## Devolve o carácter especificado pelo número de código
|
||||
CLEAN = LIMPAR ## Remove do texto todos os caracteres não imprimíveis
|
||||
CODE = CÓDIGO ## Devolve um código numérico correspondente ao primeiro carácter numa cadeia de texto
|
||||
CONCATENATE = CONCATENAR ## Agrupa vários itens de texto num único item de texto
|
||||
DOLLAR = MOEDA ## Converte um número em texto, utilizando o formato monetário € (Euro)
|
||||
EXACT = EXACTO ## Verifica se dois valores de texto são idênticos
|
||||
FIND = LOCALIZAR ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas)
|
||||
FINDB = LOCALIZARB ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas)
|
||||
FIXED = FIXA ## Formata um número como texto com um número fixo de decimais
|
||||
JIS = JIS ## Altera letras ou katakana de largura média (byte único) numa cadeia de caracteres para caracteres de largura total (byte duplo)
|
||||
LEFT = ESQUERDA ## Devolve os caracteres mais à esquerda de um valor de texto
|
||||
LEFTB = ESQUERDAB ## Devolve os caracteres mais à esquerda de um valor de texto
|
||||
LEN = NÚM.CARACT ## Devolve o número de caracteres de uma cadeia de texto
|
||||
LENB = NÚM.CARACTB ## Devolve o número de caracteres de uma cadeia de texto
|
||||
LOWER = MINÚSCULAS ## Converte o texto em minúsculas
|
||||
MID = SEG.TEXTO ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada
|
||||
MIDB = SEG.TEXTOB ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada
|
||||
PHONETIC = FONÉTICA ## Retira os caracteres fonéticos (furigana) de uma cadeia de texto
|
||||
PROPER = INICIAL.MAIÚSCULA ## Coloca em maiúsculas a primeira letra de cada palavra de um valor de texto
|
||||
REPLACE = SUBSTITUIR ## Substitui caracteres no texto
|
||||
REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto
|
||||
REPT = REPETIR ## Repete texto um determinado número de vezes
|
||||
RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto
|
||||
RIGHTB = DIREITAB ## Devolve os caracteres mais à direita de um valor de texto
|
||||
SEARCH = PROCURAR ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas)
|
||||
SEARCHB = PROCURARB ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas)
|
||||
SUBSTITUTE = SUBST ## Substitui texto novo por texto antigo numa cadeia de texto
|
||||
T = T ## Converte os respectivos argumentos em texto
|
||||
TEXT = TEXTO ## Formata um número e converte-o em texto
|
||||
TRIM = COMPACTAR ## Remove espaços do texto
|
||||
UPPER = MAIÚSCULAS ## Converte texto em maiúsculas
|
||||
VALUE = VALOR ## Converte um argumento de texto num número
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = kr
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #Skärning!
|
||||
DIV0 = #Division/0!
|
||||
VALUE = #Värdefel!
|
||||
REF = #Referens!
|
||||
NAME = #Namn?
|
||||
NUM = #Ogiltigt!
|
||||
NA = #Saknas!
|
@ -1,408 +0,0 @@
|
||||
##
|
||||
## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner
|
||||
##
|
||||
GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport
|
||||
|
||||
|
||||
##
|
||||
## Cube functions Kubfunktioner
|
||||
##
|
||||
CUBEKPIMEMBER = KUBKPIMEDLEM ## Returnerar namn, egenskap och mått för en KPI och visar namnet och egenskapen i cellen. En KPI, eller prestandaindikator, är ett kvantifierbart mått, t.ex. månatlig bruttovinst eller personalomsättning per kvartal, som används för att analysera ett företags resultat.
|
||||
CUBEMEMBER = KUBMEDLEM ## Returnerar en medlem eller ett par i en kubhierarki. Används för att verifiera att medlemmen eller paret finns i kuben.
|
||||
CUBEMEMBERPROPERTY = KUBMEDLEMSEGENSKAP ## Returnerar värdet för en medlemsegenskap i kuben. Används för att verifiera att ett medlemsnamn finns i kuben, samt för att returnera den angivna egenskapen för medlemmen.
|
||||
CUBERANKEDMEMBER = KUBRANGORDNADMEDLEM ## Returnerar den n:te, eller rangordnade, medlemmen i en uppsättning. Används för att returnera ett eller flera element i en uppsättning, till exempelvis den bästa försäljaren eller de tio bästa eleverna.
|
||||
CUBESET = KUBINSTÄLLNING ## Definierar en beräknad uppsättning medlemmar eller par genom att skicka ett bestämt uttryck till kuben på servern, som skapar uppsättningen och sedan returnerar den till Microsoft Office Excel.
|
||||
CUBESETCOUNT = KUBINSTÄLLNINGANTAL ## Returnerar antalet objekt i en uppsättning.
|
||||
CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde från en kub.
|
||||
|
||||
|
||||
##
|
||||
## Database functions Databasfunktioner
|
||||
##
|
||||
DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna
|
||||
DCOUNT = DANTAL ## Räknar antalet celler som innehåller tal i en databas
|
||||
DCOUNTA = DANTALV ## Räknar ifyllda celler i en databas
|
||||
DGET = DHÄMTA ## Hämtar en enstaka post från en databas som uppfyller de angivna villkoren
|
||||
DMAX = DMAX ## Returnerar det största värdet från databasposterna
|
||||
DMIN = DMIN ## Returnerar det minsta värdet från databasposterna
|
||||
DPRODUCT = DPRODUKT ## Multiplicerar värdena i ett visst fält i poster som uppfyller villkoret
|
||||
DSTDEV = DSTDAV ## Uppskattar standardavvikelsen baserat på ett urval av databasposterna
|
||||
DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrån hela populationen av valda databasposter
|
||||
DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret
|
||||
DVAR = DVARIANS ## Uppskattar variansen baserat på ett urval av databasposterna
|
||||
DVARP = DVARIANSP ## Beräknar variansen utifrån hela populationen av valda databasposter
|
||||
|
||||
|
||||
##
|
||||
## Date and time functions Tid- och datumfunktioner
|
||||
##
|
||||
DATE = DATUM ## Returnerar ett serienummer för ett visst datum
|
||||
DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer
|
||||
DAY = DAG ## Konverterar ett serienummer till dag i månaden
|
||||
DAYS360 = DAGAR360 ## Beräknar antalet dagar mellan två datum baserat på ett 360-dagarsår
|
||||
EDATE = EDATUM ## Returnerar serienumret för ett datum som infaller ett visst antal månader före eller efter startdatumet
|
||||
EOMONTH = SLUTMÅNAD ## Returnerar serienumret för sista dagen i månaden ett visst antal månader tidigare eller senare
|
||||
HOUR = TIMME ## Konverterar ett serienummer till en timme
|
||||
MINUTE = MINUT ## Konverterar ett serienummer till en minut
|
||||
MONTH = MÅNAD ## Konverterar ett serienummer till en månad
|
||||
NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan två datum
|
||||
NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid
|
||||
SECOND = SEKUND ## Konverterar ett serienummer till en sekund
|
||||
TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid
|
||||
TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer
|
||||
TODAY = IDAG ## Returnerar serienumret för dagens datum
|
||||
WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan
|
||||
WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer
|
||||
WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare
|
||||
YEAR = ÅR ## Konverterar ett serienummer till ett år
|
||||
YEARFRAC = ÅRDEL ## Returnerar en del av ett år som representerar antalet hela dagar mellan start- och slutdatum
|
||||
|
||||
|
||||
##
|
||||
## Engineering functions Tekniska funktioner
|
||||
##
|
||||
BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x)
|
||||
BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x)
|
||||
BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x)
|
||||
BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x)
|
||||
BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt
|
||||
BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt
|
||||
BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt
|
||||
COMPLEX = KOMPLEX ## Omvandlar reella och imaginära koefficienter till ett komplext tal
|
||||
CONVERT = KONVERTERA ## Omvandlar ett tal från ett måttsystem till ett annat
|
||||
DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt
|
||||
DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt
|
||||
DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt
|
||||
DELTA = DELTA ## Testar om två värden är lika
|
||||
ERF = FELF ## Returnerar felfunktionen
|
||||
ERFC = FELFK ## Returnerar den komplementära felfunktionen
|
||||
GESTEP = SLSTEG ## Testar om ett tal är större än ett tröskelvärde
|
||||
HEX2BIN = HEX.TILL.BIN ## Omvandlar ett hexadecimalt tal till binärt
|
||||
HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt
|
||||
HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt
|
||||
IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal
|
||||
IMAGINARY = IMAGINÄR ## Returnerar den imaginära koefficienten för ett komplext tal
|
||||
IMARGUMENT = IMARGUMENT ## Returnerar det komplexa talets argument, en vinkel uttryckt i radianer
|
||||
IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat
|
||||
IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal
|
||||
IMDIV = IMDIV ## Returnerar kvoten för två komplexa tal
|
||||
IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal
|
||||
IMLN = IMLN ## Returnerar den naturliga logaritmen för ett komplext tal
|
||||
IMLOG10 = IMLOG10 ## Returnerar 10-logaritmen för ett komplext tal
|
||||
IMLOG2 = IMLOG2 ## Returnerar 2-logaritmen för ett komplext tal
|
||||
IMPOWER = IMUPPHÖJT ## Returnerar ett komplext tal upphöjt till en exponent
|
||||
IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal
|
||||
IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal
|
||||
IMSIN = IMSIN ## Returnerar sinus för ett komplext tal
|
||||
IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal
|
||||
IMSUB = IMDIFF ## Returnerar differensen mellan två komplexa tal
|
||||
IMSUM = IMSUM ## Returnerar summan av komplexa tal
|
||||
OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt
|
||||
OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt
|
||||
OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt
|
||||
|
||||
|
||||
##
|
||||
## Financial functions Finansiella funktioner
|
||||
##
|
||||
ACCRINT = UPPLRÄNTA ## Returnerar den upplupna räntan för värdepapper med periodisk ränta
|
||||
ACCRINTM = UPPLOBLRÄNTA ## Returnerar den upplupna räntan för ett värdepapper som ger avkastning på förfallodagen
|
||||
AMORDEGRC = AMORDEGRC ## Returnerar avskrivningen för varje redovisningsperiod med hjälp av en avskrivningskoefficient
|
||||
AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod
|
||||
COUPDAYBS = KUPDAGBB ## Returnerar antal dagar från början av kupongperioden till likviddagen
|
||||
COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehåller betalningsdatumet
|
||||
COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar från betalningsdatumet till nästa kupongdatum
|
||||
COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen
|
||||
COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen
|
||||
COUPPCD = KUPFKD ## Returnerar föregående kupongdatum före likviddagen
|
||||
CUMIPMT = KUMRÄNTA ## Returnerar den ackumulerade räntan som betalats mellan två perioder
|
||||
CUMPRINC = KUMPRIS ## Returnerar det ackumulerade kapitalbeloppet som betalats på ett lån mellan två perioder
|
||||
DB = DB ## Returnerar avskrivningen för en tillgång under en angiven tid enligt metoden för fast degressiv avskrivning
|
||||
DDB = DEGAVSKR ## Returnerar en tillgångs värdeminskning under en viss period med hjälp av dubbel degressiv avskrivning eller någon annan metod som du anger
|
||||
DISC = DISK ## Returnerar diskonteringsräntan för ett värdepapper
|
||||
DOLLARDE = DECTAL ## Omvandlar ett pris uttryckt som ett bråk till ett decimaltal
|
||||
DOLLARFR = BRÅK ## Omvandlar ett pris i kronor uttryckt som ett decimaltal till ett bråk
|
||||
DURATION = LÖPTID ## Returnerar den årliga löptiden för en säkerhet med periodiska räntebetalningar
|
||||
EFFECT = EFFRÄNTA ## Returnerar den årliga effektiva räntesatsen
|
||||
FV = SLUTVÄRDE ## Returnerar det framtida värdet på en investering
|
||||
FVSCHEDULE = FÖRRÄNTNING ## Returnerar det framtida värdet av ett begynnelsekapital beräknat på olika räntenivåer
|
||||
INTRATE = ÅRSRÄNTA ## Returnerar räntesatsen för ett betalt värdepapper
|
||||
IPMT = RBETALNING ## Returnerar räntedelen av en betalning för en given period
|
||||
IRR = IR ## Returnerar internräntan för en serie betalningar
|
||||
ISPMT = RALÅN ## Beräknar räntan som har betalats under en specifik betalningsperiod
|
||||
MDURATION = MLÖPTID ## Returnerar den modifierade Macauley-löptiden för ett värdepapper med det antagna nominella värdet 100 kr
|
||||
MIRR = MODIR ## Returnerar internräntan där positiva och negativa betalningar finansieras med olika räntor
|
||||
NOMINAL = NOMRÄNTA ## Returnerar den årliga nominella räntesatsen
|
||||
NPER = PERIODER ## Returnerar antalet perioder för en investering
|
||||
NPV = NETNUVÄRDE ## Returnerar nuvärdet av en serie periodiska betalningar vid en given diskonteringsränta
|
||||
ODDFPRICE = UDDAFPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda första period
|
||||
ODDFYIELD = UDDAFAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda första period
|
||||
ODDLPRICE = UDDASPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda sista period
|
||||
ODDLYIELD = UDDASAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda sista period
|
||||
PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet
|
||||
PPMT = AMORT ## Returnerar amorteringsdelen av en annuitetsbetalning för en given period
|
||||
PRICE = PRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger periodisk ränta
|
||||
PRICEDISC = PRISDISK ## Returnerar priset per 100 kr nominellt värde för ett diskonterat värdepapper
|
||||
PRICEMAT = PRISFÖRF ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger ränta på förfallodagen
|
||||
PV = PV ## Returnerar nuvärdet av en serie lika stora periodiska betalningar
|
||||
RATE = RÄNTA ## Returnerar räntesatsen per period i en annuitet
|
||||
RECEIVED = BELOPP ## Returnerar beloppet som utdelas på förfallodagen för ett betalat värdepapper
|
||||
SLN = LINAVSKR ## Returnerar den linjära avskrivningen för en tillgång under en period
|
||||
SYD = ÅRSAVSKR ## Returnerar den årliga avskrivningssumman för en tillgång under en angiven period
|
||||
TBILLEQ = SSVXEKV ## Returnerar avkastningen motsvarande en obligation för en statsskuldväxel
|
||||
TBILLPRICE = SSVXPRIS ## Returnerar priset per 100 kr nominellt värde för en statsskuldväxel
|
||||
TBILLYIELD = SSVXRÄNTA ## Returnerar avkastningen för en statsskuldväxel
|
||||
VDB = VDEGRAVSKR ## Returnerar avskrivningen för en tillgång under en angiven period (med degressiv avskrivning)
|
||||
XIRR = XIRR ## Returnerar internräntan för en serie betalningar som inte nödvändigtvis är periodiska
|
||||
XNPV = XNUVÄRDE ## Returnerar det nuvarande nettovärdet för en serie betalningar som inte nödvändigtvis är periodiska
|
||||
YIELD = NOMAVK ## Returnerar avkastningen för ett värdepapper som ger periodisk ränta
|
||||
YIELDDISC = NOMAVKDISK ## Returnerar den årliga avkastningen för diskonterade värdepapper, exempelvis en statsskuldväxel
|
||||
YIELDMAT = NOMAVKFÖRF ## Returnerar den årliga avkastningen för ett värdepapper som ger ränta på förfallodagen
|
||||
|
||||
|
||||
##
|
||||
## Information functions Informationsfunktioner
|
||||
##
|
||||
CELL = CELL ## Returnerar information om formatering, plats och innehåll i en cell
|
||||
ERROR.TYPE = FEL.TYP ## Returnerar ett tal som motsvarar ett felvärde
|
||||
INFO = INFO ## Returnerar information om operativsystemet
|
||||
ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt
|
||||
ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS!
|
||||
ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde
|
||||
ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt
|
||||
ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde
|
||||
ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS!
|
||||
ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text
|
||||
ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal
|
||||
ISODD = ÄRUDDA ## Returnerar SANT om talet är udda
|
||||
ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens
|
||||
ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text
|
||||
N = N ## Returnerar ett värde omvandlat till ett tal
|
||||
NA = SAKNAS ## Returnerar felvärdet #SAKNAS!
|
||||
TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp
|
||||
|
||||
|
||||
##
|
||||
## Logical functions Logiska funktioner
|
||||
##
|
||||
AND = OCH ## Returnerar SANT om alla argument är sanna
|
||||
FALSE = FALSKT ## Returnerar det logiska värdet FALSKT
|
||||
IF = OM ## Anger vilket logiskt test som ska utföras
|
||||
IFERROR = OMFEL ## Returnerar ett värde som du anger om en formel utvärderar till ett fel; annars returneras resultatet av formeln
|
||||
NOT = ICKE ## Inverterar logiken för argumenten
|
||||
OR = ELLER ## Returnerar SANT om något argument är SANT
|
||||
TRUE = SANT ## Returnerar det logiska värdet SANT
|
||||
|
||||
|
||||
##
|
||||
## Lookup and reference functions Sök- och referensfunktioner
|
||||
##
|
||||
ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad
|
||||
AREAS = OMRÅDEN ## Returnerar antalet områden i en referens
|
||||
CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden
|
||||
COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens
|
||||
COLUMNS = KOLUMNER ## Returnerar antalet kolumner i en referens
|
||||
HLOOKUP = LETAKOLUMN ## Söker i den översta raden i en matris och returnerar värdet för angiven cell
|
||||
HYPERLINK = HYPERLÄNK ## Skapar en genväg eller ett hopp till ett dokument i nätverket, i ett intranät eller på Internet
|
||||
INDEX = INDEX ## Använder ett index för ett välja ett värde i en referens eller matris
|
||||
INDIRECT = INDIREKT ## Returnerar en referens som anges av ett textvärde
|
||||
LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris
|
||||
MATCH = PASSA ## Letar upp värden i en referens eller matris
|
||||
OFFSET = FÖRSKJUTNING ## Returnerar en referens förskjuten i förhållande till en given referens
|
||||
ROW = RAD ## Returnerar radnumret för en referens
|
||||
ROWS = RADER ## Returnerar antalet rader i en referens
|
||||
RTD = RTD ## Hämtar realtidsdata från ett program som stöder COM-automation (Automation: Ett sätt att arbeta med ett programs objekt från ett annat program eller utvecklingsverktyg. Detta kallades tidigare för OLE Automation, och är en branschstandard och ingår i Component Object Model (COM).)
|
||||
TRANSPOSE = TRANSPONERA ## Transponerar en matris
|
||||
VLOOKUP = LETARAD ## Letar i den första kolumnen i en matris och flyttar över raden för att returnera värdet för en cell
|
||||
|
||||
|
||||
##
|
||||
## Math and trigonometry functions Matematiska och trigonometriska funktioner
|
||||
##
|
||||
ABS = ABS ## Returnerar absolutvärdet av ett tal
|
||||
ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal
|
||||
ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal
|
||||
ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal
|
||||
ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal
|
||||
ATAN = ARCTAN ## Returnerar arcus tangens för ett tal
|
||||
ATAN2 = ARCTAN2 ## Returnerar arcus tangens för en x- och en y- koordinat
|
||||
ATANH = ARCTANH ## Returnerar hyperbolisk arcus tangens för ett tal
|
||||
CEILING = RUNDA.UPP ## Avrundar ett tal till närmaste heltal eller närmaste signifikanta multipel
|
||||
COMBIN = KOMBIN ## Returnerar antalet kombinationer för ett givet antal objekt
|
||||
COS = COS ## Returnerar cosinus för ett tal
|
||||
COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal
|
||||
DEGREES = GRADER ## Omvandlar radianer till grader
|
||||
EVEN = JÄMN ## Avrundar ett tal uppåt till närmaste heltal
|
||||
EXP = EXP ## Returnerar e upphöjt till ett givet tal
|
||||
FACT = FAKULTET ## Returnerar fakulteten för ett tal
|
||||
FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal
|
||||
FLOOR = RUNDA.NED ## Avrundar ett tal nedåt mot noll
|
||||
GCD = SGD ## Returnerar den största gemensamma nämnaren
|
||||
INT = HELTAL ## Avrundar ett tal nedåt till närmaste heltal
|
||||
LCM = MGM ## Returnerar den minsta gemensamma multipeln
|
||||
LN = LN ## Returnerar den naturliga logaritmen för ett tal
|
||||
LOG = LOG ## Returnerar logaritmen för ett tal för en given bas
|
||||
LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal
|
||||
MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris
|
||||
MINVERSE = MINVERT ## Returnerar matrisinversen av en matris
|
||||
MMULT = MMULT ## Returnerar matrisprodukten av två matriser
|
||||
MOD = REST ## Returnerar resten vid en division
|
||||
MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel
|
||||
MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal
|
||||
ODD = UDDA ## Avrundar ett tal uppåt till närmaste udda heltal
|
||||
PI = PI ## Returnerar värdet pi
|
||||
POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent
|
||||
PRODUCT = PRODUKT ## Multiplicerar argumenten
|
||||
QUOTIENT = KVOT ## Returnerar heltalsdelen av en division
|
||||
RADIANS = RADIANER ## Omvandlar grader till radianer
|
||||
RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1
|
||||
RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger
|
||||
ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text
|
||||
ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror
|
||||
ROUNDDOWN = AVRUNDA.NEDÅT ## Avrundar ett tal nedåt mot noll
|
||||
ROUNDUP = AVRUNDA.UPPÅT ## Avrundar ett tal uppåt, från noll
|
||||
SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat på formeln
|
||||
SIGN = TECKEN ## Returnerar tecknet för ett tal
|
||||
SIN = SIN ## Returnerar sinus för en given vinkel
|
||||
SINH = SINH ## Returnerar hyperbolisk sinus för ett tal
|
||||
SQRT = ROT ## Returnerar den positiva kvadratroten
|
||||
SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi)
|
||||
SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas
|
||||
SUM = SUMMA ## Summerar argumenten
|
||||
SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor
|
||||
SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett område som uppfyller flera kriterier
|
||||
SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter
|
||||
SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater
|
||||
SUMX2MY2 = SUMMAX2MY2 ## Returnerar summan av differensen mellan kvadraterna för motsvarande värden i två matriser
|
||||
SUMX2PY2 = SUMMAX2PY2 ## Returnerar summan av summan av kvadraterna av motsvarande värden i två matriser
|
||||
SUMXMY2 = SUMMAXMY2 ## Returnerar summan av kvadraten av skillnaden mellan motsvarande värden i två matriser
|
||||
TAN = TAN ## Returnerar tangens för ett tal
|
||||
TANH = TANH ## Returnerar hyperbolisk tangens för ett tal
|
||||
TRUNC = AVKORTA ## Avkortar ett tal till ett heltal
|
||||
|
||||
|
||||
##
|
||||
## Statistical functions Statistiska funktioner
|
||||
##
|
||||
AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse från deras medelvärde
|
||||
AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten
|
||||
AVERAGEA = AVERAGEA ## Returnerar medelvärdet av argumenten, inklusive tal, text och logiska värden
|
||||
AVERAGEIF = MEDELOM ## Returnerar medelvärdet (aritmetiskt medelvärde) för alla celler i ett område som uppfyller ett givet kriterium
|
||||
AVERAGEIFS = MEDELOMF ## Returnerar medelvärdet (det aritmetiska medelvärdet) för alla celler som uppfyller flera villkor.
|
||||
BETADIST = BETAFÖRD ## Returnerar den kumulativa betafördelningsfunktionen
|
||||
BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning
|
||||
BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen
|
||||
CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen
|
||||
CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen
|
||||
CHITEST = CHI2TEST ## Returnerar oberoendetesten
|
||||
CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde
|
||||
CORREL = KORREL ## Returnerar korrelationskoefficienten mellan två datamängder
|
||||
COUNT = ANTAL ## Räknar hur många tal som finns bland argumenten
|
||||
COUNTA = ANTALV ## Räknar hur många värden som finns bland argumenten
|
||||
COUNTBLANK = ANTAL.TOMMA ## Räknar antalet tomma celler i ett område
|
||||
COUNTIF = ANTAL.OM ## Räknar antalet celler i ett område som uppfyller angivna villkor.
|
||||
COUNTIFS = ANTAL.OMF ## Räknar antalet celler i ett område som uppfyller flera villkor.
|
||||
COVAR = KOVAR ## Returnerar kovariansen, d.v.s. medelvärdet av produkterna för parade avvikelser
|
||||
CRITBINOM = KRITBINOM ## Returnerar det minsta värdet för vilket den kumulativa binomialfördelningen är mindre än eller lika med ett villkorsvärde
|
||||
DEVSQ = KVADAVV ## Returnerar summan av kvadrater på avvikelser
|
||||
EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen
|
||||
FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen
|
||||
FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen
|
||||
FISHER = FISHER ## Returnerar Fisher-transformationen
|
||||
FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen
|
||||
FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje
|
||||
FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris
|
||||
FTEST = FTEST ## Returnerar resultatet av en F-test
|
||||
GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen
|
||||
GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen
|
||||
GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x)
|
||||
GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet
|
||||
GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend
|
||||
HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet
|
||||
HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen
|
||||
INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje
|
||||
KURT = TOPPIGHET ## Returnerar toppigheten av en mängd data
|
||||
LARGE = STÖRSTA ## Returnerar det n:te största värdet i en mängd data
|
||||
LINEST = REGR ## Returnerar parametrar till en linjär trendlinje
|
||||
LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend
|
||||
LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen
|
||||
LOGNORMDIST = LOGNORMFÖRD ## Returnerar den kumulativa lognormala fördelningen
|
||||
MAX = MAX ## Returnerar det största värdet i en lista av argument
|
||||
MAXA = MAXA ## Returnerar det största värdet i en lista av argument, inklusive tal, text och logiska värden
|
||||
MEDIAN = MEDIAN ## Returnerar medianen för angivna tal
|
||||
MIN = MIN ## Returnerar det minsta värdet i en lista med argument
|
||||
MINA = MINA ## Returnerar det minsta värdet i en lista över argument, inklusive tal, text och logiska värden
|
||||
MODE = TYPVÄRDE ## Returnerar det vanligaste värdet i en datamängd
|
||||
NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen
|
||||
NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen
|
||||
NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen
|
||||
NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen
|
||||
NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen
|
||||
PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt
|
||||
PERCENTILE = PERCENTIL ## Returnerar den n:te percentilen av värden i ett område
|
||||
PERCENTRANK = PROCENTRANG ## Returnerar procentrangen för ett värde i en datamängd
|
||||
PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt
|
||||
POISSON = POISSON ## Returnerar Poisson-fördelningen
|
||||
PROB = SANNOLIKHET ## Returnerar sannolikheten att värden i ett område ligger mellan två gränser
|
||||
QUARTILE = KVARTIL ## Returnerar kvartilen av en mängd data
|
||||
RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal
|
||||
RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient
|
||||
SKEW = SNEDHET ## Returnerar snedheten för en fördelning
|
||||
SLOPE = LUTNING ## Returnerar lutningen på en linjär regressionslinje
|
||||
SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data
|
||||
STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde
|
||||
STDEV = STDAV ## Uppskattar standardavvikelsen baserat på ett urval
|
||||
STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat på ett urval, inklusive tal, text och logiska värden
|
||||
STDEVP = STDAVP ## Beräknar standardavvikelsen baserat på hela populationen
|
||||
STDEVPA = STDEVPA ## Beräknar standardavvikelsen baserat på hela populationen, inklusive tal, text och logiska värden
|
||||
STEYX = STDFELYX ## Returnerar standardfelet för ett förutspått y-värde för varje x-värde i regressionen
|
||||
TDIST = TFÖRD ## Returnerar Students t-fördelning
|
||||
TINV = TINV ## Returnerar inversen till Students t-fördelning
|
||||
TREND = TREND ## Returnerar värden längs en linjär trend
|
||||
TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd
|
||||
TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test
|
||||
VAR = VARIANS ## Uppskattar variansen baserat på ett urval
|
||||
VARA = VARA ## Uppskattar variansen baserat på ett urval, inklusive tal, text och logiska värden
|
||||
VARP = VARIANSP ## Beräknar variansen baserat på hela populationen
|
||||
VARPA = VARPA ## Beräknar variansen baserat på hela populationen, inklusive tal, text och logiska värden
|
||||
WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen
|
||||
ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test
|
||||
|
||||
|
||||
##
|
||||
## Text functions Textfunktioner
|
||||
##
|
||||
ASC = ASC ## Ändrar helbredds (dubbel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med halvt breddsteg (enkel byte)
|
||||
BAHTTEXT = BAHTTEXT ## Omvandlar ett tal till text med valutaformatet ß (baht)
|
||||
CHAR = TECKENKOD ## Returnerar tecknet som anges av kod
|
||||
CLEAN = STÄDA ## Tar bort alla icke utskrivbara tecken i en text
|
||||
CODE = KOD ## Returnerar en numerisk kod för det första tecknet i en textsträng
|
||||
CONCATENATE = SAMMANFOGA ## Sammanfogar flera textdelar till en textsträng
|
||||
DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat
|
||||
EXACT = EXAKT ## Kontrollerar om två textvärden är identiska
|
||||
FIND = HITTA ## Hittar en text i en annan (skiljer på gemener och versaler)
|
||||
FINDB = HITTAB ## Hittar en text i en annan (skiljer på gemener och versaler)
|
||||
FIXED = FASTTAL ## Formaterar ett tal som text med ett fast antal decimaler
|
||||
JIS = JIS ## Ändrar halvbredds (enkel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med helt breddsteg (dubbel byte)
|
||||
LEFT = VÄNSTER ## Returnerar tecken längst till vänster i en sträng
|
||||
LEFTB = VÄNSTERB ## Returnerar tecken längst till vänster i en sträng
|
||||
LEN = LÄNGD ## Returnerar antalet tecken i en textsträng
|
||||
LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng
|
||||
LOWER = GEMENER ## Omvandlar text till gemener
|
||||
MID = EXTEXT ## Returnerar angivet antal tecken från en text med början vid den position som du anger
|
||||
MIDB = EXTEXTB ## Returnerar angivet antal tecken från en text med början vid den position som du anger
|
||||
PHONETIC = PHONETIC ## Returnerar de fonetiska (furigana) tecknen i en textsträng
|
||||
PROPER = INITIAL ## Ändrar första bokstaven i varje ord i ett textvärde till versal
|
||||
REPLACE = ERSÄTT ## Ersätter tecken i text
|
||||
REPLACEB = ERSÄTTB ## Ersätter tecken i text
|
||||
REPT = REP ## Upprepar en text ett bestämt antal gånger
|
||||
RIGHT = HÖGER ## Returnerar tecken längst till höger i en sträng
|
||||
RIGHTB = HÖGERB ## Returnerar tecken längst till höger i en sträng
|
||||
SEARCH = SÖK ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler)
|
||||
SEARCHB = SÖKB ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler)
|
||||
SUBSTITUTE = BYT.UT ## Ersätter gammal text med ny text i en textsträng
|
||||
T = T ## Omvandlar argumenten till text
|
||||
TEXT = TEXT ## Formaterar ett tal och omvandlar det till text
|
||||
TRIM = RENSA ## Tar bort blanksteg från text
|
||||
UPPER = VERSALER ## Omvandlar text till versaler
|
||||
VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal
|
@ -1,24 +0,0 @@
|
||||
##
|
||||
## PhpSpreadsheet
|
||||
##
|
||||
|
||||
ArgumentSeparator = ;
|
||||
|
||||
|
||||
##
|
||||
## (For future use)
|
||||
##
|
||||
currencySymbol = YTL
|
||||
|
||||
|
||||
##
|
||||
## Excel Error Codes (For future use)
|
||||
|
||||
##
|
||||
NULL = #BOŞ!
|
||||
DIV0 = #SAYI/0!
|
||||
VALUE = #DEĞER!
|
||||
REF = #BAŞV!
|
||||
NAME = #AD?
|
||||
NUM = #SAYI!
|
||||
NA = #YOK
|
@ -1,134 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Exception;
|
||||
|
||||
class AddressHelper
|
||||
{
|
||||
/**
|
||||
* Converts an R1C1 format cell address to an A1 format cell address.
|
||||
*/
|
||||
public static function convertToA1(
|
||||
string $address,
|
||||
int $currentRowNumber = 1,
|
||||
int $currentColumnNumber = 1
|
||||
): string {
|
||||
$validityCheck = preg_match('/^(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))$/i', $address, $cellReference);
|
||||
|
||||
if ($validityCheck === 0) {
|
||||
throw new Exception('Invalid R1C1-format Cell Reference');
|
||||
}
|
||||
|
||||
$rowReference = $cellReference[2];
|
||||
// Empty R reference is the current row
|
||||
if ($rowReference === '') {
|
||||
$rowReference = (string) $currentRowNumber;
|
||||
}
|
||||
// Bracketed R references are relative to the current row
|
||||
if ($rowReference[0] === '[') {
|
||||
$rowReference = $currentRowNumber + trim($rowReference, '[]');
|
||||
}
|
||||
$columnReference = $cellReference[4];
|
||||
// Empty C reference is the current column
|
||||
if ($columnReference === '') {
|
||||
$columnReference = (string) $currentColumnNumber;
|
||||
}
|
||||
// Bracketed C references are relative to the current column
|
||||
if (is_string($columnReference) && $columnReference[0] === '[') {
|
||||
$columnReference = $currentColumnNumber + trim($columnReference, '[]');
|
||||
}
|
||||
|
||||
if ($columnReference <= 0 || $rowReference <= 0) {
|
||||
throw new Exception('Invalid R1C1-format Cell Reference, Value out of range');
|
||||
}
|
||||
$A1CellReference = Coordinate::stringFromColumnIndex($columnReference) . $rowReference;
|
||||
|
||||
return $A1CellReference;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a formula that uses R1C1 format cell address to an A1 format cell address.
|
||||
*/
|
||||
public static function convertFormulaToA1(
|
||||
string $formula,
|
||||
int $currentRowNumber = 1,
|
||||
int $currentColumnNumber = 1
|
||||
): string {
|
||||
if (substr($formula, 0, 3) == 'of:') {
|
||||
$formula = substr($formula, 3);
|
||||
$temp = explode('"', $formula);
|
||||
$key = false;
|
||||
foreach ($temp as &$value) {
|
||||
// Only replace in alternate array entries (i.e. non-quoted blocks)
|
||||
if ($key = !$key) {
|
||||
$value = str_replace(['[.', '.', ']'], '', $value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Convert R1C1 style references to A1 style references (but only when not quoted)
|
||||
$temp = explode('"', $formula);
|
||||
$key = false;
|
||||
foreach ($temp as &$value) {
|
||||
// Only replace in alternate array entries (i.e. non-quoted blocks)
|
||||
if ($key = !$key) {
|
||||
preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER + PREG_OFFSET_CAPTURE);
|
||||
// Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way
|
||||
// through the formula from left to right. Reversing means that we work right to left.through
|
||||
// the formula
|
||||
$cellReferences = array_reverse($cellReferences);
|
||||
// Loop through each R1C1 style reference in turn, converting it to its A1 style equivalent,
|
||||
// then modify the formula to use that new reference
|
||||
foreach ($cellReferences as $cellReference) {
|
||||
$A1CellReference = self::convertToA1($cellReference[0][0], $currentRowNumber, $currentColumnNumber);
|
||||
$value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($value);
|
||||
// Then rebuild the formula string
|
||||
$formula = implode('"', $temp);
|
||||
|
||||
return $formula;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an A1 format cell address to an R1C1 format cell address.
|
||||
* If $currentRowNumber or $currentColumnNumber are provided, then the R1C1 address will be formatted as a relative address.
|
||||
*/
|
||||
public static function convertToR1C1(
|
||||
string $address,
|
||||
?int $currentRowNumber = null,
|
||||
?int $currentColumnNumber = null
|
||||
): string {
|
||||
$validityCheck = preg_match('/^\$?([A-Z]{1,3})\$?(\d{1,7})$/i', $address, $cellReference);
|
||||
|
||||
if ($validityCheck === 0) {
|
||||
throw new Exception('Invalid A1-format Cell Reference');
|
||||
}
|
||||
|
||||
$columnId = Coordinate::columnIndexFromString($cellReference[1]);
|
||||
$rowId = (int) $cellReference[2];
|
||||
|
||||
if ($currentRowNumber !== null) {
|
||||
if ($rowId === $currentRowNumber) {
|
||||
$rowId = '';
|
||||
} else {
|
||||
$rowId = '[' . ($rowId - $currentRowNumber) . ']';
|
||||
}
|
||||
}
|
||||
|
||||
if ($currentColumnNumber !== null) {
|
||||
if ($columnId === $currentColumnNumber) {
|
||||
$columnId = '';
|
||||
} else {
|
||||
$columnId = '[' . ($columnId - $currentColumnNumber) . ']';
|
||||
}
|
||||
}
|
||||
|
||||
$R1C1Address = "R{$rowId}C{$columnId}";
|
||||
|
||||
return $R1C1Address;
|
||||
}
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
|
||||
{
|
||||
/**
|
||||
* Bind value to a cell.
|
||||
*
|
||||
* @param Cell $cell Cell to bind value to
|
||||
* @param mixed $value Value to bind in cell
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bindValue(Cell $cell, $value = null)
|
||||
{
|
||||
// sanitize UTF-8 strings
|
||||
if (is_string($value)) {
|
||||
$value = StringHelper::sanitizeUTF8($value);
|
||||
}
|
||||
|
||||
// Find out data type
|
||||
$dataType = parent::dataTypeForValue($value);
|
||||
|
||||
// Style logic - strings
|
||||
if ($dataType === DataType::TYPE_STRING && !$value instanceof RichText) {
|
||||
// Test for booleans using locale-setting
|
||||
if ($value == Calculation::getTRUE()) {
|
||||
$cell->setValueExplicit(true, DataType::TYPE_BOOL);
|
||||
|
||||
return true;
|
||||
} elseif ($value == Calculation::getFALSE()) {
|
||||
$cell->setValueExplicit(false, DataType::TYPE_BOOL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for number in scientific format
|
||||
if (preg_match('/^' . Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) {
|
||||
$cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for fraction
|
||||
if (preg_match('/^([+-]?)\s*(\d+)\s?\/\s*(\d+)$/', $value, $matches)) {
|
||||
// Convert value to number
|
||||
$value = $matches[2] / $matches[3];
|
||||
if ($matches[1] == '-') {
|
||||
$value = 0 - $value;
|
||||
}
|
||||
$cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode('??/??');
|
||||
|
||||
return true;
|
||||
} elseif (preg_match('/^([+-]?)(\d*) +(\d*)\s?\/\s*(\d*)$/', $value, $matches)) {
|
||||
// Convert value to number
|
||||
$value = $matches[2] + ($matches[3] / $matches[4]);
|
||||
if ($matches[1] == '-') {
|
||||
$value = 0 - $value;
|
||||
}
|
||||
$cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode('# ??/??');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for percentage
|
||||
if (preg_match('/^\-?\d*\.?\d*\s?\%$/', $value)) {
|
||||
// Convert value to number
|
||||
$value = (float) str_replace('%', '', $value) / 100;
|
||||
$cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_PERCENTAGE_00);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for currency
|
||||
$currencyCode = StringHelper::getCurrencyCode();
|
||||
$decimalSeparator = StringHelper::getDecimalSeparator();
|
||||
$thousandsSeparator = StringHelper::getThousandsSeparator();
|
||||
if (preg_match('/^' . preg_quote($currencyCode, '/') . ' *(\d{1,3}(' . preg_quote($thousandsSeparator, '/') . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator, '/') . '\d{2})?$/', $value)) {
|
||||
// Convert value to number
|
||||
$value = (float) trim(str_replace([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value));
|
||||
$cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode(
|
||||
str_replace('$', $currencyCode, NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
|
||||
);
|
||||
|
||||
return true;
|
||||
} elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
|
||||
// Convert value to number
|
||||
$value = (float) trim(str_replace(['$', ','], '', $value));
|
||||
$cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for time without seconds e.g. '9:45', '09:45'
|
||||
if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
|
||||
// Convert value to number
|
||||
[$h, $m] = explode(':', $value);
|
||||
$days = $h / 24 + $m / 1440;
|
||||
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_TIME3);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for time with seconds '9:45:59', '09:45:59'
|
||||
if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
|
||||
// Convert value to number
|
||||
[$h, $m, $s] = explode(':', $value);
|
||||
$days = $h / 24 + $m / 1440 + $s / 86400;
|
||||
// Convert value to number
|
||||
$cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_TIME4);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
|
||||
if (($d = Date::stringToExcel($value)) !== false) {
|
||||
// Convert value to number
|
||||
$cell->setValueExplicit($d, DataType::TYPE_NUMERIC);
|
||||
// Determine style. Either there is a time part or not. Look for ':'
|
||||
if (strpos($value, ':') !== false) {
|
||||
$formatCode = 'yyyy-mm-dd h:mm';
|
||||
} else {
|
||||
$formatCode = 'yyyy-mm-dd';
|
||||
}
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getNumberFormat()->setFormatCode($formatCode);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for newline character "\n"
|
||||
if (strpos($value, "\n") !== false) {
|
||||
$value = StringHelper::sanitizeUTF8($value);
|
||||
$cell->setValueExplicit($value, DataType::TYPE_STRING);
|
||||
// Set style
|
||||
$cell->getWorksheet()->getStyle($cell->getCoordinate())
|
||||
->getAlignment()->setWrapText(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Not bound yet? Use parent...
|
||||
return parent::bindValue($cell, $value);
|
||||
}
|
||||
}
|
@ -1,680 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\Collection\Cells;
|
||||
use PhpOffice\PhpSpreadsheet\Exception;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Style;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class Cell
|
||||
{
|
||||
/**
|
||||
* Value binder to use.
|
||||
*
|
||||
* @var IValueBinder
|
||||
*/
|
||||
private static $valueBinder;
|
||||
|
||||
/**
|
||||
* Value of the cell.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* Calculated value of the cell (used for caching)
|
||||
* This returns the value last calculated by MS Excel or whichever spreadsheet program was used to
|
||||
* create the original spreadsheet file.
|
||||
* Note that this value is not guaranteed to reflect the actual calculated value because it is
|
||||
* possible that auto-calculation was disabled in the original spreadsheet, and underlying data
|
||||
* values used by the formula have changed since it was last calculated.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $calculatedValue;
|
||||
|
||||
/**
|
||||
* Type of the cell data.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $dataType;
|
||||
|
||||
/**
|
||||
* Collection of cells.
|
||||
*
|
||||
* @var Cells
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
* Index to cellXf.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $xfIndex = 0;
|
||||
|
||||
/**
|
||||
* Attributes of the formula.
|
||||
*/
|
||||
private $formulaAttributes;
|
||||
|
||||
/**
|
||||
* Update the cell into the cell collection.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function updateInCollection()
|
||||
{
|
||||
$this->parent->update($this);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function detach(): void
|
||||
{
|
||||
$this->parent = null;
|
||||
}
|
||||
|
||||
public function attach(Cells $parent): void
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Cell.
|
||||
*
|
||||
* @param mixed $pValue
|
||||
* @param string $pDataType
|
||||
*/
|
||||
public function __construct($pValue, $pDataType, Worksheet $pSheet)
|
||||
{
|
||||
// Initialise cell value
|
||||
$this->value = $pValue;
|
||||
|
||||
// Set worksheet cache
|
||||
$this->parent = $pSheet->getCellCollection();
|
||||
|
||||
// Set datatype?
|
||||
if ($pDataType !== null) {
|
||||
if ($pDataType == DataType::TYPE_STRING2) {
|
||||
$pDataType = DataType::TYPE_STRING;
|
||||
}
|
||||
$this->dataType = $pDataType;
|
||||
} elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
|
||||
throw new Exception('Value could not be bound to cell.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell coordinate column.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getColumn()
|
||||
{
|
||||
return $this->parent->getCurrentColumn();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell coordinate row.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRow()
|
||||
{
|
||||
return $this->parent->getCurrentRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell coordinate.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCoordinate()
|
||||
{
|
||||
return $this->parent->getCurrentCoordinate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell value.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell value with formatting.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormattedValue()
|
||||
{
|
||||
return (string) NumberFormat::toFormattedString(
|
||||
$this->getCalculatedValue(),
|
||||
$this->getStyle()
|
||||
->getNumberFormat()->getFormatCode()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cell value.
|
||||
*
|
||||
* Sets the value for a cell, automatically determining the datatype using the value binder
|
||||
*
|
||||
* @param mixed $pValue Value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($pValue)
|
||||
{
|
||||
if (!self::getValueBinder()->bindValue($this, $pValue)) {
|
||||
throw new Exception('Value could not be bound to cell.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder).
|
||||
*
|
||||
* @param mixed $pValue Value
|
||||
* @param string $pDataType Explicit data type, see DataType::TYPE_*
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function setValueExplicit($pValue, $pDataType)
|
||||
{
|
||||
// set the value according to data type
|
||||
switch ($pDataType) {
|
||||
case DataType::TYPE_NULL:
|
||||
$this->value = $pValue;
|
||||
|
||||
break;
|
||||
case DataType::TYPE_STRING2:
|
||||
$pDataType = DataType::TYPE_STRING;
|
||||
// no break
|
||||
case DataType::TYPE_STRING:
|
||||
// Synonym for string
|
||||
case DataType::TYPE_INLINE:
|
||||
// Rich text
|
||||
$this->value = DataType::checkString($pValue);
|
||||
|
||||
break;
|
||||
case DataType::TYPE_NUMERIC:
|
||||
if (is_string($pValue) && !is_numeric($pValue)) {
|
||||
throw new Exception('Invalid numeric value for datatype Numeric');
|
||||
}
|
||||
$this->value = 0 + $pValue;
|
||||
|
||||
break;
|
||||
case DataType::TYPE_FORMULA:
|
||||
$this->value = (string) $pValue;
|
||||
|
||||
break;
|
||||
case DataType::TYPE_BOOL:
|
||||
$this->value = (bool) $pValue;
|
||||
|
||||
break;
|
||||
case DataType::TYPE_ERROR:
|
||||
$this->value = DataType::checkErrorCode($pValue);
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Invalid datatype: ' . $pDataType);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// set the datatype
|
||||
$this->dataType = $pDataType;
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get calculated cell value.
|
||||
*
|
||||
* @param bool $resetLog Whether the calculation engine logger should be reset or not
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCalculatedValue($resetLog = true)
|
||||
{
|
||||
if ($this->dataType == DataType::TYPE_FORMULA) {
|
||||
try {
|
||||
$index = $this->getWorksheet()->getParent()->getActiveSheetIndex();
|
||||
$result = Calculation::getInstance(
|
||||
$this->getWorksheet()->getParent()
|
||||
)->calculateCellValue($this, $resetLog);
|
||||
$this->getWorksheet()->getParent()->setActiveSheetIndex($index);
|
||||
// We don't yet handle array returns
|
||||
if (is_array($result)) {
|
||||
while (is_array($result)) {
|
||||
$result = array_shift($result);
|
||||
}
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) {
|
||||
return $this->calculatedValue; // Fallback for calculations referencing external files.
|
||||
} elseif (strpos($ex->getMessage(), 'undefined name') !== false) {
|
||||
return \PhpOffice\PhpSpreadsheet\Calculation\Functions::NAME();
|
||||
}
|
||||
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(
|
||||
$this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
if ($result === '#Not Yet Implemented') {
|
||||
return $this->calculatedValue; // Fallback if calculation engine does not support the formula.
|
||||
}
|
||||
|
||||
return $result;
|
||||
} elseif ($this->value instanceof RichText) {
|
||||
return $this->value->getPlainText();
|
||||
}
|
||||
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set old calculated value (cached).
|
||||
*
|
||||
* @param mixed $pValue Value
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function setCalculatedValue($pValue)
|
||||
{
|
||||
if ($pValue !== null) {
|
||||
$this->calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
|
||||
}
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get old calculated value (cached)
|
||||
* This returns the value last calculated by MS Excel or whichever spreadsheet program was used to
|
||||
* create the original spreadsheet file.
|
||||
* Note that this value is not guaranteed to reflect the actual calculated value because it is
|
||||
* possible that auto-calculation was disabled in the original spreadsheet, and underlying data
|
||||
* values used by the formula have changed since it was last calculated.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getOldCalculatedValue()
|
||||
{
|
||||
return $this->calculatedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell data type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDataType()
|
||||
{
|
||||
return $this->dataType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cell data type.
|
||||
*
|
||||
* @param string $pDataType see DataType::TYPE_*
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function setDataType($pDataType)
|
||||
{
|
||||
if ($pDataType == DataType::TYPE_STRING2) {
|
||||
$pDataType = DataType::TYPE_STRING;
|
||||
}
|
||||
$this->dataType = $pDataType;
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Identify if the cell contains a formula.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isFormula()
|
||||
{
|
||||
return $this->dataType == DataType::TYPE_FORMULA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this cell contain Data validation rules?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasDataValidation()
|
||||
{
|
||||
if (!isset($this->parent)) {
|
||||
throw new Exception('Cannot check for data validation when cell is not bound to a worksheet');
|
||||
}
|
||||
|
||||
return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Data validation rules.
|
||||
*
|
||||
* @return DataValidation
|
||||
*/
|
||||
public function getDataValidation()
|
||||
{
|
||||
if (!isset($this->parent)) {
|
||||
throw new Exception('Cannot get data validation for cell that is not bound to a worksheet');
|
||||
}
|
||||
|
||||
return $this->getWorksheet()->getDataValidation($this->getCoordinate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Data validation rules.
|
||||
*
|
||||
* @param DataValidation $pDataValidation
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function setDataValidation(?DataValidation $pDataValidation = null)
|
||||
{
|
||||
if (!isset($this->parent)) {
|
||||
throw new Exception('Cannot set data validation for cell that is not bound to a worksheet');
|
||||
}
|
||||
|
||||
$this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this cell contain valid value?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasValidValue()
|
||||
{
|
||||
$validator = new DataValidator();
|
||||
|
||||
return $validator->isValid($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this cell contain a Hyperlink?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasHyperlink()
|
||||
{
|
||||
if (!isset($this->parent)) {
|
||||
throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
|
||||
}
|
||||
|
||||
return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Hyperlink.
|
||||
*
|
||||
* @return Hyperlink
|
||||
*/
|
||||
public function getHyperlink()
|
||||
{
|
||||
if (!isset($this->parent)) {
|
||||
throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
|
||||
}
|
||||
|
||||
return $this->getWorksheet()->getHyperlink($this->getCoordinate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Hyperlink.
|
||||
*
|
||||
* @param Hyperlink $pHyperlink
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function setHyperlink(?Hyperlink $pHyperlink = null)
|
||||
{
|
||||
if (!isset($this->parent)) {
|
||||
throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
|
||||
}
|
||||
|
||||
$this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell collection.
|
||||
*
|
||||
* @return Cells
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parent worksheet.
|
||||
*
|
||||
* @return Worksheet
|
||||
*/
|
||||
public function getWorksheet()
|
||||
{
|
||||
return $this->parent->getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this cell in a merge range.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isInMergeRange()
|
||||
{
|
||||
return (bool) $this->getMergeRange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this cell the master (top left cell) in a merge range (that holds the actual data value).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isMergeRangeValueCell()
|
||||
{
|
||||
if ($mergeRange = $this->getMergeRange()) {
|
||||
$mergeRange = Coordinate::splitRange($mergeRange);
|
||||
[$startCell] = $mergeRange[0];
|
||||
if ($this->getCoordinate() === $startCell) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this cell is in a merge range, then return the range.
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public function getMergeRange()
|
||||
{
|
||||
foreach ($this->getWorksheet()->getMergeCells() as $mergeRange) {
|
||||
if ($this->isInRange($mergeRange)) {
|
||||
return $mergeRange;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell style.
|
||||
*
|
||||
* @return Style
|
||||
*/
|
||||
public function getStyle()
|
||||
{
|
||||
return $this->getWorksheet()->getStyle($this->getCoordinate());
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-bind parent.
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function rebindParent(Worksheet $parent)
|
||||
{
|
||||
$this->parent = $parent->getCellCollection();
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is cell in a specific range?
|
||||
*
|
||||
* @param string $pRange Cell range (e.g. A1:A1)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isInRange($pRange)
|
||||
{
|
||||
[$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($pRange);
|
||||
|
||||
// Translate properties
|
||||
$myColumn = Coordinate::columnIndexFromString($this->getColumn());
|
||||
$myRow = $this->getRow();
|
||||
|
||||
// Verify if cell is in range
|
||||
return ($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
|
||||
($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare 2 cells.
|
||||
*
|
||||
* @param Cell $a Cell a
|
||||
* @param Cell $b Cell b
|
||||
*
|
||||
* @return int Result of comparison (always -1 or 1, never zero!)
|
||||
*/
|
||||
public static function compareCells(self $a, self $b)
|
||||
{
|
||||
if ($a->getRow() < $b->getRow()) {
|
||||
return -1;
|
||||
} elseif ($a->getRow() > $b->getRow()) {
|
||||
return 1;
|
||||
} elseif (Coordinate::columnIndexFromString($a->getColumn()) < Coordinate::columnIndexFromString($b->getColumn())) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get value binder to use.
|
||||
*
|
||||
* @return IValueBinder
|
||||
*/
|
||||
public static function getValueBinder()
|
||||
{
|
||||
if (self::$valueBinder === null) {
|
||||
self::$valueBinder = new DefaultValueBinder();
|
||||
}
|
||||
|
||||
return self::$valueBinder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set value binder to use.
|
||||
*/
|
||||
public static function setValueBinder(IValueBinder $binder): void
|
||||
{
|
||||
self::$valueBinder = $binder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if ((is_object($value)) && ($key != 'parent')) {
|
||||
$this->$key = clone $value;
|
||||
} else {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get index to cellXf.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getXfIndex()
|
||||
{
|
||||
return $this->xfIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set index to cellXf.
|
||||
*
|
||||
* @param int $pValue
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function setXfIndex($pValue)
|
||||
{
|
||||
$this->xfIndex = $pValue;
|
||||
|
||||
return $this->updateInCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the formula attributes.
|
||||
*
|
||||
* @param mixed $pAttributes
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFormulaAttributes($pAttributes)
|
||||
{
|
||||
$this->formulaAttributes = $pAttributes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formula attributes.
|
||||
*/
|
||||
public function getFormulaAttributes()
|
||||
{
|
||||
return $this->formulaAttributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->getValue();
|
||||
}
|
||||
}
|
@ -1,549 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Exception;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
/**
|
||||
* Helper class to manipulate cell coordinates.
|
||||
*
|
||||
* Columns indexes and rows are always based on 1, **not** on 0. This match the behavior
|
||||
* that Excel users are used to, and also match the Excel functions `COLUMN()` and `ROW()`.
|
||||
*/
|
||||
abstract class Coordinate
|
||||
{
|
||||
/**
|
||||
* Default range variable constant.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DEFAULT_RANGE = 'A1:A1';
|
||||
|
||||
/**
|
||||
* Coordinate from string.
|
||||
*
|
||||
* @param string $pCoordinateString eg: 'A1'
|
||||
*
|
||||
* @return string[] Array containing column and row (indexes 0 and 1)
|
||||
*/
|
||||
public static function coordinateFromString($pCoordinateString)
|
||||
{
|
||||
if (preg_match('/^([$]?[A-Z]{1,3})([$]?\\d{1,7})$/', $pCoordinateString, $matches)) {
|
||||
return [$matches[1], $matches[2]];
|
||||
} elseif (self::coordinateIsRange($pCoordinateString)) {
|
||||
throw new Exception('Cell coordinate string can not be a range of cells');
|
||||
} elseif ($pCoordinateString == '') {
|
||||
throw new Exception('Cell coordinate can not be zero-length string');
|
||||
}
|
||||
|
||||
throw new Exception('Invalid cell coordinate ' . $pCoordinateString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a coordinate represents a range of cells.
|
||||
*
|
||||
* @param string $coord eg: 'A1' or 'A1:A2' or 'A1:A2,C1:C2'
|
||||
*
|
||||
* @return bool Whether the coordinate represents a range of cells
|
||||
*/
|
||||
public static function coordinateIsRange($coord)
|
||||
{
|
||||
return (strpos($coord, ':') !== false) || (strpos($coord, ',') !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make string row, column or cell coordinate absolute.
|
||||
*
|
||||
* @param string $pCoordinateString e.g. 'A' or '1' or 'A1'
|
||||
* Note that this value can be a row or column reference as well as a cell reference
|
||||
*
|
||||
* @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1'
|
||||
*/
|
||||
public static function absoluteReference($pCoordinateString)
|
||||
{
|
||||
if (self::coordinateIsRange($pCoordinateString)) {
|
||||
throw new Exception('Cell coordinate string can not be a range of cells');
|
||||
}
|
||||
|
||||
// Split out any worksheet name from the reference
|
||||
[$worksheet, $pCoordinateString] = Worksheet::extractSheetTitle($pCoordinateString, true);
|
||||
if ($worksheet > '') {
|
||||
$worksheet .= '!';
|
||||
}
|
||||
|
||||
// Create absolute coordinate
|
||||
if (ctype_digit($pCoordinateString)) {
|
||||
return $worksheet . '$' . $pCoordinateString;
|
||||
} elseif (ctype_alpha($pCoordinateString)) {
|
||||
return $worksheet . '$' . strtoupper($pCoordinateString);
|
||||
}
|
||||
|
||||
return $worksheet . self::absoluteCoordinate($pCoordinateString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make string coordinate absolute.
|
||||
*
|
||||
* @param string $pCoordinateString e.g. 'A1'
|
||||
*
|
||||
* @return string Absolute coordinate e.g. '$A$1'
|
||||
*/
|
||||
public static function absoluteCoordinate($pCoordinateString)
|
||||
{
|
||||
if (self::coordinateIsRange($pCoordinateString)) {
|
||||
throw new Exception('Cell coordinate string can not be a range of cells');
|
||||
}
|
||||
|
||||
// Split out any worksheet name from the coordinate
|
||||
[$worksheet, $pCoordinateString] = Worksheet::extractSheetTitle($pCoordinateString, true);
|
||||
if ($worksheet > '') {
|
||||
$worksheet .= '!';
|
||||
}
|
||||
|
||||
// Create absolute coordinate
|
||||
[$column, $row] = self::coordinateFromString($pCoordinateString);
|
||||
$column = ltrim($column, '$');
|
||||
$row = ltrim($row, '$');
|
||||
|
||||
return $worksheet . '$' . $column . '$' . $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Split range into coordinate strings.
|
||||
*
|
||||
* @param string $pRange e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'
|
||||
*
|
||||
* @return array Array containing one or more arrays containing one or two coordinate strings
|
||||
* e.g. ['B4','D9'] or [['B4','D9'], ['H2','O11']]
|
||||
* or ['B4']
|
||||
*/
|
||||
public static function splitRange($pRange)
|
||||
{
|
||||
// Ensure $pRange is a valid range
|
||||
if (empty($pRange)) {
|
||||
$pRange = self::DEFAULT_RANGE;
|
||||
}
|
||||
|
||||
$exploded = explode(',', $pRange);
|
||||
$counter = count($exploded);
|
||||
for ($i = 0; $i < $counter; ++$i) {
|
||||
$exploded[$i] = explode(':', $exploded[$i]);
|
||||
}
|
||||
|
||||
return $exploded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build range from coordinate strings.
|
||||
*
|
||||
* @param array $pRange Array containg one or more arrays containing one or two coordinate strings
|
||||
*
|
||||
* @return string String representation of $pRange
|
||||
*/
|
||||
public static function buildRange(array $pRange)
|
||||
{
|
||||
// Verify range
|
||||
if (empty($pRange) || !is_array($pRange[0])) {
|
||||
throw new Exception('Range does not contain any information');
|
||||
}
|
||||
|
||||
// Build range
|
||||
$counter = count($pRange);
|
||||
for ($i = 0; $i < $counter; ++$i) {
|
||||
$pRange[$i] = implode(':', $pRange[$i]);
|
||||
}
|
||||
|
||||
return implode(',', $pRange);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate range boundaries.
|
||||
*
|
||||
* @param string $pRange Cell range (e.g. A1:A1)
|
||||
*
|
||||
* @return array Range coordinates [Start Cell, End Cell]
|
||||
* where Start Cell and End Cell are arrays (Column Number, Row Number)
|
||||
*/
|
||||
public static function rangeBoundaries($pRange)
|
||||
{
|
||||
// Ensure $pRange is a valid range
|
||||
if (empty($pRange)) {
|
||||
$pRange = self::DEFAULT_RANGE;
|
||||
}
|
||||
|
||||
// Uppercase coordinate
|
||||
$pRange = strtoupper($pRange);
|
||||
|
||||
// Extract range
|
||||
if (strpos($pRange, ':') === false) {
|
||||
$rangeA = $rangeB = $pRange;
|
||||
} else {
|
||||
[$rangeA, $rangeB] = explode(':', $pRange);
|
||||
}
|
||||
|
||||
// Calculate range outer borders
|
||||
$rangeStart = self::coordinateFromString($rangeA);
|
||||
$rangeEnd = self::coordinateFromString($rangeB);
|
||||
|
||||
// Translate column into index
|
||||
$rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
|
||||
$rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
|
||||
|
||||
return [$rangeStart, $rangeEnd];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate range dimension.
|
||||
*
|
||||
* @param string $pRange Cell range (e.g. A1:A1)
|
||||
*
|
||||
* @return array Range dimension (width, height)
|
||||
*/
|
||||
public static function rangeDimension($pRange)
|
||||
{
|
||||
// Calculate range outer borders
|
||||
[$rangeStart, $rangeEnd] = self::rangeBoundaries($pRange);
|
||||
|
||||
return [($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate range boundaries.
|
||||
*
|
||||
* @param string $pRange Cell range (e.g. A1:A1)
|
||||
*
|
||||
* @return array Range coordinates [Start Cell, End Cell]
|
||||
* where Start Cell and End Cell are arrays [Column ID, Row Number]
|
||||
*/
|
||||
public static function getRangeBoundaries($pRange)
|
||||
{
|
||||
// Ensure $pRange is a valid range
|
||||
if (empty($pRange)) {
|
||||
$pRange = self::DEFAULT_RANGE;
|
||||
}
|
||||
|
||||
// Uppercase coordinate
|
||||
$pRange = strtoupper($pRange);
|
||||
|
||||
// Extract range
|
||||
if (strpos($pRange, ':') === false) {
|
||||
$rangeA = $rangeB = $pRange;
|
||||
} else {
|
||||
[$rangeA, $rangeB] = explode(':', $pRange);
|
||||
}
|
||||
|
||||
return [self::coordinateFromString($rangeA), self::coordinateFromString($rangeB)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Column index from string.
|
||||
*
|
||||
* @param string $pString eg 'A'
|
||||
*
|
||||
* @return int Column index (A = 1)
|
||||
*/
|
||||
public static function columnIndexFromString($pString)
|
||||
{
|
||||
// Using a lookup cache adds a slight memory overhead, but boosts speed
|
||||
// caching using a static within the method is faster than a class static,
|
||||
// though it's additional memory overhead
|
||||
static $indexCache = [];
|
||||
|
||||
if (isset($indexCache[$pString])) {
|
||||
return $indexCache[$pString];
|
||||
}
|
||||
// It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord()
|
||||
// and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant
|
||||
// memory overhead either
|
||||
static $columnLookup = [
|
||||
'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13,
|
||||
'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26,
|
||||
'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13,
|
||||
'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26,
|
||||
];
|
||||
|
||||
// We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
|
||||
// for improved performance
|
||||
if (isset($pString[0])) {
|
||||
if (!isset($pString[1])) {
|
||||
$indexCache[$pString] = $columnLookup[$pString];
|
||||
|
||||
return $indexCache[$pString];
|
||||
} elseif (!isset($pString[2])) {
|
||||
$indexCache[$pString] = $columnLookup[$pString[0]] * 26 + $columnLookup[$pString[1]];
|
||||
|
||||
return $indexCache[$pString];
|
||||
} elseif (!isset($pString[3])) {
|
||||
$indexCache[$pString] = $columnLookup[$pString[0]] * 676 + $columnLookup[$pString[1]] * 26 + $columnLookup[$pString[2]];
|
||||
|
||||
return $indexCache[$pString];
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception('Column string index can not be ' . ((isset($pString[0])) ? 'longer than 3 characters' : 'empty'));
|
||||
}
|
||||
|
||||
/**
|
||||
* String from column index.
|
||||
*
|
||||
* @param int $columnIndex Column index (A = 1)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function stringFromColumnIndex($columnIndex)
|
||||
{
|
||||
static $indexCache = [];
|
||||
|
||||
if (!isset($indexCache[$columnIndex])) {
|
||||
$indexValue = $columnIndex;
|
||||
$base26 = null;
|
||||
do {
|
||||
$characterValue = ($indexValue % 26) ?: 26;
|
||||
$indexValue = ($indexValue - $characterValue) / 26;
|
||||
$base26 = chr($characterValue + 64) . ($base26 ?: '');
|
||||
} while ($indexValue > 0);
|
||||
$indexCache[$columnIndex] = $base26;
|
||||
}
|
||||
|
||||
return $indexCache[$columnIndex];
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract all cell references in range, which may be comprised of multiple cell ranges.
|
||||
*
|
||||
* @param string $cellRange Range: e.g. 'A1' or 'A1:C10' or 'A1:E10,A20:E25' or 'A1:E5 C3:G7' or 'A1:C1,A3:C3 B1:C3'
|
||||
*
|
||||
* @return array Array containing single cell references
|
||||
*/
|
||||
public static function extractAllCellReferencesInRange($cellRange): array
|
||||
{
|
||||
[$ranges, $operators] = self::getCellBlocksFromRangeString($cellRange);
|
||||
|
||||
$cells = [];
|
||||
foreach ($ranges as $range) {
|
||||
$cells[] = self::getReferencesForCellBlock($range);
|
||||
}
|
||||
|
||||
$cells = self::processRangeSetOperators($operators, $cells);
|
||||
|
||||
if (empty($cells)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$cellList = array_merge(...$cells);
|
||||
$cellList = self::sortCellReferenceArray($cellList);
|
||||
|
||||
return $cellList;
|
||||
}
|
||||
|
||||
private static function processRangeSetOperators(array $operators, array $cells): array
|
||||
{
|
||||
for ($offset = 0; $offset < count($operators); ++$offset) {
|
||||
$operator = $operators[$offset];
|
||||
if ($operator !== ' ') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cells[$offset] = array_intersect($cells[$offset], $cells[$offset + 1]);
|
||||
unset($operators[$offset], $cells[$offset + 1]);
|
||||
$operators = array_values($operators);
|
||||
$cells = array_values($cells);
|
||||
--$offset;
|
||||
}
|
||||
|
||||
return $cells;
|
||||
}
|
||||
|
||||
private static function sortCellReferenceArray(array $cellList): array
|
||||
{
|
||||
// Sort the result by column and row
|
||||
$sortKeys = [];
|
||||
foreach ($cellList as $coord) {
|
||||
[$column, $row] = sscanf($coord, '%[A-Z]%d');
|
||||
$sortKeys[sprintf('%3s%09d', $column, $row)] = $coord;
|
||||
}
|
||||
ksort($sortKeys);
|
||||
|
||||
return array_values($sortKeys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all cell references for an individual cell block.
|
||||
*
|
||||
* @param string $cellBlock A cell range e.g. A4:B5
|
||||
*
|
||||
* @return array All individual cells in that range
|
||||
*/
|
||||
private static function getReferencesForCellBlock($cellBlock)
|
||||
{
|
||||
$returnValue = [];
|
||||
|
||||
// Single cell?
|
||||
if (!self::coordinateIsRange($cellBlock)) {
|
||||
return (array) $cellBlock;
|
||||
}
|
||||
|
||||
// Range...
|
||||
$ranges = self::splitRange($cellBlock);
|
||||
foreach ($ranges as $range) {
|
||||
// Single cell?
|
||||
if (!isset($range[1])) {
|
||||
$returnValue[] = $range[0];
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Range...
|
||||
[$rangeStart, $rangeEnd] = $range;
|
||||
[$startColumn, $startRow] = self::coordinateFromString($rangeStart);
|
||||
[$endColumn, $endRow] = self::coordinateFromString($rangeEnd);
|
||||
$startColumnIndex = self::columnIndexFromString($startColumn);
|
||||
$endColumnIndex = self::columnIndexFromString($endColumn);
|
||||
++$endColumnIndex;
|
||||
|
||||
// Current data
|
||||
$currentColumnIndex = $startColumnIndex;
|
||||
$currentRow = $startRow;
|
||||
|
||||
self::validateRange($cellBlock, $startColumnIndex, $endColumnIndex, $currentRow, $endRow);
|
||||
|
||||
// Loop cells
|
||||
while ($currentColumnIndex < $endColumnIndex) {
|
||||
while ($currentRow <= $endRow) {
|
||||
$returnValue[] = self::stringFromColumnIndex($currentColumnIndex) . $currentRow;
|
||||
++$currentRow;
|
||||
}
|
||||
++$currentColumnIndex;
|
||||
$currentRow = $startRow;
|
||||
}
|
||||
}
|
||||
|
||||
return $returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an associative array of single cell coordinates to values to an associative array
|
||||
* of cell ranges to values. Only adjacent cell coordinates with the same
|
||||
* value will be merged. If the value is an object, it must implement the method getHashCode().
|
||||
*
|
||||
* For example, this function converts:
|
||||
*
|
||||
* [ 'A1' => 'x', 'A2' => 'x', 'A3' => 'x', 'A4' => 'y' ]
|
||||
*
|
||||
* to:
|
||||
*
|
||||
* [ 'A1:A3' => 'x', 'A4' => 'y' ]
|
||||
*
|
||||
* @param array $pCoordCollection associative array mapping coordinates to values
|
||||
*
|
||||
* @return array associative array mapping coordinate ranges to valuea
|
||||
*/
|
||||
public static function mergeRangesInCollection(array $pCoordCollection)
|
||||
{
|
||||
$hashedValues = [];
|
||||
$mergedCoordCollection = [];
|
||||
|
||||
foreach ($pCoordCollection as $coord => $value) {
|
||||
if (self::coordinateIsRange($coord)) {
|
||||
$mergedCoordCollection[$coord] = $value;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
[$column, $row] = self::coordinateFromString($coord);
|
||||
$row = (int) (ltrim($row, '$'));
|
||||
$hashCode = $column . '-' . (is_object($value) ? $value->getHashCode() : $value);
|
||||
|
||||
if (!isset($hashedValues[$hashCode])) {
|
||||
$hashedValues[$hashCode] = (object) [
|
||||
'value' => $value,
|
||||
'col' => $column,
|
||||
'rows' => [$row],
|
||||
];
|
||||
} else {
|
||||
$hashedValues[$hashCode]->rows[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($hashedValues);
|
||||
|
||||
foreach ($hashedValues as $hashedValue) {
|
||||
sort($hashedValue->rows);
|
||||
$rowStart = null;
|
||||
$rowEnd = null;
|
||||
$ranges = [];
|
||||
|
||||
foreach ($hashedValue->rows as $row) {
|
||||
if ($rowStart === null) {
|
||||
$rowStart = $row;
|
||||
$rowEnd = $row;
|
||||
} elseif ($rowEnd === $row - 1) {
|
||||
$rowEnd = $row;
|
||||
} else {
|
||||
if ($rowStart == $rowEnd) {
|
||||
$ranges[] = $hashedValue->col . $rowStart;
|
||||
} else {
|
||||
$ranges[] = $hashedValue->col . $rowStart . ':' . $hashedValue->col . $rowEnd;
|
||||
}
|
||||
|
||||
$rowStart = $row;
|
||||
$rowEnd = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rowStart !== null) {
|
||||
if ($rowStart == $rowEnd) {
|
||||
$ranges[] = $hashedValue->col . $rowStart;
|
||||
} else {
|
||||
$ranges[] = $hashedValue->col . $rowStart . ':' . $hashedValue->col . $rowEnd;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($ranges as $range) {
|
||||
$mergedCoordCollection[$range] = $hashedValue->value;
|
||||
}
|
||||
}
|
||||
|
||||
return $mergedCoordCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the individual cell blocks from a range string, removing any $ characters.
|
||||
* then splitting by operators and returning an array with ranges and operators.
|
||||
*
|
||||
* @param string $rangeString
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
private static function getCellBlocksFromRangeString($rangeString)
|
||||
{
|
||||
$rangeString = str_replace('$', '', strtoupper($rangeString));
|
||||
|
||||
// split range sets on intersection (space) or union (,) operators
|
||||
$tokens = preg_split('/([ ,])/', $rangeString, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
// separate the range sets and the operators into arrays
|
||||
$split = array_chunk($tokens, 2);
|
||||
$ranges = array_column($split, 0);
|
||||
$operators = array_column($split, 1);
|
||||
|
||||
return [$ranges, $operators];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the given range is valid, i.e. that the start column and row are not greater than the end column and
|
||||
* row.
|
||||
*
|
||||
* @param string $cellBlock The original range, for displaying a meaningful error message
|
||||
* @param int $startColumnIndex
|
||||
* @param int $endColumnIndex
|
||||
* @param int $currentRow
|
||||
* @param int $endRow
|
||||
*/
|
||||
private static function validateRange($cellBlock, $startColumnIndex, $endColumnIndex, $currentRow, $endRow): void
|
||||
{
|
||||
if ($startColumnIndex >= $endColumnIndex || $currentRow > $endRow) {
|
||||
throw new Exception('Invalid range: "' . $cellBlock . '"');
|
||||
}
|
||||
}
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
|
||||
class DataType
|
||||
{
|
||||
// Data types
|
||||
const TYPE_STRING2 = 'str';
|
||||
const TYPE_STRING = 's';
|
||||
const TYPE_FORMULA = 'f';
|
||||
const TYPE_NUMERIC = 'n';
|
||||
const TYPE_BOOL = 'b';
|
||||
const TYPE_NULL = 'null';
|
||||
const TYPE_INLINE = 'inlineStr';
|
||||
const TYPE_ERROR = 'e';
|
||||
|
||||
/**
|
||||
* List of error codes.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $errorCodes = [
|
||||
'#NULL!' => 0,
|
||||
'#DIV/0!' => 1,
|
||||
'#VALUE!' => 2,
|
||||
'#REF!' => 3,
|
||||
'#NAME?' => 4,
|
||||
'#NUM!' => 5,
|
||||
'#N/A' => 6,
|
||||
];
|
||||
|
||||
/**
|
||||
* Get list of error codes.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getErrorCodes()
|
||||
{
|
||||
return self::$errorCodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a string that it satisfies Excel requirements.
|
||||
*
|
||||
* @param null|RichText|string $pValue Value to sanitize to an Excel string
|
||||
*
|
||||
* @return null|RichText|string Sanitized value
|
||||
*/
|
||||
public static function checkString($pValue)
|
||||
{
|
||||
if ($pValue instanceof RichText) {
|
||||
// TODO: Sanitize Rich-Text string (max. character count is 32,767)
|
||||
return $pValue;
|
||||
}
|
||||
|
||||
// string must never be longer than 32,767 characters, truncate if necessary
|
||||
$pValue = StringHelper::substring($pValue, 0, 32767);
|
||||
|
||||
// we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
|
||||
$pValue = str_replace(["\r\n", "\r"], "\n", $pValue);
|
||||
|
||||
return $pValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a value that it is a valid error code.
|
||||
*
|
||||
* @param mixed $pValue Value to sanitize to an Excel error code
|
||||
*
|
||||
* @return string Sanitized value
|
||||
*/
|
||||
public static function checkErrorCode($pValue)
|
||||
{
|
||||
$pValue = (string) $pValue;
|
||||
|
||||
if (!isset(self::$errorCodes[$pValue])) {
|
||||
$pValue = '#NULL!';
|
||||
}
|
||||
|
||||
return $pValue;
|
||||
}
|
||||
}
|
@ -1,481 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
class DataValidation
|
||||
{
|
||||
// Data validation types
|
||||
const TYPE_NONE = 'none';
|
||||
const TYPE_CUSTOM = 'custom';
|
||||
const TYPE_DATE = 'date';
|
||||
const TYPE_DECIMAL = 'decimal';
|
||||
const TYPE_LIST = 'list';
|
||||
const TYPE_TEXTLENGTH = 'textLength';
|
||||
const TYPE_TIME = 'time';
|
||||
const TYPE_WHOLE = 'whole';
|
||||
|
||||
// Data validation error styles
|
||||
const STYLE_STOP = 'stop';
|
||||
const STYLE_WARNING = 'warning';
|
||||
const STYLE_INFORMATION = 'information';
|
||||
|
||||
// Data validation operators
|
||||
const OPERATOR_BETWEEN = 'between';
|
||||
const OPERATOR_EQUAL = 'equal';
|
||||
const OPERATOR_GREATERTHAN = 'greaterThan';
|
||||
const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual';
|
||||
const OPERATOR_LESSTHAN = 'lessThan';
|
||||
const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual';
|
||||
const OPERATOR_NOTBETWEEN = 'notBetween';
|
||||
const OPERATOR_NOTEQUAL = 'notEqual';
|
||||
|
||||
/**
|
||||
* Formula 1.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $formula1 = '';
|
||||
|
||||
/**
|
||||
* Formula 2.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $formula2 = '';
|
||||
|
||||
/**
|
||||
* Type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $type = self::TYPE_NONE;
|
||||
|
||||
/**
|
||||
* Error style.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $errorStyle = self::STYLE_STOP;
|
||||
|
||||
/**
|
||||
* Operator.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $operator = self::OPERATOR_BETWEEN;
|
||||
|
||||
/**
|
||||
* Allow Blank.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $allowBlank = false;
|
||||
|
||||
/**
|
||||
* Show DropDown.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showDropDown = false;
|
||||
|
||||
/**
|
||||
* Show InputMessage.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showInputMessage = false;
|
||||
|
||||
/**
|
||||
* Show ErrorMessage.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showErrorMessage = false;
|
||||
|
||||
/**
|
||||
* Error title.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $errorTitle = '';
|
||||
|
||||
/**
|
||||
* Error.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $error = '';
|
||||
|
||||
/**
|
||||
* Prompt title.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $promptTitle = '';
|
||||
|
||||
/**
|
||||
* Prompt.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $prompt = '';
|
||||
|
||||
/**
|
||||
* Create a new DataValidation.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Formula 1.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormula1()
|
||||
{
|
||||
return $this->formula1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Formula 1.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFormula1($value)
|
||||
{
|
||||
$this->formula1 = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Formula 2.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormula2()
|
||||
{
|
||||
return $this->formula2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Formula 2.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFormula2($value)
|
||||
{
|
||||
$this->formula2 = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Type.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setType($value)
|
||||
{
|
||||
$this->type = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Error style.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorStyle()
|
||||
{
|
||||
return $this->errorStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Error style.
|
||||
*
|
||||
* @param string $value see self::STYLE_*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrorStyle($value)
|
||||
{
|
||||
$this->errorStyle = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Operator.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOperator()
|
||||
{
|
||||
return $this->operator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Operator.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOperator($value)
|
||||
{
|
||||
$this->operator = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Allow Blank.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getAllowBlank()
|
||||
{
|
||||
return $this->allowBlank;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Allow Blank.
|
||||
*
|
||||
* @param bool $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAllowBlank($value)
|
||||
{
|
||||
$this->allowBlank = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Show DropDown.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowDropDown()
|
||||
{
|
||||
return $this->showDropDown;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Show DropDown.
|
||||
*
|
||||
* @param bool $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowDropDown($value)
|
||||
{
|
||||
$this->showDropDown = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Show InputMessage.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowInputMessage()
|
||||
{
|
||||
return $this->showInputMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Show InputMessage.
|
||||
*
|
||||
* @param bool $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowInputMessage($value)
|
||||
{
|
||||
$this->showInputMessage = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Show ErrorMessage.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowErrorMessage()
|
||||
{
|
||||
return $this->showErrorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Show ErrorMessage.
|
||||
*
|
||||
* @param bool $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowErrorMessage($value)
|
||||
{
|
||||
$this->showErrorMessage = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Error title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorTitle()
|
||||
{
|
||||
return $this->errorTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Error title.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrorTitle($value)
|
||||
{
|
||||
$this->errorTitle = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Error.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Error.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setError($value)
|
||||
{
|
||||
$this->error = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Prompt title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPromptTitle()
|
||||
{
|
||||
return $this->promptTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Prompt title.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPromptTitle($value)
|
||||
{
|
||||
$this->promptTitle = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Prompt.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrompt()
|
||||
{
|
||||
return $this->prompt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Prompt.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrompt($value)
|
||||
{
|
||||
$this->prompt = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hash code.
|
||||
*
|
||||
* @return string Hash code
|
||||
*/
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->formula1 .
|
||||
$this->formula2 .
|
||||
$this->type .
|
||||
$this->errorStyle .
|
||||
$this->operator .
|
||||
($this->allowBlank ? 't' : 'f') .
|
||||
($this->showDropDown ? 't' : 'f') .
|
||||
($this->showInputMessage ? 't' : 'f') .
|
||||
($this->showErrorMessage ? 't' : 'f') .
|
||||
$this->errorTitle .
|
||||
$this->error .
|
||||
$this->promptTitle .
|
||||
$this->prompt .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
$this->$key = clone $value;
|
||||
} else {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
||||
use PhpOffice\PhpSpreadsheet\Exception;
|
||||
|
||||
/**
|
||||
* Validate a cell value according to its validation rules.
|
||||
*/
|
||||
class DataValidator
|
||||
{
|
||||
/**
|
||||
* Does this cell contain valid value?
|
||||
*
|
||||
* @param Cell $cell Cell to check the value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid(Cell $cell)
|
||||
{
|
||||
if (!$cell->hasDataValidation()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$cellValue = $cell->getValue();
|
||||
$dataValidation = $cell->getDataValidation();
|
||||
|
||||
if (!$dataValidation->getAllowBlank() && ($cellValue === null || $cellValue === '')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: write check on all cases
|
||||
switch ($dataValidation->getType()) {
|
||||
case DataValidation::TYPE_LIST:
|
||||
return $this->isValueInList($cell);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Does this cell contain valid value, based on list?
|
||||
*
|
||||
* @param Cell $cell Cell to check the value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isValueInList(Cell $cell)
|
||||
{
|
||||
$cellValue = $cell->getValue();
|
||||
$dataValidation = $cell->getDataValidation();
|
||||
|
||||
$formula1 = $dataValidation->getFormula1();
|
||||
if (!empty($formula1)) {
|
||||
// inline values list
|
||||
if ($formula1[0] === '"') {
|
||||
return in_array(strtolower($cellValue), explode(',', strtolower(trim($formula1, '"'))), true);
|
||||
} elseif (strpos($formula1, ':') > 0) {
|
||||
// values list cells
|
||||
$matchFormula = '=MATCH(' . $cell->getCoordinate() . ', ' . $formula1 . ', 0)';
|
||||
$calculation = Calculation::getInstance($cell->getWorksheet()->getParent());
|
||||
|
||||
try {
|
||||
$result = $calculation->calculateFormula($matchFormula, $cell->getCoordinate(), $cell);
|
||||
|
||||
return $result !== Functions::NA();
|
||||
} catch (Exception $ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use DateTimeInterface;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
|
||||
class DefaultValueBinder implements IValueBinder
|
||||
{
|
||||
/**
|
||||
* Bind value to a cell.
|
||||
*
|
||||
* @param Cell $cell Cell to bind value to
|
||||
* @param mixed $value Value to bind in cell
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bindValue(Cell $cell, $value)
|
||||
{
|
||||
// sanitize UTF-8 strings
|
||||
if (is_string($value)) {
|
||||
$value = StringHelper::sanitizeUTF8($value);
|
||||
} elseif (is_object($value)) {
|
||||
// Handle any objects that might be injected
|
||||
if ($value instanceof DateTimeInterface) {
|
||||
$value = $value->format('Y-m-d H:i:s');
|
||||
} elseif (!($value instanceof RichText)) {
|
||||
$value = (string) $value;
|
||||
}
|
||||
}
|
||||
|
||||
// Set value explicit
|
||||
$cell->setValueExplicit($value, static::dataTypeForValue($value));
|
||||
|
||||
// Done!
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* DataType for value.
|
||||
*
|
||||
* @param mixed $pValue
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function dataTypeForValue($pValue)
|
||||
{
|
||||
// Match the value against a few data types
|
||||
if ($pValue === null) {
|
||||
return DataType::TYPE_NULL;
|
||||
} elseif (is_float($pValue) || is_int($pValue)) {
|
||||
return DataType::TYPE_NUMERIC;
|
||||
} elseif (is_bool($pValue)) {
|
||||
return DataType::TYPE_BOOL;
|
||||
} elseif ($pValue === '') {
|
||||
return DataType::TYPE_STRING;
|
||||
} elseif ($pValue instanceof RichText) {
|
||||
return DataType::TYPE_INLINE;
|
||||
} elseif (is_string($pValue) && $pValue[0] === '=' && strlen($pValue) > 1) {
|
||||
return DataType::TYPE_FORMULA;
|
||||
} elseif (preg_match('/^[\+\-]?(\d+\\.?\d*|\d*\\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) {
|
||||
$tValue = ltrim($pValue, '+-');
|
||||
if (is_string($pValue) && $tValue[0] === '0' && strlen($tValue) > 1 && $tValue[1] !== '.') {
|
||||
return DataType::TYPE_STRING;
|
||||
} elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) {
|
||||
return DataType::TYPE_STRING;
|
||||
} elseif (!is_numeric($pValue)) {
|
||||
return DataType::TYPE_STRING;
|
||||
}
|
||||
|
||||
return DataType::TYPE_NUMERIC;
|
||||
} elseif (is_string($pValue)) {
|
||||
$errorCodes = DataType::getErrorCodes();
|
||||
if (isset($errorCodes[$pValue])) {
|
||||
return DataType::TYPE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return DataType::TYPE_STRING;
|
||||
}
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
class Hyperlink
|
||||
{
|
||||
/**
|
||||
* URL to link the cell to.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* Tooltip to display on the hyperlink.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $tooltip;
|
||||
|
||||
/**
|
||||
* Create a new Hyperlink.
|
||||
*
|
||||
* @param string $pUrl Url to link the cell to
|
||||
* @param string $pTooltip Tooltip to display on the hyperlink
|
||||
*/
|
||||
public function __construct($pUrl = '', $pTooltip = '')
|
||||
{
|
||||
// Initialise member variables
|
||||
$this->url = $pUrl;
|
||||
$this->tooltip = $pTooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get URL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set URL.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUrl($value)
|
||||
{
|
||||
$this->url = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tooltip.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTooltip()
|
||||
{
|
||||
return $this->tooltip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set tooltip.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTooltip($value)
|
||||
{
|
||||
$this->tooltip = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this hyperlink internal? (to another worksheet).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isInternal()
|
||||
{
|
||||
return strpos($this->url, 'sheet://') !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTypeHyperlink()
|
||||
{
|
||||
return $this->isInternal() ? '' : 'External';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hash code.
|
||||
*
|
||||
* @return string Hash code
|
||||
*/
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->url .
|
||||
$this->tooltip .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
interface IValueBinder
|
||||
{
|
||||
/**
|
||||
* Bind value to a cell.
|
||||
*
|
||||
* @param Cell $cell Cell to bind value to
|
||||
* @param mixed $value Value to bind in cell
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bindValue(Cell $cell, $value);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Cell;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
|
||||
|
||||
class StringValueBinder implements IValueBinder
|
||||
{
|
||||
/**
|
||||
* Bind value to a cell.
|
||||
*
|
||||
* @param Cell $cell Cell to bind value to
|
||||
* @param mixed $value Value to bind in cell
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function bindValue(Cell $cell, $value)
|
||||
{
|
||||
// sanitize UTF-8 strings
|
||||
if (is_string($value)) {
|
||||
$value = StringHelper::sanitizeUTF8($value);
|
||||
}
|
||||
|
||||
$cell->setValueExplicit((string) $value, DataType::TYPE_STRING);
|
||||
|
||||
// Done!
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,556 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wiktor Trzonkowski
|
||||
* Date: 6/17/14
|
||||
* Time: 12:11 PM.
|
||||
*/
|
||||
class Axis extends Properties
|
||||
{
|
||||
/**
|
||||
* Axis Number.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $axisNumber = [
|
||||
'format' => self::FORMAT_CODE_GENERAL,
|
||||
'source_linked' => 1,
|
||||
];
|
||||
|
||||
/**
|
||||
* Axis Options.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $axisOptions = [
|
||||
'minimum' => null,
|
||||
'maximum' => null,
|
||||
'major_unit' => null,
|
||||
'minor_unit' => null,
|
||||
'orientation' => self::ORIENTATION_NORMAL,
|
||||
'minor_tick_mark' => self::TICK_MARK_NONE,
|
||||
'major_tick_mark' => self::TICK_MARK_NONE,
|
||||
'axis_labels' => self::AXIS_LABELS_NEXT_TO,
|
||||
'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO,
|
||||
'horizontal_crosses_value' => null,
|
||||
];
|
||||
|
||||
/**
|
||||
* Fill Properties.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $fillProperties = [
|
||||
'type' => self::EXCEL_COLOR_TYPE_ARGB,
|
||||
'value' => null,
|
||||
'alpha' => 0,
|
||||
];
|
||||
|
||||
/**
|
||||
* Line Properties.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $lineProperties = [
|
||||
'type' => self::EXCEL_COLOR_TYPE_ARGB,
|
||||
'value' => null,
|
||||
'alpha' => 0,
|
||||
];
|
||||
|
||||
/**
|
||||
* Line Style Properties.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $lineStyleProperties = [
|
||||
'width' => '9525',
|
||||
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
|
||||
'dash' => self::LINE_STYLE_DASH_SOLID,
|
||||
'cap' => self::LINE_STYLE_CAP_FLAT,
|
||||
'join' => self::LINE_STYLE_JOIN_BEVEL,
|
||||
'arrow' => [
|
||||
'head' => [
|
||||
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
||||
'size' => self::LINE_STYLE_ARROW_SIZE_5,
|
||||
],
|
||||
'end' => [
|
||||
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
||||
'size' => self::LINE_STYLE_ARROW_SIZE_8,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Shadow Properties.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $shadowProperties = [
|
||||
'presets' => self::SHADOW_PRESETS_NOSHADOW,
|
||||
'effect' => null,
|
||||
'color' => [
|
||||
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
||||
'value' => 'black',
|
||||
'alpha' => 40,
|
||||
],
|
||||
'size' => [
|
||||
'sx' => null,
|
||||
'sy' => null,
|
||||
'kx' => null,
|
||||
],
|
||||
'blur' => null,
|
||||
'direction' => null,
|
||||
'distance' => null,
|
||||
'algn' => null,
|
||||
'rotWithShape' => null,
|
||||
];
|
||||
|
||||
/**
|
||||
* Glow Properties.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $glowProperties = [
|
||||
'size' => null,
|
||||
'color' => [
|
||||
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
||||
'value' => 'black',
|
||||
'alpha' => 40,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Soft Edge Properties.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $softEdges = [
|
||||
'size' => null,
|
||||
];
|
||||
|
||||
/**
|
||||
* Get Series Data Type.
|
||||
*
|
||||
* @param mixed $format_code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function setAxisNumberProperties($format_code)
|
||||
{
|
||||
$this->axisNumber['format'] = (string) $format_code;
|
||||
$this->axisNumber['source_linked'] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Axis Number Format Data Type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAxisNumberFormat()
|
||||
{
|
||||
return $this->axisNumber['format'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Axis Number Source Linked.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAxisNumberSourceLinked()
|
||||
{
|
||||
return (string) $this->axisNumber['source_linked'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Axis Options Properties.
|
||||
*
|
||||
* @param string $axis_labels
|
||||
* @param string $horizontal_crosses_value
|
||||
* @param string $horizontal_crosses
|
||||
* @param string $axis_orientation
|
||||
* @param string $major_tmt
|
||||
* @param string $minor_tmt
|
||||
* @param string $minimum
|
||||
* @param string $maximum
|
||||
* @param string $major_unit
|
||||
* @param string $minor_unit
|
||||
*/
|
||||
public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null): void
|
||||
{
|
||||
$this->axisOptions['axis_labels'] = (string) $axis_labels;
|
||||
($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
|
||||
($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null;
|
||||
($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null;
|
||||
($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null;
|
||||
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
||||
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
||||
($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;
|
||||
($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;
|
||||
($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null;
|
||||
($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Axis Options Property.
|
||||
*
|
||||
* @param string $property
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAxisOptionsProperty($property)
|
||||
{
|
||||
return $this->axisOptions[$property];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Axis Orientation Property.
|
||||
*
|
||||
* @param string $orientation
|
||||
*/
|
||||
public function setAxisOrientation($orientation): void
|
||||
{
|
||||
$this->axisOptions['orientation'] = (string) $orientation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Fill Property.
|
||||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*/
|
||||
public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB): void
|
||||
{
|
||||
$this->fillProperties = $this->setColorProperties($color, $alpha, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Line Property.
|
||||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*/
|
||||
public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB): void
|
||||
{
|
||||
$this->lineProperties = $this->setColorProperties($color, $alpha, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Fill Property.
|
||||
*
|
||||
* @param string $property
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFillProperty($property)
|
||||
{
|
||||
return $this->fillProperties[$property];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Property.
|
||||
*
|
||||
* @param string $property
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineProperty($property)
|
||||
{
|
||||
return $this->lineProperties[$property];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Line Style Properties.
|
||||
*
|
||||
* @param float $line_width
|
||||
* @param string $compound_type
|
||||
* @param string $dash_type
|
||||
* @param string $cap_type
|
||||
* @param string $join_type
|
||||
* @param string $head_arrow_type
|
||||
* @param string $head_arrow_size
|
||||
* @param string $end_arrow_type
|
||||
* @param string $end_arrow_size
|
||||
*/
|
||||
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null): void
|
||||
{
|
||||
($line_width !== null) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
|
||||
($compound_type !== null) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;
|
||||
($dash_type !== null) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;
|
||||
($cap_type !== null) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;
|
||||
($join_type !== null) ? $this->lineStyleProperties['join'] = (string) $join_type : null;
|
||||
($head_arrow_type !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;
|
||||
($head_arrow_size !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;
|
||||
($end_arrow_type !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;
|
||||
($end_arrow_size !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Style Property.
|
||||
*
|
||||
* @param array|string $elements
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineStyleProperty($elements)
|
||||
{
|
||||
return $this->getArrayElementsValue($this->lineStyleProperties, $elements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Style Arrow Excel Width.
|
||||
*
|
||||
* @param string $arrow
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineStyleArrowWidth($arrow)
|
||||
{
|
||||
return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'w');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Style Arrow Excel Length.
|
||||
*
|
||||
* @param string $arrow
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineStyleArrowLength($arrow)
|
||||
{
|
||||
return $this->getLineStyleArrowSize($this->lineStyleProperties['arrow'][$arrow]['size'], 'len');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Properties.
|
||||
*
|
||||
* @param int $sh_presets
|
||||
* @param string $sh_color_value
|
||||
* @param string $sh_color_type
|
||||
* @param string $sh_color_alpha
|
||||
* @param float $sh_blur
|
||||
* @param int $sh_angle
|
||||
* @param float $sh_distance
|
||||
*/
|
||||
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null): void
|
||||
{
|
||||
$this->setShadowPresetsProperties((int) $sh_presets)
|
||||
->setShadowColor(
|
||||
$sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
||||
$sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha,
|
||||
$sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type
|
||||
)
|
||||
->setShadowBlur($sh_blur)
|
||||
->setShadowAngle($sh_angle)
|
||||
->setShadowDistance($sh_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Color.
|
||||
*
|
||||
* @param int $shadow_presets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowPresetsProperties($shadow_presets)
|
||||
{
|
||||
$this->shadowProperties['presets'] = $shadow_presets;
|
||||
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Properties from Mapped Values.
|
||||
*
|
||||
* @param mixed &$reference
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
||||
{
|
||||
$base_reference = $reference;
|
||||
foreach ($properties_map as $property_key => $property_val) {
|
||||
if (is_array($property_val)) {
|
||||
if ($reference === null) {
|
||||
$reference = &$this->shadowProperties[$property_key];
|
||||
} else {
|
||||
$reference = &$reference[$property_key];
|
||||
}
|
||||
$this->setShadowProperiesMapValues($property_val, $reference);
|
||||
} else {
|
||||
if ($base_reference === null) {
|
||||
$this->shadowProperties[$property_key] = $property_val;
|
||||
} else {
|
||||
$reference[$property_key] = $property_val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Color.
|
||||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowColor($color, $alpha, $type)
|
||||
{
|
||||
$this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $type);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Blur.
|
||||
*
|
||||
* @param float $blur
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowBlur($blur)
|
||||
{
|
||||
if ($blur !== null) {
|
||||
$this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Angle.
|
||||
*
|
||||
* @param int $angle
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowAngle($angle)
|
||||
{
|
||||
if ($angle !== null) {
|
||||
$this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Distance.
|
||||
*
|
||||
* @param float $distance
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowDistance($distance)
|
||||
{
|
||||
if ($distance !== null) {
|
||||
$this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shadow Property.
|
||||
*
|
||||
* @param string|string[] $elements
|
||||
*
|
||||
* @return null|array|int|string
|
||||
*/
|
||||
public function getShadowProperty($elements)
|
||||
{
|
||||
return $this->getArrayElementsValue($this->shadowProperties, $elements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Glow Properties.
|
||||
*
|
||||
* @param float $size
|
||||
* @param string $color_value
|
||||
* @param int $color_alpha
|
||||
* @param string $color_type
|
||||
*/
|
||||
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null): void
|
||||
{
|
||||
$this->setGlowSize($size)
|
||||
->setGlowColor(
|
||||
$color_value === null ? $this->glowProperties['color']['value'] : $color_value,
|
||||
$color_alpha === null ? (int) $this->glowProperties['color']['alpha'] : $color_alpha,
|
||||
$color_type === null ? $this->glowProperties['color']['type'] : $color_type
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Glow Property.
|
||||
*
|
||||
* @param array|string $property
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGlowProperty($property)
|
||||
{
|
||||
return $this->getArrayElementsValue($this->glowProperties, $property);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Glow Color.
|
||||
*
|
||||
* @param float $size
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setGlowSize($size)
|
||||
{
|
||||
if ($size !== null) {
|
||||
$this->glowProperties['size'] = $this->getExcelPointsWidth($size);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Glow Color.
|
||||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setGlowColor($color, $alpha, $type)
|
||||
{
|
||||
$this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $type);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Soft Edges Size.
|
||||
*
|
||||
* @param float $size
|
||||
*/
|
||||
public function setSoftEdges($size): void
|
||||
{
|
||||
if ($size !== null) {
|
||||
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Soft Edges Size.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftEdgesSize()
|
||||
{
|
||||
return $this->softEdges['size'];
|
||||
}
|
||||
}
|
@ -1,663 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Settings;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class Chart
|
||||
{
|
||||
/**
|
||||
* Chart Name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $name = '';
|
||||
|
||||
/**
|
||||
* Worksheet.
|
||||
*
|
||||
* @var Worksheet
|
||||
*/
|
||||
private $worksheet;
|
||||
|
||||
/**
|
||||
* Chart Title.
|
||||
*
|
||||
* @var Title
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* Chart Legend.
|
||||
*
|
||||
* @var Legend
|
||||
*/
|
||||
private $legend;
|
||||
|
||||
/**
|
||||
* X-Axis Label.
|
||||
*
|
||||
* @var Title
|
||||
*/
|
||||
private $xAxisLabel;
|
||||
|
||||
/**
|
||||
* Y-Axis Label.
|
||||
*
|
||||
* @var Title
|
||||
*/
|
||||
private $yAxisLabel;
|
||||
|
||||
/**
|
||||
* Chart Plot Area.
|
||||
*
|
||||
* @var PlotArea
|
||||
*/
|
||||
private $plotArea;
|
||||
|
||||
/**
|
||||
* Plot Visible Only.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $plotVisibleOnly = true;
|
||||
|
||||
/**
|
||||
* Display Blanks as.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $displayBlanksAs = DataSeries::EMPTY_AS_GAP;
|
||||
|
||||
/**
|
||||
* Chart Asix Y as.
|
||||
*
|
||||
* @var Axis
|
||||
*/
|
||||
private $yAxis;
|
||||
|
||||
/**
|
||||
* Chart Asix X as.
|
||||
*
|
||||
* @var Axis
|
||||
*/
|
||||
private $xAxis;
|
||||
|
||||
/**
|
||||
* Chart Major Gridlines as.
|
||||
*
|
||||
* @var GridLines
|
||||
*/
|
||||
private $majorGridlines;
|
||||
|
||||
/**
|
||||
* Chart Minor Gridlines as.
|
||||
*
|
||||
* @var GridLines
|
||||
*/
|
||||
private $minorGridlines;
|
||||
|
||||
/**
|
||||
* Top-Left Cell Position.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $topLeftCellRef = 'A1';
|
||||
|
||||
/**
|
||||
* Top-Left X-Offset.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $topLeftXOffset = 0;
|
||||
|
||||
/**
|
||||
* Top-Left Y-Offset.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $topLeftYOffset = 0;
|
||||
|
||||
/**
|
||||
* Bottom-Right Cell Position.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $bottomRightCellRef = 'A1';
|
||||
|
||||
/**
|
||||
* Bottom-Right X-Offset.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $bottomRightXOffset = 10;
|
||||
|
||||
/**
|
||||
* Bottom-Right Y-Offset.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $bottomRightYOffset = 10;
|
||||
|
||||
/**
|
||||
* Create a new Chart.
|
||||
*
|
||||
* @param mixed $name
|
||||
* @param mixed $plotVisibleOnly
|
||||
* @param string $displayBlanksAs
|
||||
*/
|
||||
public function __construct($name, ?Title $title = null, ?Legend $legend = null, ?PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = DataSeries::EMPTY_AS_GAP, ?Title $xAxisLabel = null, ?Title $yAxisLabel = null, ?Axis $xAxis = null, ?Axis $yAxis = null, ?GridLines $majorGridlines = null, ?GridLines $minorGridlines = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->title = $title;
|
||||
$this->legend = $legend;
|
||||
$this->xAxisLabel = $xAxisLabel;
|
||||
$this->yAxisLabel = $yAxisLabel;
|
||||
$this->plotArea = $plotArea;
|
||||
$this->plotVisibleOnly = $plotVisibleOnly;
|
||||
$this->displayBlanksAs = $displayBlanksAs;
|
||||
$this->xAxis = $xAxis;
|
||||
$this->yAxis = $yAxis;
|
||||
$this->majorGridlines = $majorGridlines;
|
||||
$this->minorGridlines = $minorGridlines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Worksheet.
|
||||
*
|
||||
* @return Worksheet
|
||||
*/
|
||||
public function getWorksheet()
|
||||
{
|
||||
return $this->worksheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Worksheet.
|
||||
*
|
||||
* @param Worksheet $pValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWorksheet(?Worksheet $pValue = null)
|
||||
{
|
||||
$this->worksheet = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Title.
|
||||
*
|
||||
* @return Title
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Title.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTitle(Title $title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Legend.
|
||||
*
|
||||
* @return Legend
|
||||
*/
|
||||
public function getLegend()
|
||||
{
|
||||
return $this->legend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Legend.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLegend(Legend $legend)
|
||||
{
|
||||
$this->legend = $legend;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get X-Axis Label.
|
||||
*
|
||||
* @return Title
|
||||
*/
|
||||
public function getXAxisLabel()
|
||||
{
|
||||
return $this->xAxisLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set X-Axis Label.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setXAxisLabel(Title $label)
|
||||
{
|
||||
$this->xAxisLabel = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Y-Axis Label.
|
||||
*
|
||||
* @return Title
|
||||
*/
|
||||
public function getYAxisLabel()
|
||||
{
|
||||
return $this->yAxisLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Y-Axis Label.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setYAxisLabel(Title $label)
|
||||
{
|
||||
$this->yAxisLabel = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Area.
|
||||
*
|
||||
* @return PlotArea
|
||||
*/
|
||||
public function getPlotArea()
|
||||
{
|
||||
return $this->plotArea;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Visible Only.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getPlotVisibleOnly()
|
||||
{
|
||||
return $this->plotVisibleOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Plot Visible Only.
|
||||
*
|
||||
* @param bool $plotVisibleOnly
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlotVisibleOnly($plotVisibleOnly)
|
||||
{
|
||||
$this->plotVisibleOnly = $plotVisibleOnly;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Display Blanks as.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDisplayBlanksAs()
|
||||
{
|
||||
return $this->displayBlanksAs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Display Blanks as.
|
||||
*
|
||||
* @param string $displayBlanksAs
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDisplayBlanksAs($displayBlanksAs)
|
||||
{
|
||||
$this->displayBlanksAs = $displayBlanksAs;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get yAxis.
|
||||
*
|
||||
* @return Axis
|
||||
*/
|
||||
public function getChartAxisY()
|
||||
{
|
||||
if ($this->yAxis !== null) {
|
||||
return $this->yAxis;
|
||||
}
|
||||
|
||||
return new Axis();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get xAxis.
|
||||
*
|
||||
* @return Axis
|
||||
*/
|
||||
public function getChartAxisX()
|
||||
{
|
||||
if ($this->xAxis !== null) {
|
||||
return $this->xAxis;
|
||||
}
|
||||
|
||||
return new Axis();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Major Gridlines.
|
||||
*
|
||||
* @return GridLines
|
||||
*/
|
||||
public function getMajorGridlines()
|
||||
{
|
||||
if ($this->majorGridlines !== null) {
|
||||
return $this->majorGridlines;
|
||||
}
|
||||
|
||||
return new GridLines();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Minor Gridlines.
|
||||
*
|
||||
* @return GridLines
|
||||
*/
|
||||
public function getMinorGridlines()
|
||||
{
|
||||
if ($this->minorGridlines !== null) {
|
||||
return $this->minorGridlines;
|
||||
}
|
||||
|
||||
return new GridLines();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Top Left position for the chart.
|
||||
*
|
||||
* @param string $cell
|
||||
* @param int $xOffset
|
||||
* @param int $yOffset
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
|
||||
{
|
||||
$this->topLeftCellRef = $cell;
|
||||
if ($xOffset !== null) {
|
||||
$this->setTopLeftXOffset($xOffset);
|
||||
}
|
||||
if ($yOffset !== null) {
|
||||
$this->setTopLeftYOffset($yOffset);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the top left position of the chart.
|
||||
*
|
||||
* @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
|
||||
*/
|
||||
public function getTopLeftPosition()
|
||||
{
|
||||
return [
|
||||
'cell' => $this->topLeftCellRef,
|
||||
'xOffset' => $this->topLeftXOffset,
|
||||
'yOffset' => $this->topLeftYOffset,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cell address where the top left of the chart is fixed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTopLeftCell()
|
||||
{
|
||||
return $this->topLeftCellRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Top Left cell position for the chart.
|
||||
*
|
||||
* @param string $cell
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTopLeftCell($cell)
|
||||
{
|
||||
$this->topLeftCellRef = $cell;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the offset position within the Top Left cell for the chart.
|
||||
*
|
||||
* @param int $xOffset
|
||||
* @param int $yOffset
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTopLeftOffset($xOffset, $yOffset)
|
||||
{
|
||||
if ($xOffset !== null) {
|
||||
$this->setTopLeftXOffset($xOffset);
|
||||
}
|
||||
|
||||
if ($yOffset !== null) {
|
||||
$this->setTopLeftYOffset($yOffset);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the offset position within the Top Left cell for the chart.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getTopLeftOffset()
|
||||
{
|
||||
return [
|
||||
'X' => $this->topLeftXOffset,
|
||||
'Y' => $this->topLeftYOffset,
|
||||
];
|
||||
}
|
||||
|
||||
public function setTopLeftXOffset($xOffset)
|
||||
{
|
||||
$this->topLeftXOffset = $xOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTopLeftXOffset()
|
||||
{
|
||||
return $this->topLeftXOffset;
|
||||
}
|
||||
|
||||
public function setTopLeftYOffset($yOffset)
|
||||
{
|
||||
$this->topLeftYOffset = $yOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTopLeftYOffset()
|
||||
{
|
||||
return $this->topLeftYOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Bottom Right position of the chart.
|
||||
*
|
||||
* @param string $cell
|
||||
* @param int $xOffset
|
||||
* @param int $yOffset
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null)
|
||||
{
|
||||
$this->bottomRightCellRef = $cell;
|
||||
if ($xOffset !== null) {
|
||||
$this->setBottomRightXOffset($xOffset);
|
||||
}
|
||||
if ($yOffset !== null) {
|
||||
$this->setBottomRightYOffset($yOffset);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bottom right position of the chart.
|
||||
*
|
||||
* @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
|
||||
*/
|
||||
public function getBottomRightPosition()
|
||||
{
|
||||
return [
|
||||
'cell' => $this->bottomRightCellRef,
|
||||
'xOffset' => $this->bottomRightXOffset,
|
||||
'yOffset' => $this->bottomRightYOffset,
|
||||
];
|
||||
}
|
||||
|
||||
public function setBottomRightCell($cell)
|
||||
{
|
||||
$this->bottomRightCellRef = $cell;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cell address where the bottom right of the chart is fixed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBottomRightCell()
|
||||
{
|
||||
return $this->bottomRightCellRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the offset position within the Bottom Right cell for the chart.
|
||||
*
|
||||
* @param int $xOffset
|
||||
* @param int $yOffset
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBottomRightOffset($xOffset, $yOffset)
|
||||
{
|
||||
if ($xOffset !== null) {
|
||||
$this->setBottomRightXOffset($xOffset);
|
||||
}
|
||||
|
||||
if ($yOffset !== null) {
|
||||
$this->setBottomRightYOffset($yOffset);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the offset position within the Bottom Right cell for the chart.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getBottomRightOffset()
|
||||
{
|
||||
return [
|
||||
'X' => $this->bottomRightXOffset,
|
||||
'Y' => $this->bottomRightYOffset,
|
||||
];
|
||||
}
|
||||
|
||||
public function setBottomRightXOffset($xOffset)
|
||||
{
|
||||
$this->bottomRightXOffset = $xOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBottomRightXOffset()
|
||||
{
|
||||
return $this->bottomRightXOffset;
|
||||
}
|
||||
|
||||
public function setBottomRightYOffset($yOffset)
|
||||
{
|
||||
$this->bottomRightYOffset = $yOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBottomRightYOffset()
|
||||
{
|
||||
return $this->bottomRightYOffset;
|
||||
}
|
||||
|
||||
public function refresh(): void
|
||||
{
|
||||
if ($this->worksheet !== null) {
|
||||
$this->plotArea->refresh($this->worksheet);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the chart to given file (or stream).
|
||||
*
|
||||
* @param string $outputDestination Name of the file render to
|
||||
*
|
||||
* @return bool true on success
|
||||
*/
|
||||
public function render($outputDestination = null)
|
||||
{
|
||||
if ($outputDestination == 'php://output') {
|
||||
$outputDestination = null;
|
||||
}
|
||||
|
||||
$libraryName = Settings::getChartRenderer();
|
||||
if ($libraryName === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ensure that data series values are up-to-date before we render
|
||||
$this->refresh();
|
||||
|
||||
$renderer = new $libraryName($this);
|
||||
|
||||
return $renderer->render($outputDestination);
|
||||
}
|
||||
}
|
@ -1,394 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class DataSeries
|
||||
{
|
||||
const TYPE_BARCHART = 'barChart';
|
||||
const TYPE_BARCHART_3D = 'bar3DChart';
|
||||
const TYPE_LINECHART = 'lineChart';
|
||||
const TYPE_LINECHART_3D = 'line3DChart';
|
||||
const TYPE_AREACHART = 'areaChart';
|
||||
const TYPE_AREACHART_3D = 'area3DChart';
|
||||
const TYPE_PIECHART = 'pieChart';
|
||||
const TYPE_PIECHART_3D = 'pie3DChart';
|
||||
const TYPE_DOUGHNUTCHART = 'doughnutChart';
|
||||
const TYPE_DONUTCHART = self::TYPE_DOUGHNUTCHART; // Synonym
|
||||
const TYPE_SCATTERCHART = 'scatterChart';
|
||||
const TYPE_SURFACECHART = 'surfaceChart';
|
||||
const TYPE_SURFACECHART_3D = 'surface3DChart';
|
||||
const TYPE_RADARCHART = 'radarChart';
|
||||
const TYPE_BUBBLECHART = 'bubbleChart';
|
||||
const TYPE_STOCKCHART = 'stockChart';
|
||||
const TYPE_CANDLECHART = self::TYPE_STOCKCHART; // Synonym
|
||||
|
||||
const GROUPING_CLUSTERED = 'clustered';
|
||||
const GROUPING_STACKED = 'stacked';
|
||||
const GROUPING_PERCENT_STACKED = 'percentStacked';
|
||||
const GROUPING_STANDARD = 'standard';
|
||||
|
||||
const DIRECTION_BAR = 'bar';
|
||||
const DIRECTION_HORIZONTAL = self::DIRECTION_BAR;
|
||||
const DIRECTION_COL = 'col';
|
||||
const DIRECTION_COLUMN = self::DIRECTION_COL;
|
||||
const DIRECTION_VERTICAL = self::DIRECTION_COL;
|
||||
|
||||
const STYLE_LINEMARKER = 'lineMarker';
|
||||
const STYLE_SMOOTHMARKER = 'smoothMarker';
|
||||
const STYLE_MARKER = 'marker';
|
||||
const STYLE_FILLED = 'filled';
|
||||
|
||||
const EMPTY_AS_GAP = 'gap';
|
||||
const EMPTY_AS_ZERO = 'zero';
|
||||
const EMPTY_AS_SPAN = 'span';
|
||||
|
||||
/**
|
||||
* Series Plot Type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $plotType;
|
||||
|
||||
/**
|
||||
* Plot Grouping Type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $plotGrouping;
|
||||
|
||||
/**
|
||||
* Plot Direction.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $plotDirection;
|
||||
|
||||
/**
|
||||
* Plot Style.
|
||||
*
|
||||
* @var null|string
|
||||
*/
|
||||
private $plotStyle;
|
||||
|
||||
/**
|
||||
* Order of plots in Series.
|
||||
*
|
||||
* @var array of integer
|
||||
*/
|
||||
private $plotOrder = [];
|
||||
|
||||
/**
|
||||
* Plot Label.
|
||||
*
|
||||
* @var array of DataSeriesValues
|
||||
*/
|
||||
private $plotLabel = [];
|
||||
|
||||
/**
|
||||
* Plot Category.
|
||||
*
|
||||
* @var array of DataSeriesValues
|
||||
*/
|
||||
private $plotCategory = [];
|
||||
|
||||
/**
|
||||
* Smooth Line.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $smoothLine;
|
||||
|
||||
/**
|
||||
* Plot Values.
|
||||
*
|
||||
* @var array of DataSeriesValues
|
||||
*/
|
||||
private $plotValues = [];
|
||||
|
||||
/**
|
||||
* Create a new DataSeries.
|
||||
*
|
||||
* @param null|mixed $plotType
|
||||
* @param null|mixed $plotGrouping
|
||||
* @param int[] $plotOrder
|
||||
* @param DataSeriesValues[] $plotLabel
|
||||
* @param DataSeriesValues[] $plotCategory
|
||||
* @param DataSeriesValues[] $plotValues
|
||||
* @param null|string $plotDirection
|
||||
* @param bool $smoothLine
|
||||
* @param null|string $plotStyle
|
||||
*/
|
||||
public function __construct($plotType = null, $plotGrouping = null, array $plotOrder = [], array $plotLabel = [], array $plotCategory = [], array $plotValues = [], $plotDirection = null, $smoothLine = false, $plotStyle = null)
|
||||
{
|
||||
$this->plotType = $plotType;
|
||||
$this->plotGrouping = $plotGrouping;
|
||||
$this->plotOrder = $plotOrder;
|
||||
$keys = array_keys($plotValues);
|
||||
$this->plotValues = $plotValues;
|
||||
if ((count($plotLabel) == 0) || ($plotLabel[$keys[0]] === null)) {
|
||||
$plotLabel[$keys[0]] = new DataSeriesValues();
|
||||
}
|
||||
$this->plotLabel = $plotLabel;
|
||||
|
||||
if ((count($plotCategory) == 0) || ($plotCategory[$keys[0]] === null)) {
|
||||
$plotCategory[$keys[0]] = new DataSeriesValues();
|
||||
}
|
||||
$this->plotCategory = $plotCategory;
|
||||
|
||||
$this->smoothLine = $smoothLine;
|
||||
$this->plotStyle = $plotStyle;
|
||||
|
||||
if ($plotDirection === null) {
|
||||
$plotDirection = self::DIRECTION_COL;
|
||||
}
|
||||
$this->plotDirection = $plotDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlotType()
|
||||
{
|
||||
return $this->plotType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Plot Type.
|
||||
*
|
||||
* @param string $plotType
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlotType($plotType)
|
||||
{
|
||||
$this->plotType = $plotType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Grouping Type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlotGrouping()
|
||||
{
|
||||
return $this->plotGrouping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Plot Grouping Type.
|
||||
*
|
||||
* @param string $groupingType
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlotGrouping($groupingType)
|
||||
{
|
||||
$this->plotGrouping = $groupingType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Direction.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlotDirection()
|
||||
{
|
||||
return $this->plotDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Plot Direction.
|
||||
*
|
||||
* @param string $plotDirection
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlotDirection($plotDirection)
|
||||
{
|
||||
$this->plotDirection = $plotDirection;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Order.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getPlotOrder()
|
||||
{
|
||||
return $this->plotOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Labels.
|
||||
*
|
||||
* @return array of DataSeriesValues
|
||||
*/
|
||||
public function getPlotLabels()
|
||||
{
|
||||
return $this->plotLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Label by Index.
|
||||
*
|
||||
* @param mixed $index
|
||||
*
|
||||
* @return DataSeriesValues
|
||||
*/
|
||||
public function getPlotLabelByIndex($index)
|
||||
{
|
||||
$keys = array_keys($this->plotLabel);
|
||||
if (in_array($index, $keys)) {
|
||||
return $this->plotLabel[$index];
|
||||
} elseif (isset($keys[$index])) {
|
||||
return $this->plotLabel[$keys[$index]];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Categories.
|
||||
*
|
||||
* @return array of DataSeriesValues
|
||||
*/
|
||||
public function getPlotCategories()
|
||||
{
|
||||
return $this->plotCategory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Category by Index.
|
||||
*
|
||||
* @param mixed $index
|
||||
*
|
||||
* @return DataSeriesValues
|
||||
*/
|
||||
public function getPlotCategoryByIndex($index)
|
||||
{
|
||||
$keys = array_keys($this->plotCategory);
|
||||
if (in_array($index, $keys)) {
|
||||
return $this->plotCategory[$index];
|
||||
} elseif (isset($keys[$index])) {
|
||||
return $this->plotCategory[$keys[$index]];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Style.
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getPlotStyle()
|
||||
{
|
||||
return $this->plotStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Plot Style.
|
||||
*
|
||||
* @param null|string $plotStyle
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlotStyle($plotStyle)
|
||||
{
|
||||
$this->plotStyle = $plotStyle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Values.
|
||||
*
|
||||
* @return array of DataSeriesValues
|
||||
*/
|
||||
public function getPlotValues()
|
||||
{
|
||||
return $this->plotValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Values by Index.
|
||||
*
|
||||
* @param mixed $index
|
||||
*
|
||||
* @return DataSeriesValues
|
||||
*/
|
||||
public function getPlotValuesByIndex($index)
|
||||
{
|
||||
$keys = array_keys($this->plotValues);
|
||||
if (in_array($index, $keys)) {
|
||||
return $this->plotValues[$index];
|
||||
} elseif (isset($keys[$index])) {
|
||||
return $this->plotValues[$keys[$index]];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Number of Plot Series.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPlotSeriesCount()
|
||||
{
|
||||
return count($this->plotValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Smooth Line.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSmoothLine()
|
||||
{
|
||||
return $this->smoothLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Smooth Line.
|
||||
*
|
||||
* @param bool $smoothLine
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSmoothLine($smoothLine)
|
||||
{
|
||||
$this->smoothLine = $smoothLine;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function refresh(Worksheet $worksheet): void
|
||||
{
|
||||
foreach ($this->plotValues as $plotValues) {
|
||||
if ($plotValues !== null) {
|
||||
$plotValues->refresh($worksheet, true);
|
||||
}
|
||||
}
|
||||
foreach ($this->plotLabel as $plotValues) {
|
||||
if ($plotValues !== null) {
|
||||
$plotValues->refresh($worksheet, true);
|
||||
}
|
||||
}
|
||||
foreach ($this->plotCategory as $plotValues) {
|
||||
if ($plotValues !== null) {
|
||||
$plotValues->refresh($worksheet, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,397 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class DataSeriesValues
|
||||
{
|
||||
const DATASERIES_TYPE_STRING = 'String';
|
||||
const DATASERIES_TYPE_NUMBER = 'Number';
|
||||
|
||||
private static $dataTypeValues = [
|
||||
self::DATASERIES_TYPE_STRING,
|
||||
self::DATASERIES_TYPE_NUMBER,
|
||||
];
|
||||
|
||||
/**
|
||||
* Series Data Type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $dataType;
|
||||
|
||||
/**
|
||||
* Series Data Source.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $dataSource;
|
||||
|
||||
/**
|
||||
* Format Code.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $formatCode;
|
||||
|
||||
/**
|
||||
* Series Point Marker.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $pointMarker;
|
||||
|
||||
/**
|
||||
* Point Count (The number of datapoints in the dataseries).
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $pointCount = 0;
|
||||
|
||||
/**
|
||||
* Data Values.
|
||||
*
|
||||
* @var array of mixed
|
||||
*/
|
||||
private $dataValues = [];
|
||||
|
||||
/**
|
||||
* Fill color (can be array with colors if dataseries have custom colors).
|
||||
*
|
||||
* @var string|string[]
|
||||
*/
|
||||
private $fillColor;
|
||||
|
||||
/**
|
||||
* Line Width.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $lineWidth = 12700;
|
||||
|
||||
/**
|
||||
* Create a new DataSeriesValues object.
|
||||
*
|
||||
* @param string $dataType
|
||||
* @param string $dataSource
|
||||
* @param null|mixed $formatCode
|
||||
* @param int $pointCount
|
||||
* @param mixed $dataValues
|
||||
* @param null|mixed $marker
|
||||
* @param null|string|string[] $fillColor
|
||||
*/
|
||||
public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = [], $marker = null, $fillColor = null)
|
||||
{
|
||||
$this->setDataType($dataType);
|
||||
$this->dataSource = $dataSource;
|
||||
$this->formatCode = $formatCode;
|
||||
$this->pointCount = $pointCount;
|
||||
$this->dataValues = $dataValues;
|
||||
$this->pointMarker = $marker;
|
||||
$this->fillColor = $fillColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Series Data Type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDataType()
|
||||
{
|
||||
return $this->dataType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Series Data Type.
|
||||
*
|
||||
* @param string $dataType Datatype of this data series
|
||||
* Typical values are:
|
||||
* DataSeriesValues::DATASERIES_TYPE_STRING
|
||||
* Normally used for axis point values
|
||||
* DataSeriesValues::DATASERIES_TYPE_NUMBER
|
||||
* Normally used for chart data values
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDataType($dataType)
|
||||
{
|
||||
if (!in_array($dataType, self::$dataTypeValues)) {
|
||||
throw new Exception('Invalid datatype for chart data series values');
|
||||
}
|
||||
$this->dataType = $dataType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Series Data Source (formula).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDataSource()
|
||||
{
|
||||
return $this->dataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Series Data Source (formula).
|
||||
*
|
||||
* @param string $dataSource
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDataSource($dataSource)
|
||||
{
|
||||
$this->dataSource = $dataSource;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Point Marker.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPointMarker()
|
||||
{
|
||||
return $this->pointMarker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Point Marker.
|
||||
*
|
||||
* @param string $marker
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPointMarker($marker)
|
||||
{
|
||||
$this->pointMarker = $marker;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Series Format Code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormatCode()
|
||||
{
|
||||
return $this->formatCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Series Format Code.
|
||||
*
|
||||
* @param string $formatCode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFormatCode($formatCode)
|
||||
{
|
||||
$this->formatCode = $formatCode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Series Point Count.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPointCount()
|
||||
{
|
||||
return $this->pointCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fill color.
|
||||
*
|
||||
* @return string|string[] HEX color or array with HEX colors
|
||||
*/
|
||||
public function getFillColor()
|
||||
{
|
||||
return $this->fillColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fill color for series.
|
||||
*
|
||||
* @param string|string[] $color HEX color or array with HEX colors
|
||||
*
|
||||
* @return DataSeriesValues
|
||||
*/
|
||||
public function setFillColor($color)
|
||||
{
|
||||
if (is_array($color)) {
|
||||
foreach ($color as $colorValue) {
|
||||
$this->validateColor($colorValue);
|
||||
}
|
||||
} else {
|
||||
$this->validateColor($color);
|
||||
}
|
||||
$this->fillColor = $color;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method for validating hex color.
|
||||
*
|
||||
* @param string $color value for color
|
||||
*
|
||||
* @return bool true if validation was successful
|
||||
*/
|
||||
private function validateColor($color)
|
||||
{
|
||||
if (!preg_match('/^[a-f0-9]{6}$/i', $color)) {
|
||||
throw new Exception(sprintf('Invalid hex color for chart series (color: "%s")', $color));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get line width for series.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLineWidth()
|
||||
{
|
||||
return $this->lineWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set line width for the series.
|
||||
*
|
||||
* @param int $width
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLineWidth($width)
|
||||
{
|
||||
$minWidth = 12700;
|
||||
$this->lineWidth = max($minWidth, $width);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identify if the Data Series is a multi-level or a simple series.
|
||||
*
|
||||
* @return null|bool
|
||||
*/
|
||||
public function isMultiLevelSeries()
|
||||
{
|
||||
if (count($this->dataValues) > 0) {
|
||||
return is_array(array_values($this->dataValues)[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the level count of a multi-level Data Series.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function multiLevelCount()
|
||||
{
|
||||
$levelCount = 0;
|
||||
foreach ($this->dataValues as $dataValueSet) {
|
||||
$levelCount = max($levelCount, count($dataValueSet));
|
||||
}
|
||||
|
||||
return $levelCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Series Data Values.
|
||||
*
|
||||
* @return array of mixed
|
||||
*/
|
||||
public function getDataValues()
|
||||
{
|
||||
return $this->dataValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first Series Data value.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDataValue()
|
||||
{
|
||||
$count = count($this->dataValues);
|
||||
if ($count == 0) {
|
||||
return null;
|
||||
} elseif ($count == 1) {
|
||||
return $this->dataValues[0];
|
||||
}
|
||||
|
||||
return $this->dataValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Series Data Values.
|
||||
*
|
||||
* @param array $dataValues
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDataValues($dataValues)
|
||||
{
|
||||
$this->dataValues = Functions::flattenArray($dataValues);
|
||||
$this->pointCount = count($dataValues);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function refresh(Worksheet $worksheet, $flatten = true): void
|
||||
{
|
||||
if ($this->dataSource !== null) {
|
||||
$calcEngine = Calculation::getInstance($worksheet->getParent());
|
||||
$newDataValues = Calculation::unwrapResult(
|
||||
$calcEngine->_calculateFormulaValue(
|
||||
'=' . $this->dataSource,
|
||||
null,
|
||||
$worksheet->getCell('A1')
|
||||
)
|
||||
);
|
||||
if ($flatten) {
|
||||
$this->dataValues = Functions::flattenArray($newDataValues);
|
||||
foreach ($this->dataValues as &$dataValue) {
|
||||
if (is_string($dataValue) && !empty($dataValue) && $dataValue[0] == '#') {
|
||||
$dataValue = 0.0;
|
||||
}
|
||||
}
|
||||
unset($dataValue);
|
||||
} else {
|
||||
[$worksheet, $cellRange] = Worksheet::extractSheetTitle($this->dataSource, true);
|
||||
$dimensions = Coordinate::rangeDimension(str_replace('$', '', $cellRange));
|
||||
if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
|
||||
$this->dataValues = Functions::flattenArray($newDataValues);
|
||||
} else {
|
||||
$newArray = array_values(array_shift($newDataValues));
|
||||
foreach ($newArray as $i => $newDataSet) {
|
||||
$newArray[$i] = [$newDataSet];
|
||||
}
|
||||
|
||||
foreach ($newDataValues as $newDataSet) {
|
||||
$i = 0;
|
||||
foreach ($newDataSet as $newDataVal) {
|
||||
array_unshift($newArray[$i++], $newDataVal);
|
||||
}
|
||||
}
|
||||
$this->dataValues = $newArray;
|
||||
}
|
||||
}
|
||||
$this->pointCount = count($this->dataValues);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
|
||||
|
||||
class Exception extends PhpSpreadsheetException
|
||||
{
|
||||
}
|
@ -1,454 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wiktor Trzonkowski
|
||||
* Date: 7/2/14
|
||||
* Time: 2:36 PM.
|
||||
*/
|
||||
class GridLines extends Properties
|
||||
{
|
||||
/**
|
||||
* Properties of Class:
|
||||
* Object State (State for Minor Tick Mark) @var bool
|
||||
* Line Properties @var array of mixed
|
||||
* Shadow Properties @var array of mixed
|
||||
* Glow Properties @var array of mixed
|
||||
* Soft Properties @var array of mixed.
|
||||
*/
|
||||
private $objectState = false;
|
||||
|
||||
private $lineProperties = [
|
||||
'color' => [
|
||||
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
||||
'value' => null,
|
||||
'alpha' => 0,
|
||||
],
|
||||
'style' => [
|
||||
'width' => '9525',
|
||||
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
|
||||
'dash' => self::LINE_STYLE_DASH_SOLID,
|
||||
'cap' => self::LINE_STYLE_CAP_FLAT,
|
||||
'join' => self::LINE_STYLE_JOIN_BEVEL,
|
||||
'arrow' => [
|
||||
'head' => [
|
||||
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
||||
'size' => self::LINE_STYLE_ARROW_SIZE_5,
|
||||
],
|
||||
'end' => [
|
||||
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
|
||||
'size' => self::LINE_STYLE_ARROW_SIZE_8,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
private $shadowProperties = [
|
||||
'presets' => self::SHADOW_PRESETS_NOSHADOW,
|
||||
'effect' => null,
|
||||
'color' => [
|
||||
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
||||
'value' => 'black',
|
||||
'alpha' => 85,
|
||||
],
|
||||
'size' => [
|
||||
'sx' => null,
|
||||
'sy' => null,
|
||||
'kx' => null,
|
||||
],
|
||||
'blur' => null,
|
||||
'direction' => null,
|
||||
'distance' => null,
|
||||
'algn' => null,
|
||||
'rotWithShape' => null,
|
||||
];
|
||||
|
||||
private $glowProperties = [
|
||||
'size' => null,
|
||||
'color' => [
|
||||
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
|
||||
'value' => 'black',
|
||||
'alpha' => 40,
|
||||
],
|
||||
];
|
||||
|
||||
private $softEdges = [
|
||||
'size' => null,
|
||||
];
|
||||
|
||||
/**
|
||||
* Get Object State.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getObjectState()
|
||||
{
|
||||
return $this->objectState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Object State to True.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function activateObject()
|
||||
{
|
||||
$this->objectState = true;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Line Color Properties.
|
||||
*
|
||||
* @param string $value
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*/
|
||||
public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD): void
|
||||
{
|
||||
$this->activateObject()
|
||||
->lineProperties['color'] = $this->setColorProperties(
|
||||
$value,
|
||||
$alpha,
|
||||
$type
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Line Color Properties.
|
||||
*
|
||||
* @param float $line_width
|
||||
* @param string $compound_type
|
||||
* @param string $dash_type
|
||||
* @param string $cap_type
|
||||
* @param string $join_type
|
||||
* @param string $head_arrow_type
|
||||
* @param string $head_arrow_size
|
||||
* @param string $end_arrow_type
|
||||
* @param string $end_arrow_size
|
||||
*/
|
||||
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null): void
|
||||
{
|
||||
$this->activateObject();
|
||||
($line_width !== null)
|
||||
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
|
||||
: null;
|
||||
($compound_type !== null)
|
||||
? $this->lineProperties['style']['compound'] = (string) $compound_type
|
||||
: null;
|
||||
($dash_type !== null)
|
||||
? $this->lineProperties['style']['dash'] = (string) $dash_type
|
||||
: null;
|
||||
($cap_type !== null)
|
||||
? $this->lineProperties['style']['cap'] = (string) $cap_type
|
||||
: null;
|
||||
($join_type !== null)
|
||||
? $this->lineProperties['style']['join'] = (string) $join_type
|
||||
: null;
|
||||
($head_arrow_type !== null)
|
||||
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type
|
||||
: null;
|
||||
($head_arrow_size !== null)
|
||||
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size
|
||||
: null;
|
||||
($end_arrow_type !== null)
|
||||
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type
|
||||
: null;
|
||||
($end_arrow_size !== null)
|
||||
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Color Property.
|
||||
*
|
||||
* @param string $parameter
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineColorProperty($parameter)
|
||||
{
|
||||
return $this->lineProperties['color'][$parameter];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Style Property.
|
||||
*
|
||||
* @param array|string $elements
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineStyleProperty($elements)
|
||||
{
|
||||
return $this->getArrayElementsValue($this->lineProperties['style'], $elements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Glow Properties.
|
||||
*
|
||||
* @param float $size
|
||||
* @param string $color_value
|
||||
* @param int $color_alpha
|
||||
* @param string $color_type
|
||||
*/
|
||||
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null): void
|
||||
{
|
||||
$this
|
||||
->activateObject()
|
||||
->setGlowSize($size)
|
||||
->setGlowColor($color_value, $color_alpha, $color_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Glow Color Property.
|
||||
*
|
||||
* @param string $property
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGlowColor($property)
|
||||
{
|
||||
return $this->glowProperties['color'][$property];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Glow Size.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGlowSize()
|
||||
{
|
||||
return $this->glowProperties['size'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Glow Size.
|
||||
*
|
||||
* @param float $size
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setGlowSize($size)
|
||||
{
|
||||
$this->glowProperties['size'] = $this->getExcelPointsWidth((float) $size);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Glow Color.
|
||||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setGlowColor($color, $alpha, $type)
|
||||
{
|
||||
if ($color !== null) {
|
||||
$this->glowProperties['color']['value'] = (string) $color;
|
||||
}
|
||||
if ($alpha !== null) {
|
||||
$this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
||||
}
|
||||
if ($type !== null) {
|
||||
$this->glowProperties['color']['type'] = (string) $type;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Style Arrow Parameters.
|
||||
*
|
||||
* @param string $arrow_selector
|
||||
* @param string $property_selector
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLineStyleArrowParameters($arrow_selector, $property_selector)
|
||||
{
|
||||
return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Properties.
|
||||
*
|
||||
* @param int $sh_presets
|
||||
* @param string $sh_color_value
|
||||
* @param string $sh_color_type
|
||||
* @param int $sh_color_alpha
|
||||
* @param string $sh_blur
|
||||
* @param int $sh_angle
|
||||
* @param float $sh_distance
|
||||
*/
|
||||
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null): void
|
||||
{
|
||||
$this->activateObject()
|
||||
->setShadowPresetsProperties((int) $sh_presets)
|
||||
->setShadowColor(
|
||||
$sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
||||
$sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha),
|
||||
$sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type
|
||||
)
|
||||
->setShadowBlur($sh_blur)
|
||||
->setShadowAngle($sh_angle)
|
||||
->setShadowDistance($sh_distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Presets Properties.
|
||||
*
|
||||
* @param int $shadow_presets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowPresetsProperties($shadow_presets)
|
||||
{
|
||||
$this->shadowProperties['presets'] = $shadow_presets;
|
||||
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Properties Values.
|
||||
*
|
||||
* @param mixed &$reference
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
||||
{
|
||||
$base_reference = $reference;
|
||||
foreach ($properties_map as $property_key => $property_val) {
|
||||
if (is_array($property_val)) {
|
||||
if ($reference === null) {
|
||||
$reference = &$this->shadowProperties[$property_key];
|
||||
} else {
|
||||
$reference = &$reference[$property_key];
|
||||
}
|
||||
$this->setShadowProperiesMapValues($property_val, $reference);
|
||||
} else {
|
||||
if ($base_reference === null) {
|
||||
$this->shadowProperties[$property_key] = $property_val;
|
||||
} else {
|
||||
$reference[$property_key] = $property_val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Color.
|
||||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowColor($color, $alpha, $type)
|
||||
{
|
||||
if ($color !== null) {
|
||||
$this->shadowProperties['color']['value'] = (string) $color;
|
||||
}
|
||||
if ($alpha !== null) {
|
||||
$this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
||||
}
|
||||
if ($type !== null) {
|
||||
$this->shadowProperties['color']['type'] = (string) $type;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Blur.
|
||||
*
|
||||
* @param float $blur
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowBlur($blur)
|
||||
{
|
||||
if ($blur !== null) {
|
||||
$this->shadowProperties['blur'] = (string) $this->getExcelPointsWidth($blur);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Angle.
|
||||
*
|
||||
* @param int $angle
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowAngle($angle)
|
||||
{
|
||||
if ($angle !== null) {
|
||||
$this->shadowProperties['direction'] = (string) $this->getExcelPointsAngle($angle);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Distance.
|
||||
*
|
||||
* @param float $distance
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowDistance($distance)
|
||||
{
|
||||
if ($distance !== null) {
|
||||
$this->shadowProperties['distance'] = (string) $this->getExcelPointsWidth($distance);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Shadow Property.
|
||||
*
|
||||
* @param string|string[] $elements
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShadowProperty($elements)
|
||||
{
|
||||
return $this->getArrayElementsValue($this->shadowProperties, $elements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Soft Edges Size.
|
||||
*
|
||||
* @param float $size
|
||||
*/
|
||||
public function setSoftEdgesSize($size): void
|
||||
{
|
||||
if ($size !== null) {
|
||||
$this->activateObject();
|
||||
$this->softEdges['size'] = (string) $this->getExcelPointsWidth($size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Soft Edges Size.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSoftEdgesSize()
|
||||
{
|
||||
return $this->softEdges['size'];
|
||||
}
|
||||
}
|
@ -1,481 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
class Layout
|
||||
{
|
||||
/**
|
||||
* layoutTarget.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $layoutTarget;
|
||||
|
||||
/**
|
||||
* X Mode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $xMode;
|
||||
|
||||
/**
|
||||
* Y Mode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $yMode;
|
||||
|
||||
/**
|
||||
* X-Position.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
private $xPos;
|
||||
|
||||
/**
|
||||
* Y-Position.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
private $yPos;
|
||||
|
||||
/**
|
||||
* width.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
private $width;
|
||||
|
||||
/**
|
||||
* height.
|
||||
*
|
||||
* @var float
|
||||
*/
|
||||
private $height;
|
||||
|
||||
/**
|
||||
* show legend key
|
||||
* Specifies that legend keys should be shown in data labels.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showLegendKey;
|
||||
|
||||
/**
|
||||
* show value
|
||||
* Specifies that the value should be shown in a data label.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showVal;
|
||||
|
||||
/**
|
||||
* show category name
|
||||
* Specifies that the category name should be shown in the data label.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showCatName;
|
||||
|
||||
/**
|
||||
* show data series name
|
||||
* Specifies that the series name should be shown in the data label.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showSerName;
|
||||
|
||||
/**
|
||||
* show percentage
|
||||
* Specifies that the percentage should be shown in the data label.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showPercent;
|
||||
|
||||
/**
|
||||
* show bubble size.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showBubbleSize;
|
||||
|
||||
/**
|
||||
* show leader lines
|
||||
* Specifies that leader lines should be shown for the data label.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $showLeaderLines;
|
||||
|
||||
/**
|
||||
* Create a new Layout.
|
||||
*/
|
||||
public function __construct(array $layout = [])
|
||||
{
|
||||
if (isset($layout['layoutTarget'])) {
|
||||
$this->layoutTarget = $layout['layoutTarget'];
|
||||
}
|
||||
if (isset($layout['xMode'])) {
|
||||
$this->xMode = $layout['xMode'];
|
||||
}
|
||||
if (isset($layout['yMode'])) {
|
||||
$this->yMode = $layout['yMode'];
|
||||
}
|
||||
if (isset($layout['x'])) {
|
||||
$this->xPos = (float) $layout['x'];
|
||||
}
|
||||
if (isset($layout['y'])) {
|
||||
$this->yPos = (float) $layout['y'];
|
||||
}
|
||||
if (isset($layout['w'])) {
|
||||
$this->width = (float) $layout['w'];
|
||||
}
|
||||
if (isset($layout['h'])) {
|
||||
$this->height = (float) $layout['h'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Layout Target.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLayoutTarget()
|
||||
{
|
||||
return $this->layoutTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Layout Target.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLayoutTarget($value)
|
||||
{
|
||||
$this->layoutTarget = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get X-Mode.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getXMode()
|
||||
{
|
||||
return $this->xMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set X-Mode.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setXMode($value)
|
||||
{
|
||||
$this->xMode = (string) $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Y-Mode.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getYMode()
|
||||
{
|
||||
return $this->yMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Y-Mode.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setYMode($value)
|
||||
{
|
||||
$this->yMode = (string) $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get X-Position.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
public function getXPosition()
|
||||
{
|
||||
return $this->xPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set X-Position.
|
||||
*
|
||||
* @param float $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setXPosition($value)
|
||||
{
|
||||
$this->xPos = (float) $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Y-Position.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
public function getYPosition()
|
||||
{
|
||||
return $this->yPos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Y-Position.
|
||||
*
|
||||
* @param float $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setYPosition($value)
|
||||
{
|
||||
$this->yPos = (float) $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Width.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Width.
|
||||
*
|
||||
* @param float $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWidth($value)
|
||||
{
|
||||
$this->width = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Height.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
public function getHeight()
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Height.
|
||||
*
|
||||
* @param float $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeight($value)
|
||||
{
|
||||
$this->height = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show legend key.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowLegendKey()
|
||||
{
|
||||
return $this->showLegendKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show legend key
|
||||
* Specifies that legend keys should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show legend key
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowLegendKey($value)
|
||||
{
|
||||
$this->showLegendKey = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show value.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowVal()
|
||||
{
|
||||
return $this->showVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show val
|
||||
* Specifies that the value should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show val
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowVal($value)
|
||||
{
|
||||
$this->showVal = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show category name.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowCatName()
|
||||
{
|
||||
return $this->showCatName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show cat name
|
||||
* Specifies that the category name should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show cat name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowCatName($value)
|
||||
{
|
||||
$this->showCatName = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show data series name.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowSerName()
|
||||
{
|
||||
return $this->showSerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show ser name
|
||||
* Specifies that the series name should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show series name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowSerName($value)
|
||||
{
|
||||
$this->showSerName = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show percentage.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowPercent()
|
||||
{
|
||||
return $this->showPercent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show percentage
|
||||
* Specifies that the percentage should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show percentage
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowPercent($value)
|
||||
{
|
||||
$this->showPercent = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show bubble size.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowBubbleSize()
|
||||
{
|
||||
return $this->showBubbleSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show bubble size
|
||||
* Specifies that the bubble size should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show bubble size
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowBubbleSize($value)
|
||||
{
|
||||
$this->showBubbleSize = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get show leader lines.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getShowLeaderLines()
|
||||
{
|
||||
return $this->showLeaderLines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set show leader lines
|
||||
* Specifies that leader lines should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show leader lines
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowLeaderLines($value)
|
||||
{
|
||||
$this->showLeaderLines = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
class Legend
|
||||
{
|
||||
/** Legend positions */
|
||||
const XL_LEGEND_POSITION_BOTTOM = -4107; // Below the chart.
|
||||
const XL_LEGEND_POSITION_CORNER = 2; // In the upper right-hand corner of the chart border.
|
||||
const XL_LEGEND_POSITION_CUSTOM = -4161; // A custom position.
|
||||
const XL_LEGEND_POSITION_LEFT = -4131; // Left of the chart.
|
||||
const XL_LEGEND_POSITION_RIGHT = -4152; // Right of the chart.
|
||||
const XL_LEGEND_POSITION_TOP = -4160; // Above the chart.
|
||||
|
||||
const POSITION_RIGHT = 'r';
|
||||
const POSITION_LEFT = 'l';
|
||||
const POSITION_BOTTOM = 'b';
|
||||
const POSITION_TOP = 't';
|
||||
const POSITION_TOPRIGHT = 'tr';
|
||||
|
||||
private static $positionXLref = [
|
||||
self::XL_LEGEND_POSITION_BOTTOM => self::POSITION_BOTTOM,
|
||||
self::XL_LEGEND_POSITION_CORNER => self::POSITION_TOPRIGHT,
|
||||
self::XL_LEGEND_POSITION_CUSTOM => '??',
|
||||
self::XL_LEGEND_POSITION_LEFT => self::POSITION_LEFT,
|
||||
self::XL_LEGEND_POSITION_RIGHT => self::POSITION_RIGHT,
|
||||
self::XL_LEGEND_POSITION_TOP => self::POSITION_TOP,
|
||||
];
|
||||
|
||||
/**
|
||||
* Legend position.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $position = self::POSITION_RIGHT;
|
||||
|
||||
/**
|
||||
* Allow overlay of other elements?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $overlay = true;
|
||||
|
||||
/**
|
||||
* Legend Layout.
|
||||
*
|
||||
* @var Layout
|
||||
*/
|
||||
private $layout;
|
||||
|
||||
/**
|
||||
* Create a new Legend.
|
||||
*
|
||||
* @param string $position
|
||||
* @param bool $overlay
|
||||
*/
|
||||
public function __construct($position = self::POSITION_RIGHT, ?Layout $layout = null, $overlay = false)
|
||||
{
|
||||
$this->setPosition($position);
|
||||
$this->layout = $layout;
|
||||
$this->setOverlay($overlay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get legend position as an excel string value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get legend position using an excel string value.
|
||||
*
|
||||
* @param string $position see self::POSITION_*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setPosition($position)
|
||||
{
|
||||
if (!in_array($position, self::$positionXLref)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->position = $position;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get legend position as an Excel internal numeric value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPositionXL()
|
||||
{
|
||||
return array_search($this->position, self::$positionXLref);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set legend position using an Excel internal numeric value.
|
||||
*
|
||||
* @param int $positionXL see self::XL_LEGEND_POSITION_*
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setPositionXL($positionXL)
|
||||
{
|
||||
if (!isset(self::$positionXLref[$positionXL])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->position = self::$positionXLref[$positionXL];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allow overlay of other elements?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getOverlay()
|
||||
{
|
||||
return $this->overlay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set allow overlay of other elements?
|
||||
*
|
||||
* @param bool $overlay
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setOverlay($overlay)
|
||||
{
|
||||
if (!is_bool($overlay)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->overlay = $overlay;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Layout.
|
||||
*
|
||||
* @return Layout
|
||||
*/
|
||||
public function getLayout()
|
||||
{
|
||||
return $this->layout;
|
||||
}
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class PlotArea
|
||||
{
|
||||
/**
|
||||
* PlotArea Layout.
|
||||
*
|
||||
* @var Layout
|
||||
*/
|
||||
private $layout;
|
||||
|
||||
/**
|
||||
* Plot Series.
|
||||
*
|
||||
* @var DataSeries[]
|
||||
*/
|
||||
private $plotSeries = [];
|
||||
|
||||
/**
|
||||
* Create a new PlotArea.
|
||||
*
|
||||
* @param DataSeries[] $plotSeries
|
||||
*/
|
||||
public function __construct(?Layout $layout = null, array $plotSeries = [])
|
||||
{
|
||||
$this->layout = $layout;
|
||||
$this->plotSeries = $plotSeries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Layout.
|
||||
*
|
||||
* @return Layout
|
||||
*/
|
||||
public function getLayout()
|
||||
{
|
||||
return $this->layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Number of Plot Groups.
|
||||
*
|
||||
* @return array of DataSeries
|
||||
*/
|
||||
public function getPlotGroupCount()
|
||||
{
|
||||
return count($this->plotSeries);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Number of Plot Series.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPlotSeriesCount()
|
||||
{
|
||||
$seriesCount = 0;
|
||||
foreach ($this->plotSeries as $plot) {
|
||||
$seriesCount += $plot->getPlotSeriesCount();
|
||||
}
|
||||
|
||||
return $seriesCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Series.
|
||||
*
|
||||
* @return array of DataSeries
|
||||
*/
|
||||
public function getPlotGroup()
|
||||
{
|
||||
return $this->plotSeries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Plot Series by Index.
|
||||
*
|
||||
* @param mixed $index
|
||||
*
|
||||
* @return DataSeries
|
||||
*/
|
||||
public function getPlotGroupByIndex($index)
|
||||
{
|
||||
return $this->plotSeries[$index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Plot Series.
|
||||
*
|
||||
* @param DataSeries[] $plotSeries
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPlotSeries(array $plotSeries)
|
||||
{
|
||||
$this->plotSeries = $plotSeries;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function refresh(Worksheet $worksheet): void
|
||||
{
|
||||
foreach ($this->plotSeries as $plotSeries) {
|
||||
$plotSeries->refresh($worksheet);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,369 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: nhw2h8s
|
||||
* Date: 7/2/14
|
||||
* Time: 5:45 PM.
|
||||
*/
|
||||
abstract class Properties
|
||||
{
|
||||
const
|
||||
EXCEL_COLOR_TYPE_STANDARD = 'prstClr';
|
||||
const EXCEL_COLOR_TYPE_SCHEME = 'schemeClr';
|
||||
const EXCEL_COLOR_TYPE_ARGB = 'srgbClr';
|
||||
|
||||
const
|
||||
AXIS_LABELS_LOW = 'low';
|
||||
const AXIS_LABELS_HIGH = 'high';
|
||||
const AXIS_LABELS_NEXT_TO = 'nextTo';
|
||||
const AXIS_LABELS_NONE = 'none';
|
||||
|
||||
const
|
||||
TICK_MARK_NONE = 'none';
|
||||
const TICK_MARK_INSIDE = 'in';
|
||||
const TICK_MARK_OUTSIDE = 'out';
|
||||
const TICK_MARK_CROSS = 'cross';
|
||||
|
||||
const
|
||||
HORIZONTAL_CROSSES_AUTOZERO = 'autoZero';
|
||||
const HORIZONTAL_CROSSES_MAXIMUM = 'max';
|
||||
|
||||
const
|
||||
FORMAT_CODE_GENERAL = 'General';
|
||||
const FORMAT_CODE_NUMBER = '#,##0.00';
|
||||
const FORMAT_CODE_CURRENCY = '$#,##0.00';
|
||||
const FORMAT_CODE_ACCOUNTING = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';
|
||||
const FORMAT_CODE_DATE = 'm/d/yyyy';
|
||||
const FORMAT_CODE_TIME = '[$-F400]h:mm:ss AM/PM';
|
||||
const FORMAT_CODE_PERCENTAGE = '0.00%';
|
||||
const FORMAT_CODE_FRACTION = '# ?/?';
|
||||
const FORMAT_CODE_SCIENTIFIC = '0.00E+00';
|
||||
const FORMAT_CODE_TEXT = '@';
|
||||
const FORMAT_CODE_SPECIAL = '00000';
|
||||
|
||||
const
|
||||
ORIENTATION_NORMAL = 'minMax';
|
||||
const ORIENTATION_REVERSED = 'maxMin';
|
||||
|
||||
const
|
||||
LINE_STYLE_COMPOUND_SIMPLE = 'sng';
|
||||
const LINE_STYLE_COMPOUND_DOUBLE = 'dbl';
|
||||
const LINE_STYLE_COMPOUND_THICKTHIN = 'thickThin';
|
||||
const LINE_STYLE_COMPOUND_THINTHICK = 'thinThick';
|
||||
const LINE_STYLE_COMPOUND_TRIPLE = 'tri';
|
||||
const LINE_STYLE_DASH_SOLID = 'solid';
|
||||
const LINE_STYLE_DASH_ROUND_DOT = 'sysDot';
|
||||
const LINE_STYLE_DASH_SQUERE_DOT = 'sysDash';
|
||||
const LINE_STYPE_DASH_DASH = 'dash';
|
||||
const LINE_STYLE_DASH_DASH_DOT = 'dashDot';
|
||||
const LINE_STYLE_DASH_LONG_DASH = 'lgDash';
|
||||
const LINE_STYLE_DASH_LONG_DASH_DOT = 'lgDashDot';
|
||||
const LINE_STYLE_DASH_LONG_DASH_DOT_DOT = 'lgDashDotDot';
|
||||
const LINE_STYLE_CAP_SQUARE = 'sq';
|
||||
const LINE_STYLE_CAP_ROUND = 'rnd';
|
||||
const LINE_STYLE_CAP_FLAT = 'flat';
|
||||
const LINE_STYLE_JOIN_ROUND = 'bevel';
|
||||
const LINE_STYLE_JOIN_MITER = 'miter';
|
||||
const LINE_STYLE_JOIN_BEVEL = 'bevel';
|
||||
const LINE_STYLE_ARROW_TYPE_NOARROW = null;
|
||||
const LINE_STYLE_ARROW_TYPE_ARROW = 'triangle';
|
||||
const LINE_STYLE_ARROW_TYPE_OPEN = 'arrow';
|
||||
const LINE_STYLE_ARROW_TYPE_STEALTH = 'stealth';
|
||||
const LINE_STYLE_ARROW_TYPE_DIAMOND = 'diamond';
|
||||
const LINE_STYLE_ARROW_TYPE_OVAL = 'oval';
|
||||
const LINE_STYLE_ARROW_SIZE_1 = 1;
|
||||
const LINE_STYLE_ARROW_SIZE_2 = 2;
|
||||
const LINE_STYLE_ARROW_SIZE_3 = 3;
|
||||
const LINE_STYLE_ARROW_SIZE_4 = 4;
|
||||
const LINE_STYLE_ARROW_SIZE_5 = 5;
|
||||
const LINE_STYLE_ARROW_SIZE_6 = 6;
|
||||
const LINE_STYLE_ARROW_SIZE_7 = 7;
|
||||
const LINE_STYLE_ARROW_SIZE_8 = 8;
|
||||
const LINE_STYLE_ARROW_SIZE_9 = 9;
|
||||
|
||||
const
|
||||
SHADOW_PRESETS_NOSHADOW = null;
|
||||
const SHADOW_PRESETS_OUTER_BOTTTOM_RIGHT = 1;
|
||||
const SHADOW_PRESETS_OUTER_BOTTOM = 2;
|
||||
const SHADOW_PRESETS_OUTER_BOTTOM_LEFT = 3;
|
||||
const SHADOW_PRESETS_OUTER_RIGHT = 4;
|
||||
const SHADOW_PRESETS_OUTER_CENTER = 5;
|
||||
const SHADOW_PRESETS_OUTER_LEFT = 6;
|
||||
const SHADOW_PRESETS_OUTER_TOP_RIGHT = 7;
|
||||
const SHADOW_PRESETS_OUTER_TOP = 8;
|
||||
const SHADOW_PRESETS_OUTER_TOP_LEFT = 9;
|
||||
const SHADOW_PRESETS_INNER_BOTTTOM_RIGHT = 10;
|
||||
const SHADOW_PRESETS_INNER_BOTTOM = 11;
|
||||
const SHADOW_PRESETS_INNER_BOTTOM_LEFT = 12;
|
||||
const SHADOW_PRESETS_INNER_RIGHT = 13;
|
||||
const SHADOW_PRESETS_INNER_CENTER = 14;
|
||||
const SHADOW_PRESETS_INNER_LEFT = 15;
|
||||
const SHADOW_PRESETS_INNER_TOP_RIGHT = 16;
|
||||
const SHADOW_PRESETS_INNER_TOP = 17;
|
||||
const SHADOW_PRESETS_INNER_TOP_LEFT = 18;
|
||||
const SHADOW_PRESETS_PERSPECTIVE_BELOW = 19;
|
||||
const SHADOW_PRESETS_PERSPECTIVE_UPPER_RIGHT = 20;
|
||||
const SHADOW_PRESETS_PERSPECTIVE_UPPER_LEFT = 21;
|
||||
const SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22;
|
||||
const SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23;
|
||||
|
||||
/**
|
||||
* @param float $width
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
protected function getExcelPointsWidth($width)
|
||||
{
|
||||
return $width * 12700;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $angle
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
protected function getExcelPointsAngle($angle)
|
||||
{
|
||||
return $angle * 60000;
|
||||
}
|
||||
|
||||
protected function getTrueAlpha($alpha)
|
||||
{
|
||||
return (string) 100 - $alpha . '000';
|
||||
}
|
||||
|
||||
protected function setColorProperties($color, $alpha, $type)
|
||||
{
|
||||
return [
|
||||
'type' => (string) $type,
|
||||
'value' => (string) $color,
|
||||
'alpha' => (string) $this->getTrueAlpha($alpha),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
|
||||
{
|
||||
$sizes = [
|
||||
1 => ['w' => 'sm', 'len' => 'sm'],
|
||||
2 => ['w' => 'sm', 'len' => 'med'],
|
||||
3 => ['w' => 'sm', 'len' => 'lg'],
|
||||
4 => ['w' => 'med', 'len' => 'sm'],
|
||||
5 => ['w' => 'med', 'len' => 'med'],
|
||||
6 => ['w' => 'med', 'len' => 'lg'],
|
||||
7 => ['w' => 'lg', 'len' => 'sm'],
|
||||
8 => ['w' => 'lg', 'len' => 'med'],
|
||||
9 => ['w' => 'lg', 'len' => 'lg'],
|
||||
];
|
||||
|
||||
return $sizes[$array_selector][$array_kay_selector];
|
||||
}
|
||||
|
||||
protected function getShadowPresetsMap($shadow_presets_option)
|
||||
{
|
||||
$presets_options = [
|
||||
//OUTER
|
||||
1 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '2700000',
|
||||
'algn' => 'tl',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
2 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '5400000',
|
||||
'algn' => 't',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
3 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '8100000',
|
||||
'algn' => 'tr',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
4 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'algn' => 'l',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
5 => [
|
||||
'effect' => 'outerShdw',
|
||||
'size' => [
|
||||
'sx' => '102000',
|
||||
'sy' => '102000',
|
||||
],
|
||||
'blur' => '63500',
|
||||
'distance' => '38100',
|
||||
'algn' => 'ctr',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
6 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '10800000',
|
||||
'algn' => 'r',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
7 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '18900000',
|
||||
'algn' => 'bl',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
8 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '16200000',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
9 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '50800',
|
||||
'distance' => '38100',
|
||||
'direction' => '13500000',
|
||||
'algn' => 'br',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
//INNER
|
||||
10 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '2700000',
|
||||
],
|
||||
11 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '5400000',
|
||||
],
|
||||
12 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '8100000',
|
||||
],
|
||||
13 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
],
|
||||
14 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '114300',
|
||||
],
|
||||
15 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '10800000',
|
||||
],
|
||||
16 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '18900000',
|
||||
],
|
||||
17 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '16200000',
|
||||
],
|
||||
18 => [
|
||||
'effect' => 'innerShdw',
|
||||
'blur' => '63500',
|
||||
'distance' => '50800',
|
||||
'direction' => '13500000',
|
||||
],
|
||||
//perspective
|
||||
19 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '152400',
|
||||
'distance' => '317500',
|
||||
'size' => [
|
||||
'sx' => '90000',
|
||||
'sy' => '-19000',
|
||||
],
|
||||
'direction' => '5400000',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
20 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '76200',
|
||||
'direction' => '18900000',
|
||||
'size' => [
|
||||
'sy' => '23000',
|
||||
'kx' => '-1200000',
|
||||
],
|
||||
'algn' => 'bl',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
21 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '76200',
|
||||
'direction' => '13500000',
|
||||
'size' => [
|
||||
'sy' => '23000',
|
||||
'kx' => '1200000',
|
||||
],
|
||||
'algn' => 'br',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
22 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '76200',
|
||||
'distance' => '12700',
|
||||
'direction' => '2700000',
|
||||
'size' => [
|
||||
'sy' => '-23000',
|
||||
'kx' => '-800400',
|
||||
],
|
||||
'algn' => 'bl',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
23 => [
|
||||
'effect' => 'outerShdw',
|
||||
'blur' => '76200',
|
||||
'distance' => '12700',
|
||||
'direction' => '8100000',
|
||||
'size' => [
|
||||
'sy' => '-23000',
|
||||
'kx' => '800400',
|
||||
],
|
||||
'algn' => 'br',
|
||||
'rotWithShape' => '0',
|
||||
],
|
||||
];
|
||||
|
||||
return $presets_options[$shadow_presets_option];
|
||||
}
|
||||
|
||||
protected function getArrayElementsValue($properties, $elements)
|
||||
{
|
||||
$reference = &$properties;
|
||||
if (!is_array($elements)) {
|
||||
return $reference[$elements];
|
||||
}
|
||||
|
||||
foreach ($elements as $keys) {
|
||||
$reference = &$reference[$keys];
|
||||
}
|
||||
|
||||
return $reference;
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart\Renderer;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||
|
||||
interface IRenderer
|
||||
{
|
||||
/**
|
||||
* IRenderer constructor.
|
||||
*/
|
||||
public function __construct(Chart $chart);
|
||||
|
||||
/**
|
||||
* Render the chart to given file (or stream).
|
||||
*
|
||||
* @param string $filename Name of the file render to
|
||||
*
|
||||
* @return bool true on success
|
||||
*/
|
||||
public function render($filename);
|
||||
}
|
@ -1,870 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart\Renderer;
|
||||
|
||||
use AccBarPlot;
|
||||
use AccLinePlot;
|
||||
use BarPlot;
|
||||
use ContourPlot;
|
||||
use Graph;
|
||||
use GroupBarPlot;
|
||||
use LinePlot;
|
||||
use PhpOffice\PhpSpreadsheet\Chart\Chart;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use PieGraph;
|
||||
use PiePlot;
|
||||
use PiePlot3D;
|
||||
use PiePlotC;
|
||||
use RadarGraph;
|
||||
use RadarPlot;
|
||||
use ScatterPlot;
|
||||
use Spline;
|
||||
use StockPlot;
|
||||
|
||||
class JpGraph implements IRenderer
|
||||
{
|
||||
private static $width = 640;
|
||||
|
||||
private static $height = 480;
|
||||
|
||||
private static $colourSet = [
|
||||
'mediumpurple1', 'palegreen3', 'gold1', 'cadetblue1',
|
||||
'darkmagenta', 'coral', 'dodgerblue3', 'eggplant',
|
||||
'mediumblue', 'magenta', 'sandybrown', 'cyan',
|
||||
'firebrick1', 'forestgreen', 'deeppink4', 'darkolivegreen',
|
||||
'goldenrod2',
|
||||
];
|
||||
|
||||
private static $markSet;
|
||||
|
||||
private $chart;
|
||||
|
||||
private $graph;
|
||||
|
||||
private static $plotColour = 0;
|
||||
|
||||
private static $plotMark = 0;
|
||||
|
||||
/**
|
||||
* Create a new jpgraph.
|
||||
*/
|
||||
public function __construct(Chart $chart)
|
||||
{
|
||||
self::init();
|
||||
$this->graph = null;
|
||||
$this->chart = $chart;
|
||||
}
|
||||
|
||||
private static function init(): void
|
||||
{
|
||||
static $loaded = false;
|
||||
if ($loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
\JpGraph\JpGraph::load();
|
||||
\JpGraph\JpGraph::module('bar');
|
||||
\JpGraph\JpGraph::module('contour');
|
||||
\JpGraph\JpGraph::module('line');
|
||||
\JpGraph\JpGraph::module('pie');
|
||||
\JpGraph\JpGraph::module('pie3d');
|
||||
\JpGraph\JpGraph::module('radar');
|
||||
\JpGraph\JpGraph::module('regstat');
|
||||
\JpGraph\JpGraph::module('scatter');
|
||||
\JpGraph\JpGraph::module('stock');
|
||||
|
||||
self::$markSet = [
|
||||
'diamond' => MARK_DIAMOND,
|
||||
'square' => MARK_SQUARE,
|
||||
'triangle' => MARK_UTRIANGLE,
|
||||
'x' => MARK_X,
|
||||
'star' => MARK_STAR,
|
||||
'dot' => MARK_FILLEDCIRCLE,
|
||||
'dash' => MARK_DTRIANGLE,
|
||||
'circle' => MARK_CIRCLE,
|
||||
'plus' => MARK_CROSS,
|
||||
];
|
||||
|
||||
$loaded = true;
|
||||
}
|
||||
|
||||
private function formatPointMarker($seriesPlot, $markerID)
|
||||
{
|
||||
$plotMarkKeys = array_keys(self::$markSet);
|
||||
if ($markerID === null) {
|
||||
// Use default plot marker (next marker in the series)
|
||||
self::$plotMark %= count(self::$markSet);
|
||||
$seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$plotMark++]]);
|
||||
} elseif ($markerID !== 'none') {
|
||||
// Use specified plot marker (if it exists)
|
||||
if (isset(self::$markSet[$markerID])) {
|
||||
$seriesPlot->mark->SetType(self::$markSet[$markerID]);
|
||||
} else {
|
||||
// If the specified plot marker doesn't exist, use default plot marker (next marker in the series)
|
||||
self::$plotMark %= count(self::$markSet);
|
||||
$seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$plotMark++]]);
|
||||
}
|
||||
} else {
|
||||
// Hide plot marker
|
||||
$seriesPlot->mark->Hide();
|
||||
}
|
||||
$seriesPlot->mark->SetColor(self::$colourSet[self::$plotColour]);
|
||||
$seriesPlot->mark->SetFillColor(self::$colourSet[self::$plotColour]);
|
||||
$seriesPlot->SetColor(self::$colourSet[self::$plotColour++]);
|
||||
|
||||
return $seriesPlot;
|
||||
}
|
||||
|
||||
private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '')
|
||||
{
|
||||
$datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode();
|
||||
if ($datasetLabelFormatCode !== null) {
|
||||
// Retrieve any label formatting code
|
||||
$datasetLabelFormatCode = stripslashes($datasetLabelFormatCode);
|
||||
}
|
||||
|
||||
$testCurrentIndex = 0;
|
||||
foreach ($datasetLabels as $i => $datasetLabel) {
|
||||
if (is_array($datasetLabel)) {
|
||||
if ($rotation == 'bar') {
|
||||
$datasetLabels[$i] = implode(' ', $datasetLabel);
|
||||
} else {
|
||||
$datasetLabel = array_reverse($datasetLabel);
|
||||
$datasetLabels[$i] = implode("\n", $datasetLabel);
|
||||
}
|
||||
} else {
|
||||
// Format labels according to any formatting code
|
||||
if ($datasetLabelFormatCode !== null) {
|
||||
$datasetLabels[$i] = NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
|
||||
}
|
||||
}
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
|
||||
return $datasetLabels;
|
||||
}
|
||||
|
||||
private function percentageSumCalculation($groupID, $seriesCount)
|
||||
{
|
||||
$sumValues = [];
|
||||
// Adjust our values to a percentage value across all series in the group
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
if ($i == 0) {
|
||||
$sumValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
} else {
|
||||
$nextValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
foreach ($nextValues as $k => $value) {
|
||||
if (isset($sumValues[$k])) {
|
||||
$sumValues[$k] += $value;
|
||||
} else {
|
||||
$sumValues[$k] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $sumValues;
|
||||
}
|
||||
|
||||
private function percentageAdjustValues($dataValues, $sumValues)
|
||||
{
|
||||
foreach ($dataValues as $k => $dataValue) {
|
||||
$dataValues[$k] = $dataValue / $sumValues[$k] * 100;
|
||||
}
|
||||
|
||||
return $dataValues;
|
||||
}
|
||||
|
||||
private function getCaption($captionElement)
|
||||
{
|
||||
// Read any caption
|
||||
$caption = ($captionElement !== null) ? $captionElement->getCaption() : null;
|
||||
// Test if we have a title caption to display
|
||||
if ($caption !== null) {
|
||||
// If we do, it could be a plain string or an array
|
||||
if (is_array($caption)) {
|
||||
// Implode an array to a plain string
|
||||
$caption = implode('', $caption);
|
||||
}
|
||||
}
|
||||
|
||||
return $caption;
|
||||
}
|
||||
|
||||
private function renderTitle(): void
|
||||
{
|
||||
$title = $this->getCaption($this->chart->getTitle());
|
||||
if ($title !== null) {
|
||||
$this->graph->title->Set($title);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderLegend(): void
|
||||
{
|
||||
$legend = $this->chart->getLegend();
|
||||
if ($legend !== null) {
|
||||
$legendPosition = $legend->getPosition();
|
||||
switch ($legendPosition) {
|
||||
case 'r':
|
||||
$this->graph->legend->SetPos(0.01, 0.5, 'right', 'center'); // right
|
||||
$this->graph->legend->SetColumns(1);
|
||||
|
||||
break;
|
||||
case 'l':
|
||||
$this->graph->legend->SetPos(0.01, 0.5, 'left', 'center'); // left
|
||||
$this->graph->legend->SetColumns(1);
|
||||
|
||||
break;
|
||||
case 't':
|
||||
$this->graph->legend->SetPos(0.5, 0.01, 'center', 'top'); // top
|
||||
|
||||
break;
|
||||
case 'b':
|
||||
$this->graph->legend->SetPos(0.5, 0.99, 'center', 'bottom'); // bottom
|
||||
|
||||
break;
|
||||
default:
|
||||
$this->graph->legend->SetPos(0.01, 0.01, 'right', 'top'); // top-right
|
||||
$this->graph->legend->SetColumns(1);
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$this->graph->legend->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
private function renderCartesianPlotArea($type = 'textlin'): void
|
||||
{
|
||||
$this->graph = new Graph(self::$width, self::$height);
|
||||
$this->graph->SetScale($type);
|
||||
|
||||
$this->renderTitle();
|
||||
|
||||
// Rotate for bar rather than column chart
|
||||
$rotation = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotDirection();
|
||||
$reverse = $rotation == 'bar';
|
||||
|
||||
$xAxisLabel = $this->chart->getXAxisLabel();
|
||||
if ($xAxisLabel !== null) {
|
||||
$title = $this->getCaption($xAxisLabel);
|
||||
if ($title !== null) {
|
||||
$this->graph->xaxis->SetTitle($title, 'center');
|
||||
$this->graph->xaxis->title->SetMargin(35);
|
||||
if ($reverse) {
|
||||
$this->graph->xaxis->title->SetAngle(90);
|
||||
$this->graph->xaxis->title->SetMargin(90);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$yAxisLabel = $this->chart->getYAxisLabel();
|
||||
if ($yAxisLabel !== null) {
|
||||
$title = $this->getCaption($yAxisLabel);
|
||||
if ($title !== null) {
|
||||
$this->graph->yaxis->SetTitle($title, 'center');
|
||||
if ($reverse) {
|
||||
$this->graph->yaxis->title->SetAngle(0);
|
||||
$this->graph->yaxis->title->SetMargin(-55);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function renderPiePlotArea(): void
|
||||
{
|
||||
$this->graph = new PieGraph(self::$width, self::$height);
|
||||
|
||||
$this->renderTitle();
|
||||
}
|
||||
|
||||
private function renderRadarPlotArea(): void
|
||||
{
|
||||
$this->graph = new RadarGraph(self::$width, self::$height);
|
||||
$this->graph->SetScale('lin');
|
||||
|
||||
$this->renderTitle();
|
||||
}
|
||||
|
||||
private function renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d'): void
|
||||
{
|
||||
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
|
||||
|
||||
$labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
|
||||
if ($labelCount > 0) {
|
||||
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
|
||||
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
|
||||
$this->graph->xaxis->SetTickLabels($datasetLabels);
|
||||
}
|
||||
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$seriesPlots = [];
|
||||
if ($grouping == 'percentStacked') {
|
||||
$sumValues = $this->percentageSumCalculation($groupID, $seriesCount);
|
||||
}
|
||||
|
||||
// Loop through each data series in turn
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
$dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
$marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
|
||||
|
||||
if ($grouping == 'percentStacked') {
|
||||
$dataValues = $this->percentageAdjustValues($dataValues, $sumValues);
|
||||
}
|
||||
|
||||
// Fill in any missing values in the $dataValues array
|
||||
$testCurrentIndex = 0;
|
||||
foreach ($dataValues as $k => $dataValue) {
|
||||
while ($k != $testCurrentIndex) {
|
||||
$dataValues[$testCurrentIndex] = null;
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
|
||||
$seriesPlot = new LinePlot($dataValues);
|
||||
if ($combination) {
|
||||
$seriesPlot->SetBarCenter();
|
||||
}
|
||||
|
||||
if ($filled) {
|
||||
$seriesPlot->SetFilled(true);
|
||||
$seriesPlot->SetColor('black');
|
||||
$seriesPlot->SetFillColor(self::$colourSet[self::$plotColour++]);
|
||||
} else {
|
||||
// Set the appropriate plot marker
|
||||
$this->formatPointMarker($seriesPlot, $marker);
|
||||
}
|
||||
$dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
|
||||
$seriesPlot->SetLegend($dataLabel);
|
||||
|
||||
$seriesPlots[] = $seriesPlot;
|
||||
}
|
||||
|
||||
if ($grouping == 'standard') {
|
||||
$groupPlot = $seriesPlots;
|
||||
} else {
|
||||
$groupPlot = new AccLinePlot($seriesPlots);
|
||||
}
|
||||
$this->graph->Add($groupPlot);
|
||||
}
|
||||
|
||||
private function renderPlotBar($groupID, $dimensions = '2d'): void
|
||||
{
|
||||
$rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
|
||||
// Rotate for bar rather than column chart
|
||||
if (($groupID == 0) && ($rotation == 'bar')) {
|
||||
$this->graph->Set90AndMargin();
|
||||
}
|
||||
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
|
||||
|
||||
$labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
|
||||
if ($labelCount > 0) {
|
||||
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
|
||||
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation);
|
||||
// Rotate for bar rather than column chart
|
||||
if ($rotation == 'bar') {
|
||||
$datasetLabels = array_reverse($datasetLabels);
|
||||
$this->graph->yaxis->SetPos('max');
|
||||
$this->graph->yaxis->SetLabelAlign('center', 'top');
|
||||
$this->graph->yaxis->SetLabelSide(SIDE_RIGHT);
|
||||
}
|
||||
$this->graph->xaxis->SetTickLabels($datasetLabels);
|
||||
}
|
||||
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$seriesPlots = [];
|
||||
if ($grouping == 'percentStacked') {
|
||||
$sumValues = $this->percentageSumCalculation($groupID, $seriesCount);
|
||||
}
|
||||
|
||||
// Loop through each data series in turn
|
||||
for ($j = 0; $j < $seriesCount; ++$j) {
|
||||
$dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues();
|
||||
if ($grouping == 'percentStacked') {
|
||||
$dataValues = $this->percentageAdjustValues($dataValues, $sumValues);
|
||||
}
|
||||
|
||||
// Fill in any missing values in the $dataValues array
|
||||
$testCurrentIndex = 0;
|
||||
foreach ($dataValues as $k => $dataValue) {
|
||||
while ($k != $testCurrentIndex) {
|
||||
$dataValues[$testCurrentIndex] = null;
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
|
||||
// Reverse the $dataValues order for bar rather than column chart
|
||||
if ($rotation == 'bar') {
|
||||
$dataValues = array_reverse($dataValues);
|
||||
}
|
||||
$seriesPlot = new BarPlot($dataValues);
|
||||
$seriesPlot->SetColor('black');
|
||||
$seriesPlot->SetFillColor(self::$colourSet[self::$plotColour++]);
|
||||
if ($dimensions == '3d') {
|
||||
$seriesPlot->SetShadow();
|
||||
}
|
||||
if (!$this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)) {
|
||||
$dataLabel = '';
|
||||
} else {
|
||||
$dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($j)->getDataValue();
|
||||
}
|
||||
$seriesPlot->SetLegend($dataLabel);
|
||||
|
||||
$seriesPlots[] = $seriesPlot;
|
||||
}
|
||||
// Reverse the plot order for bar rather than column chart
|
||||
if (($rotation == 'bar') && ($grouping != 'percentStacked')) {
|
||||
$seriesPlots = array_reverse($seriesPlots);
|
||||
}
|
||||
|
||||
if ($grouping == 'clustered') {
|
||||
$groupPlot = new GroupBarPlot($seriesPlots);
|
||||
} elseif ($grouping == 'standard') {
|
||||
$groupPlot = new GroupBarPlot($seriesPlots);
|
||||
} else {
|
||||
$groupPlot = new AccBarPlot($seriesPlots);
|
||||
if ($dimensions == '3d') {
|
||||
$groupPlot->SetShadow();
|
||||
}
|
||||
}
|
||||
|
||||
$this->graph->Add($groupPlot);
|
||||
}
|
||||
|
||||
private function renderPlotScatter($groupID, $bubble): void
|
||||
{
|
||||
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
|
||||
$scatterStyle = $bubbleSize = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
|
||||
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$seriesPlots = [];
|
||||
|
||||
// Loop through each data series in turn
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
$dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
|
||||
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
|
||||
foreach ($dataValuesY as $k => $dataValueY) {
|
||||
$dataValuesY[$k] = $k;
|
||||
}
|
||||
|
||||
$seriesPlot = new ScatterPlot($dataValuesX, $dataValuesY);
|
||||
if ($scatterStyle == 'lineMarker') {
|
||||
$seriesPlot->SetLinkPoints();
|
||||
$seriesPlot->link->SetColor(self::$colourSet[self::$plotColour]);
|
||||
} elseif ($scatterStyle == 'smoothMarker') {
|
||||
$spline = new Spline($dataValuesY, $dataValuesX);
|
||||
[$splineDataY, $splineDataX] = $spline->Get(count($dataValuesX) * self::$width / 20);
|
||||
$lplot = new LinePlot($splineDataX, $splineDataY);
|
||||
$lplot->SetColor(self::$colourSet[self::$plotColour]);
|
||||
|
||||
$this->graph->Add($lplot);
|
||||
}
|
||||
|
||||
if ($bubble) {
|
||||
$this->formatPointMarker($seriesPlot, 'dot');
|
||||
$seriesPlot->mark->SetColor('black');
|
||||
$seriesPlot->mark->SetSize($bubbleSize);
|
||||
} else {
|
||||
$marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
|
||||
$this->formatPointMarker($seriesPlot, $marker);
|
||||
}
|
||||
$dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
|
||||
$seriesPlot->SetLegend($dataLabel);
|
||||
|
||||
$this->graph->Add($seriesPlot);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderPlotRadar($groupID): void
|
||||
{
|
||||
$radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
|
||||
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$seriesPlots = [];
|
||||
|
||||
// Loop through each data series in turn
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
$dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
|
||||
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
$marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
|
||||
|
||||
$dataValues = [];
|
||||
foreach ($dataValuesY as $k => $dataValueY) {
|
||||
$dataValues[$k] = implode(' ', array_reverse($dataValueY));
|
||||
}
|
||||
$tmp = array_shift($dataValues);
|
||||
$dataValues[] = $tmp;
|
||||
$tmp = array_shift($dataValuesX);
|
||||
$dataValuesX[] = $tmp;
|
||||
|
||||
$this->graph->SetTitles(array_reverse($dataValues));
|
||||
|
||||
$seriesPlot = new RadarPlot(array_reverse($dataValuesX));
|
||||
|
||||
$dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
|
||||
$seriesPlot->SetColor(self::$colourSet[self::$plotColour++]);
|
||||
if ($radarStyle == 'filled') {
|
||||
$seriesPlot->SetFillColor(self::$colourSet[self::$plotColour]);
|
||||
}
|
||||
$this->formatPointMarker($seriesPlot, $marker);
|
||||
$seriesPlot->SetLegend($dataLabel);
|
||||
|
||||
$this->graph->Add($seriesPlot);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderPlotContour($groupID): void
|
||||
{
|
||||
$contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
|
||||
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$seriesPlots = [];
|
||||
|
||||
$dataValues = [];
|
||||
// Loop through each data series in turn
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
$dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
|
||||
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
|
||||
|
||||
$dataValues[$i] = $dataValuesX;
|
||||
}
|
||||
$seriesPlot = new ContourPlot($dataValues);
|
||||
|
||||
$this->graph->Add($seriesPlot);
|
||||
}
|
||||
|
||||
private function renderPlotStock($groupID): void
|
||||
{
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$plotOrder = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotOrder();
|
||||
|
||||
$dataValues = [];
|
||||
// Loop through each data series in turn and build the plot arrays
|
||||
foreach ($plotOrder as $i => $v) {
|
||||
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($v)->getDataValues();
|
||||
foreach ($dataValuesX as $j => $dataValueX) {
|
||||
$dataValues[$plotOrder[$i]][$j] = $dataValueX;
|
||||
}
|
||||
}
|
||||
if (empty($dataValues)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dataValuesPlot = [];
|
||||
// Flatten the plot arrays to a single dimensional array to work with jpgraph
|
||||
$jMax = count($dataValues[0]);
|
||||
for ($j = 0; $j < $jMax; ++$j) {
|
||||
for ($i = 0; $i < $seriesCount; ++$i) {
|
||||
$dataValuesPlot[] = $dataValues[$i][$j];
|
||||
}
|
||||
}
|
||||
|
||||
// Set the x-axis labels
|
||||
$labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
|
||||
if ($labelCount > 0) {
|
||||
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
|
||||
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
|
||||
$this->graph->xaxis->SetTickLabels($datasetLabels);
|
||||
}
|
||||
|
||||
$seriesPlot = new StockPlot($dataValuesPlot);
|
||||
$seriesPlot->SetWidth(20);
|
||||
|
||||
$this->graph->Add($seriesPlot);
|
||||
}
|
||||
|
||||
private function renderAreaChart($groupCount, $dimensions = '2d'): void
|
||||
{
|
||||
$this->renderCartesianPlotArea();
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$this->renderPlotLine($i, true, false, $dimensions);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderLineChart($groupCount, $dimensions = '2d'): void
|
||||
{
|
||||
$this->renderCartesianPlotArea();
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$this->renderPlotLine($i, false, false, $dimensions);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderBarChart($groupCount, $dimensions = '2d'): void
|
||||
{
|
||||
$this->renderCartesianPlotArea();
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$this->renderPlotBar($i, $dimensions);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderScatterChart($groupCount): void
|
||||
{
|
||||
$this->renderCartesianPlotArea('linlin');
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$this->renderPlotScatter($i, false);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderBubbleChart($groupCount): void
|
||||
{
|
||||
$this->renderCartesianPlotArea('linlin');
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$this->renderPlotScatter($i, true);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false): void
|
||||
{
|
||||
$this->renderPiePlotArea();
|
||||
|
||||
$iLimit = ($multiplePlots) ? $groupCount : 1;
|
||||
for ($groupID = 0; $groupID < $iLimit; ++$groupID) {
|
||||
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
|
||||
$exploded = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
|
||||
$datasetLabels = [];
|
||||
if ($groupID == 0) {
|
||||
$labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
|
||||
if ($labelCount > 0) {
|
||||
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
|
||||
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
|
||||
}
|
||||
}
|
||||
|
||||
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
|
||||
$seriesPlots = [];
|
||||
// For pie charts, we only display the first series: doughnut charts generally display all series
|
||||
$jLimit = ($multiplePlots) ? $seriesCount : 1;
|
||||
// Loop through each data series in turn
|
||||
for ($j = 0; $j < $jLimit; ++$j) {
|
||||
$dataValues = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues();
|
||||
|
||||
// Fill in any missing values in the $dataValues array
|
||||
$testCurrentIndex = 0;
|
||||
foreach ($dataValues as $k => $dataValue) {
|
||||
while ($k != $testCurrentIndex) {
|
||||
$dataValues[$testCurrentIndex] = null;
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
++$testCurrentIndex;
|
||||
}
|
||||
|
||||
if ($dimensions == '3d') {
|
||||
$seriesPlot = new PiePlot3D($dataValues);
|
||||
} else {
|
||||
if ($doughnut) {
|
||||
$seriesPlot = new PiePlotC($dataValues);
|
||||
} else {
|
||||
$seriesPlot = new PiePlot($dataValues);
|
||||
}
|
||||
}
|
||||
|
||||
if ($multiplePlots) {
|
||||
$seriesPlot->SetSize(($jLimit - $j) / ($jLimit * 4));
|
||||
}
|
||||
|
||||
if ($doughnut) {
|
||||
$seriesPlot->SetMidColor('white');
|
||||
}
|
||||
|
||||
$seriesPlot->SetColor(self::$colourSet[self::$plotColour++]);
|
||||
if (count($datasetLabels) > 0) {
|
||||
$seriesPlot->SetLabels(array_fill(0, count($datasetLabels), ''));
|
||||
}
|
||||
if ($dimensions != '3d') {
|
||||
$seriesPlot->SetGuideLines(false);
|
||||
}
|
||||
if ($j == 0) {
|
||||
if ($exploded) {
|
||||
$seriesPlot->ExplodeAll();
|
||||
}
|
||||
$seriesPlot->SetLegends($datasetLabels);
|
||||
}
|
||||
|
||||
$this->graph->Add($seriesPlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function renderRadarChart($groupCount): void
|
||||
{
|
||||
$this->renderRadarPlotArea();
|
||||
|
||||
for ($groupID = 0; $groupID < $groupCount; ++$groupID) {
|
||||
$this->renderPlotRadar($groupID);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderStockChart($groupCount): void
|
||||
{
|
||||
$this->renderCartesianPlotArea('intint');
|
||||
|
||||
for ($groupID = 0; $groupID < $groupCount; ++$groupID) {
|
||||
$this->renderPlotStock($groupID);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderContourChart($groupCount, $dimensions): void
|
||||
{
|
||||
$this->renderCartesianPlotArea('intint');
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$this->renderPlotContour($i);
|
||||
}
|
||||
}
|
||||
|
||||
private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
|
||||
{
|
||||
$this->renderCartesianPlotArea();
|
||||
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$dimensions = null;
|
||||
$chartType = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
|
||||
switch ($chartType) {
|
||||
case 'area3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'areaChart':
|
||||
$this->renderPlotLine($i, true, true, $dimensions);
|
||||
|
||||
break;
|
||||
case 'bar3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'barChart':
|
||||
$this->renderPlotBar($i, $dimensions);
|
||||
|
||||
break;
|
||||
case 'line3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'lineChart':
|
||||
$this->renderPlotLine($i, false, true, $dimensions);
|
||||
|
||||
break;
|
||||
case 'scatterChart':
|
||||
$this->renderPlotScatter($i, false);
|
||||
|
||||
break;
|
||||
case 'bubbleChart':
|
||||
$this->renderPlotScatter($i, true);
|
||||
|
||||
break;
|
||||
default:
|
||||
$this->graph = null;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->renderLegend();
|
||||
|
||||
$this->graph->Stroke($outputDestination);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function render($outputDestination)
|
||||
{
|
||||
self::$plotColour = 0;
|
||||
|
||||
$groupCount = $this->chart->getPlotArea()->getPlotGroupCount();
|
||||
|
||||
$dimensions = null;
|
||||
if ($groupCount == 1) {
|
||||
$chartType = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
|
||||
} else {
|
||||
$chartTypes = [];
|
||||
for ($i = 0; $i < $groupCount; ++$i) {
|
||||
$chartTypes[] = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
|
||||
}
|
||||
$chartTypes = array_unique($chartTypes);
|
||||
if (count($chartTypes) == 1) {
|
||||
$chartType = array_pop($chartTypes);
|
||||
} elseif (count($chartTypes) == 0) {
|
||||
echo 'Chart is not yet implemented<br />';
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return $this->renderCombinationChart($groupCount, $dimensions, $outputDestination);
|
||||
}
|
||||
}
|
||||
|
||||
switch ($chartType) {
|
||||
case 'area3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'areaChart':
|
||||
$this->renderAreaChart($groupCount, $dimensions);
|
||||
|
||||
break;
|
||||
case 'bar3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'barChart':
|
||||
$this->renderBarChart($groupCount, $dimensions);
|
||||
|
||||
break;
|
||||
case 'line3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'lineChart':
|
||||
$this->renderLineChart($groupCount, $dimensions);
|
||||
|
||||
break;
|
||||
case 'pie3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'pieChart':
|
||||
$this->renderPieChart($groupCount, $dimensions, false, false);
|
||||
|
||||
break;
|
||||
case 'doughnut3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'doughnutChart':
|
||||
$this->renderPieChart($groupCount, $dimensions, true, true);
|
||||
|
||||
break;
|
||||
case 'scatterChart':
|
||||
$this->renderScatterChart($groupCount);
|
||||
|
||||
break;
|
||||
case 'bubbleChart':
|
||||
$this->renderBubbleChart($groupCount);
|
||||
|
||||
break;
|
||||
case 'radarChart':
|
||||
$this->renderRadarChart($groupCount);
|
||||
|
||||
break;
|
||||
case 'surface3DChart':
|
||||
$dimensions = '3d';
|
||||
// no break
|
||||
case 'surfaceChart':
|
||||
$this->renderContourChart($groupCount, $dimensions);
|
||||
|
||||
break;
|
||||
case 'stockChart':
|
||||
$this->renderStockChart($groupCount);
|
||||
|
||||
break;
|
||||
default:
|
||||
echo $chartType . ' is not yet implemented<br />';
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->renderLegend();
|
||||
|
||||
$this->graph->Stroke($outputDestination);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
ChartDirector
|
||||
https://www.advsofteng.com/cdphp.html
|
||||
|
||||
GraPHPite
|
||||
http://graphpite.sourceforge.net/
|
||||
|
||||
JpGraph
|
||||
http://www.aditus.nu/jpgraph/
|
||||
|
||||
LibChart
|
||||
https://naku.dohcrew.com/libchart/pages/introduction/
|
||||
|
||||
pChart
|
||||
http://pchart.sourceforge.net/
|
||||
|
||||
TeeChart
|
||||
https://www.steema.com/
|
||||
|
||||
PHPGraphLib
|
||||
http://www.ebrueggeman.com/phpgraphlib
|
@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Chart;
|
||||
|
||||
class Title
|
||||
{
|
||||
/**
|
||||
* Title Caption.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $caption;
|
||||
|
||||
/**
|
||||
* Title Layout.
|
||||
*
|
||||
* @var Layout
|
||||
*/
|
||||
private $layout;
|
||||
|
||||
/**
|
||||
* Create a new Title.
|
||||
*
|
||||
* @param null|mixed $caption
|
||||
*/
|
||||
public function __construct($caption = null, ?Layout $layout = null)
|
||||
{
|
||||
$this->caption = $caption;
|
||||
$this->layout = $layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get caption.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCaption()
|
||||
{
|
||||
return $this->caption;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set caption.
|
||||
*
|
||||
* @param string $caption
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCaption($caption)
|
||||
{
|
||||
$this->caption = $caption;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Layout.
|
||||
*
|
||||
* @return Layout
|
||||
*/
|
||||
public function getLayout()
|
||||
{
|
||||
return $this->layout;
|
||||
}
|
||||
}
|
@ -1,498 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Collection;
|
||||
|
||||
use Generator;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Cell;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
|
||||
class Cells
|
||||
{
|
||||
/**
|
||||
* @var \Psr\SimpleCache\CacheInterface
|
||||
*/
|
||||
private $cache;
|
||||
|
||||
/**
|
||||
* Parent worksheet.
|
||||
*
|
||||
* @var Worksheet
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
* The currently active Cell.
|
||||
*
|
||||
* @var Cell
|
||||
*/
|
||||
private $currentCell;
|
||||
|
||||
/**
|
||||
* Coordinate of the currently active Cell.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $currentCoordinate;
|
||||
|
||||
/**
|
||||
* Flag indicating whether the currently active Cell requires saving.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $currentCellIsDirty = false;
|
||||
|
||||
/**
|
||||
* An index of existing cells. Booleans indexed by their coordinate.
|
||||
*
|
||||
* @var bool[]
|
||||
*/
|
||||
private $index = [];
|
||||
|
||||
/**
|
||||
* Prefix used to uniquely identify cache data for this worksheet.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $cachePrefix;
|
||||
|
||||
/**
|
||||
* Initialise this new cell collection.
|
||||
*
|
||||
* @param Worksheet $parent The worksheet for this cell collection
|
||||
*/
|
||||
public function __construct(Worksheet $parent, CacheInterface $cache)
|
||||
{
|
||||
// Set our parent worksheet.
|
||||
// This is maintained here to facilitate re-attaching it to Cell objects when
|
||||
// they are woken from a serialized state
|
||||
$this->parent = $parent;
|
||||
$this->cache = $cache;
|
||||
$this->cachePrefix = $this->getUniqueID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the parent worksheet for this cell collection.
|
||||
*
|
||||
* @return Worksheet
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the collection holds a cell for the given coordinate.
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell to check
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($pCoord)
|
||||
{
|
||||
if ($pCoord === $this->currentCoordinate) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the requested entry exists in the index
|
||||
return isset($this->index[$pCoord]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or update a cell in the collection.
|
||||
*
|
||||
* @param Cell $cell Cell to update
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public function update(Cell $cell)
|
||||
{
|
||||
return $this->add($cell->getCoordinate(), $cell);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a cell in cache identified by coordinate.
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell to delete
|
||||
*/
|
||||
public function delete($pCoord): void
|
||||
{
|
||||
if ($pCoord === $this->currentCoordinate && $this->currentCell !== null) {
|
||||
$this->currentCell->detach();
|
||||
$this->currentCoordinate = null;
|
||||
$this->currentCell = null;
|
||||
$this->currentCellIsDirty = false;
|
||||
}
|
||||
|
||||
unset($this->index[$pCoord]);
|
||||
|
||||
// Delete the entry from cache
|
||||
$this->cache->delete($this->cachePrefix . $pCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all cell coordinates currently held in the collection.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCoordinates()
|
||||
{
|
||||
return array_keys($this->index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a sorted list of all cell coordinates currently held in the collection by row and column.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSortedCoordinates()
|
||||
{
|
||||
$sortKeys = [];
|
||||
foreach ($this->getCoordinates() as $coord) {
|
||||
$column = '';
|
||||
$row = 0;
|
||||
sscanf($coord, '%[A-Z]%d', $column, $row);
|
||||
$sortKeys[sprintf('%09d%3s', $row, $column)] = $coord;
|
||||
}
|
||||
ksort($sortKeys);
|
||||
|
||||
return array_values($sortKeys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get highest worksheet column and highest row that have cell records.
|
||||
*
|
||||
* @return array Highest column name and highest row number
|
||||
*/
|
||||
public function getHighestRowAndColumn()
|
||||
{
|
||||
// Lookup highest column and highest row
|
||||
$col = ['A' => '1A'];
|
||||
$row = [1];
|
||||
foreach ($this->getCoordinates() as $coord) {
|
||||
$c = '';
|
||||
$r = 0;
|
||||
sscanf($coord, '%[A-Z]%d', $c, $r);
|
||||
$row[$r] = $r;
|
||||
$col[$c] = strlen($c) . $c;
|
||||
}
|
||||
|
||||
// Determine highest column and row
|
||||
$highestRow = max($row);
|
||||
$highestColumn = substr(max($col), 1);
|
||||
|
||||
return [
|
||||
'row' => $highestRow,
|
||||
'column' => $highestColumn,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cell coordinate of the currently active cell object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentCoordinate()
|
||||
{
|
||||
return $this->currentCoordinate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the column coordinate of the currently active cell object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrentColumn()
|
||||
{
|
||||
$column = '';
|
||||
$row = 0;
|
||||
|
||||
sscanf($this->currentCoordinate, '%[A-Z]%d', $column, $row);
|
||||
|
||||
return $column;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the row coordinate of the currently active cell object.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCurrentRow()
|
||||
{
|
||||
$column = '';
|
||||
$row = 0;
|
||||
|
||||
sscanf($this->currentCoordinate, '%[A-Z]%d', $column, $row);
|
||||
|
||||
return (int) $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get highest worksheet column.
|
||||
*
|
||||
* @param string $row Return the highest column for the specified row,
|
||||
* or the highest column of any row if no row number is passed
|
||||
*
|
||||
* @return string Highest column name
|
||||
*/
|
||||
public function getHighestColumn($row = null)
|
||||
{
|
||||
if ($row === null) {
|
||||
$colRow = $this->getHighestRowAndColumn();
|
||||
|
||||
return $colRow['column'];
|
||||
}
|
||||
|
||||
$columnList = [1];
|
||||
foreach ($this->getCoordinates() as $coord) {
|
||||
$c = '';
|
||||
$r = 0;
|
||||
|
||||
sscanf($coord, '%[A-Z]%d', $c, $r);
|
||||
if ($r != $row) {
|
||||
continue;
|
||||
}
|
||||
$columnList[] = Coordinate::columnIndexFromString($c);
|
||||
}
|
||||
|
||||
return Coordinate::stringFromColumnIndex(max($columnList));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get highest worksheet row.
|
||||
*
|
||||
* @param string $column Return the highest row for the specified column,
|
||||
* or the highest row of any column if no column letter is passed
|
||||
*
|
||||
* @return int Highest row number
|
||||
*/
|
||||
public function getHighestRow($column = null)
|
||||
{
|
||||
if ($column === null) {
|
||||
$colRow = $this->getHighestRowAndColumn();
|
||||
|
||||
return $colRow['row'];
|
||||
}
|
||||
|
||||
$rowList = [0];
|
||||
foreach ($this->getCoordinates() as $coord) {
|
||||
$c = '';
|
||||
$r = 0;
|
||||
|
||||
sscanf($coord, '%[A-Z]%d', $c, $r);
|
||||
if ($c != $column) {
|
||||
continue;
|
||||
}
|
||||
$rowList[] = $r;
|
||||
}
|
||||
|
||||
return max($rowList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a unique ID for cache referencing.
|
||||
*
|
||||
* @return string Unique Reference
|
||||
*/
|
||||
private function getUniqueID()
|
||||
{
|
||||
return uniqid('phpspreadsheet.', true) . '.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone the cell collection.
|
||||
*
|
||||
* @param Worksheet $parent The new worksheet that we're copying to
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function cloneCellCollection(Worksheet $parent)
|
||||
{
|
||||
$this->storeCurrentCell();
|
||||
$newCollection = clone $this;
|
||||
|
||||
$newCollection->parent = $parent;
|
||||
if (($newCollection->currentCell !== null) && (is_object($newCollection->currentCell))) {
|
||||
$newCollection->currentCell->attach($this);
|
||||
}
|
||||
|
||||
// Get old values
|
||||
$oldKeys = $newCollection->getAllCacheKeys();
|
||||
$oldValues = $newCollection->cache->getMultiple($oldKeys);
|
||||
$newValues = [];
|
||||
$oldCachePrefix = $newCollection->cachePrefix;
|
||||
|
||||
// Change prefix
|
||||
$newCollection->cachePrefix = $newCollection->getUniqueID();
|
||||
foreach ($oldValues as $oldKey => $value) {
|
||||
$newValues[str_replace($oldCachePrefix, $newCollection->cachePrefix, $oldKey)] = clone $value;
|
||||
}
|
||||
|
||||
// Store new values
|
||||
$stored = $newCollection->cache->setMultiple($newValues);
|
||||
if (!$stored) {
|
||||
$newCollection->__destruct();
|
||||
|
||||
throw new PhpSpreadsheetException('Failed to copy cells in cache');
|
||||
}
|
||||
|
||||
return $newCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a row, deleting all cells in that row.
|
||||
*
|
||||
* @param string $row Row number to remove
|
||||
*/
|
||||
public function removeRow($row): void
|
||||
{
|
||||
foreach ($this->getCoordinates() as $coord) {
|
||||
$c = '';
|
||||
$r = 0;
|
||||
|
||||
sscanf($coord, '%[A-Z]%d', $c, $r);
|
||||
if ($r == $row) {
|
||||
$this->delete($coord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a column, deleting all cells in that column.
|
||||
*
|
||||
* @param string $column Column ID to remove
|
||||
*/
|
||||
public function removeColumn($column): void
|
||||
{
|
||||
foreach ($this->getCoordinates() as $coord) {
|
||||
$c = '';
|
||||
$r = 0;
|
||||
|
||||
sscanf($coord, '%[A-Z]%d', $c, $r);
|
||||
if ($c == $column) {
|
||||
$this->delete($coord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store cell data in cache for the current cell object if it's "dirty",
|
||||
* and the 'nullify' the current cell object.
|
||||
*/
|
||||
private function storeCurrentCell(): void
|
||||
{
|
||||
if ($this->currentCellIsDirty && !empty($this->currentCoordinate)) {
|
||||
$this->currentCell->detach();
|
||||
|
||||
$stored = $this->cache->set($this->cachePrefix . $this->currentCoordinate, $this->currentCell);
|
||||
if (!$stored) {
|
||||
$this->__destruct();
|
||||
|
||||
throw new PhpSpreadsheetException("Failed to store cell {$this->currentCoordinate} in cache");
|
||||
}
|
||||
$this->currentCellIsDirty = false;
|
||||
}
|
||||
|
||||
$this->currentCoordinate = null;
|
||||
$this->currentCell = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or update a cell identified by its coordinate into the collection.
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell to update
|
||||
* @param Cell $cell Cell to update
|
||||
*
|
||||
* @return \PhpOffice\PhpSpreadsheet\Cell\Cell
|
||||
*/
|
||||
public function add($pCoord, Cell $cell)
|
||||
{
|
||||
if ($pCoord !== $this->currentCoordinate) {
|
||||
$this->storeCurrentCell();
|
||||
}
|
||||
$this->index[$pCoord] = true;
|
||||
|
||||
$this->currentCoordinate = $pCoord;
|
||||
$this->currentCell = $cell;
|
||||
$this->currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cell at a specific coordinate.
|
||||
*
|
||||
* @param string $pCoord Coordinate of the cell
|
||||
*
|
||||
* @return null|\PhpOffice\PhpSpreadsheet\Cell\Cell Cell that was found, or null if not found
|
||||
*/
|
||||
public function get($pCoord)
|
||||
{
|
||||
if ($pCoord === $this->currentCoordinate) {
|
||||
return $this->currentCell;
|
||||
}
|
||||
$this->storeCurrentCell();
|
||||
|
||||
// Return null if requested entry doesn't exist in collection
|
||||
if (!$this->has($pCoord)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
$cell = $this->cache->get($this->cachePrefix . $pCoord);
|
||||
if ($cell === null) {
|
||||
throw new PhpSpreadsheetException("Cell entry {$pCoord} no longer exists in cache. This probably means that the cache was cleared by someone else.");
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->currentCoordinate = $pCoord;
|
||||
$this->currentCell = $cell;
|
||||
// Re-attach this as the cell's parent
|
||||
$this->currentCell->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->currentCell;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the cell collection and disconnect from our parent.
|
||||
*/
|
||||
public function unsetWorksheetCells(): void
|
||||
{
|
||||
if ($this->currentCell !== null) {
|
||||
$this->currentCell->detach();
|
||||
$this->currentCell = null;
|
||||
$this->currentCoordinate = null;
|
||||
}
|
||||
|
||||
// Flush the cache
|
||||
$this->__destruct();
|
||||
|
||||
$this->index = [];
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->parent = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy this cell collection.
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
$this->cache->deleteMultiple($this->getAllCacheKeys());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all known cache keys.
|
||||
*
|
||||
* @return Generator|string[]
|
||||
*/
|
||||
private function getAllCacheKeys()
|
||||
{
|
||||
foreach ($this->getCoordinates() as $coordinate) {
|
||||
yield $this->cachePrefix . $coordinate;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Collection;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Settings;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
abstract class CellsFactory
|
||||
{
|
||||
/**
|
||||
* Initialise the cache storage.
|
||||
*
|
||||
* @param Worksheet $parent Enable cell caching for this worksheet
|
||||
*
|
||||
* @return Cells
|
||||
* */
|
||||
public static function getInstance(Worksheet $parent)
|
||||
{
|
||||
return new Cells($parent, Settings::getCache());
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Collection;
|
||||
|
||||
use Psr\SimpleCache\CacheInterface;
|
||||
|
||||
/**
|
||||
* This is the default implementation for in-memory cell collection.
|
||||
*
|
||||
* Alternatives implementation should leverage off-memory, non-volatile storage
|
||||
* to reduce overall memory usage.
|
||||
*/
|
||||
class Memory implements CacheInterface
|
||||
{
|
||||
private $cache = [];
|
||||
|
||||
public function clear()
|
||||
{
|
||||
$this->cache = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delete($key)
|
||||
{
|
||||
unset($this->cache[$key]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
foreach ($keys as $key) {
|
||||
$this->delete($key);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
if ($this->has($key)) {
|
||||
return $this->cache[$key];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
$results = [];
|
||||
foreach ($keys as $key) {
|
||||
$results[$key] = $this->get($key, $default);
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function has($key)
|
||||
{
|
||||
return array_key_exists($key, $this->cache);
|
||||
}
|
||||
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
$this->cache[$key] = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
foreach ($values as $key => $value) {
|
||||
$this->set($key, $value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,329 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
|
||||
class Comment implements IComparable
|
||||
{
|
||||
/**
|
||||
* Author.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $author;
|
||||
|
||||
/**
|
||||
* Rich text comment.
|
||||
*
|
||||
* @var RichText
|
||||
*/
|
||||
private $text;
|
||||
|
||||
/**
|
||||
* Comment width (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $width = '96pt';
|
||||
|
||||
/**
|
||||
* Left margin (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $marginLeft = '59.25pt';
|
||||
|
||||
/**
|
||||
* Top margin (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $marginTop = '1.5pt';
|
||||
|
||||
/**
|
||||
* Visible.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $visible = false;
|
||||
|
||||
/**
|
||||
* Comment height (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $height = '55.5pt';
|
||||
|
||||
/**
|
||||
* Comment fill color.
|
||||
*
|
||||
* @var Style\Color
|
||||
*/
|
||||
private $fillColor;
|
||||
|
||||
/**
|
||||
* Alignment.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $alignment;
|
||||
|
||||
/**
|
||||
* Create a new Comment.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise variables
|
||||
$this->author = 'Author';
|
||||
$this->text = new RichText();
|
||||
$this->fillColor = new Style\Color('FFFFFFE1');
|
||||
$this->alignment = Style\Alignment::HORIZONTAL_GENERAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Author.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthor()
|
||||
{
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Author.
|
||||
*
|
||||
* @param string $author
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAuthor($author)
|
||||
{
|
||||
$this->author = $author;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Rich text comment.
|
||||
*
|
||||
* @return RichText
|
||||
*/
|
||||
public function getText()
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Rich text comment.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setText(RichText $pValue)
|
||||
{
|
||||
$this->text = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get comment width (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set comment width (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @param string $width
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWidth($width)
|
||||
{
|
||||
$this->width = $width;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get comment height (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getHeight()
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set comment height (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeight($value)
|
||||
{
|
||||
$this->height = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get left margin (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMarginLeft()
|
||||
{
|
||||
return $this->marginLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set left margin (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMarginLeft($value)
|
||||
{
|
||||
$this->marginLeft = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get top margin (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMarginTop()
|
||||
{
|
||||
return $this->marginTop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set top margin (CSS style, i.e. XXpx or YYpt).
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMarginTop($value)
|
||||
{
|
||||
$this->marginTop = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the comment visible by default?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getVisible()
|
||||
{
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set comment default visibility.
|
||||
*
|
||||
* @param bool $value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setVisible($value)
|
||||
{
|
||||
$this->visible = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fill color.
|
||||
*
|
||||
* @return Style\Color
|
||||
*/
|
||||
public function getFillColor()
|
||||
{
|
||||
return $this->fillColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Alignment.
|
||||
*
|
||||
* @param string $alignment see Style\Alignment::HORIZONTAL_*
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAlignment($alignment)
|
||||
{
|
||||
$this->alignment = $alignment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Alignment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAlignment()
|
||||
{
|
||||
return $this->alignment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hash code.
|
||||
*
|
||||
* @return string Hash code
|
||||
*/
|
||||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->author .
|
||||
$this->text->getHashCode() .
|
||||
$this->width .
|
||||
$this->height .
|
||||
$this->marginLeft .
|
||||
$this->marginTop .
|
||||
($this->visible ? 1 : 0) .
|
||||
$this->fillColor->getHashCode() .
|
||||
$this->alignment .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
$this->$key = clone $value;
|
||||
} else {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->text->getPlainText();
|
||||
}
|
||||
}
|
@ -1,263 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
abstract class DefinedName
|
||||
{
|
||||
protected const REGEXP_IDENTIFY_FORMULA = '[^_\p{N}\p{L}:, \$\'!]';
|
||||
|
||||
/**
|
||||
* Name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Worksheet on which the defined name can be resolved.
|
||||
*
|
||||
* @var Worksheet
|
||||
*/
|
||||
protected $worksheet;
|
||||
|
||||
/**
|
||||
* Value of the named object.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* Is the defined named local? (i.e. can only be used on $this->worksheet).
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $localOnly;
|
||||
|
||||
/**
|
||||
* Scope.
|
||||
*
|
||||
* @var Worksheet
|
||||
*/
|
||||
protected $scope;
|
||||
|
||||
/**
|
||||
* Whether this is a named range or a named formula.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $isFormula;
|
||||
|
||||
/**
|
||||
* Create a new Defined Name.
|
||||
*/
|
||||
public function __construct(
|
||||
string $name,
|
||||
?Worksheet $worksheet = null,
|
||||
?string $value = null,
|
||||
bool $localOnly = false,
|
||||
?Worksheet $scope = null
|
||||
) {
|
||||
if ($worksheet === null) {
|
||||
$worksheet = $scope;
|
||||
}
|
||||
|
||||
// Set local members
|
||||
$this->name = $name;
|
||||
$this->worksheet = $worksheet;
|
||||
$this->value = (string) $value;
|
||||
$this->localOnly = $localOnly;
|
||||
// If local only, then the scope will be set to worksheet unless a scope is explicitly set
|
||||
$this->scope = ($localOnly === true) ? (($scope === null) ? $worksheet : $scope) : null;
|
||||
// If the range string contains characters that aren't associated with the range definition (A-Z,1-9
|
||||
// for cell references, and $, or the range operators (colon comma or space), quotes and ! for
|
||||
// worksheet names
|
||||
// then this is treated as a named formula, and not a named range
|
||||
$this->isFormula = self::testIfFormula($this->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new defined name, either a range or a formula.
|
||||
*/
|
||||
public static function createInstance(
|
||||
string $name,
|
||||
?Worksheet $worksheet = null,
|
||||
?string $value = null,
|
||||
bool $localOnly = false,
|
||||
?Worksheet $scope = null
|
||||
): self {
|
||||
$value = (string) $value;
|
||||
$isFormula = self::testIfFormula($value);
|
||||
if ($isFormula) {
|
||||
return new NamedFormula($name, $worksheet, $value, $localOnly, $scope);
|
||||
}
|
||||
|
||||
return new NamedRange($name, $worksheet, $value, $localOnly, $scope);
|
||||
}
|
||||
|
||||
public static function testIfFormula(string $value): bool
|
||||
{
|
||||
if (substr($value, 0, 1) === '=') {
|
||||
$value = substr($value, 1);
|
||||
}
|
||||
|
||||
if (is_numeric($value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$segMatcher = false;
|
||||
foreach (explode("'", $value) as $subVal) {
|
||||
// Only test in alternate array entries (the non-quoted blocks)
|
||||
if (
|
||||
($segMatcher = !$segMatcher) &&
|
||||
(preg_match('/' . self::REGEXP_IDENTIFY_FORMULA . '/miu', $subVal))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name.
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name.
|
||||
*/
|
||||
public function setName(string $name): self
|
||||
{
|
||||
if (!empty($name)) {
|
||||
// Old title
|
||||
$oldTitle = $this->name;
|
||||
|
||||
// Re-attach
|
||||
if ($this->worksheet !== null) {
|
||||
$this->worksheet->getParent()->removeNamedRange($this->name, $this->worksheet);
|
||||
}
|
||||
$this->name = $name;
|
||||
|
||||
if ($this->worksheet !== null) {
|
||||
$this->worksheet->getParent()->addNamedRange($this);
|
||||
}
|
||||
|
||||
// New title
|
||||
$newTitle = $this->name;
|
||||
ReferenceHelper::getInstance()->updateNamedFormulas($this->worksheet->getParent(), $oldTitle, $newTitle);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get worksheet.
|
||||
*/
|
||||
public function getWorksheet(): ?Worksheet
|
||||
{
|
||||
return $this->worksheet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set worksheet.
|
||||
*/
|
||||
public function setWorksheet(?Worksheet $value): self
|
||||
{
|
||||
$this->worksheet = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get range or formula value.
|
||||
*/
|
||||
public function getValue(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set range or formula value.
|
||||
*/
|
||||
public function setValue(string $value): self
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get localOnly.
|
||||
*/
|
||||
public function getLocalOnly(): bool
|
||||
{
|
||||
return $this->localOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set localOnly.
|
||||
*/
|
||||
public function setLocalOnly(bool $value): self
|
||||
{
|
||||
$this->localOnly = $value;
|
||||
$this->scope = $value ? $this->worksheet : null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get scope.
|
||||
*/
|
||||
public function getScope(): ?Worksheet
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set scope.
|
||||
*/
|
||||
public function setScope(?Worksheet $value): self
|
||||
{
|
||||
$this->scope = $value;
|
||||
$this->localOnly = $value !== null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Identify whether this is a named range or a named formula.
|
||||
*/
|
||||
public function isFormula(): bool
|
||||
{
|
||||
return $this->isFormula;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a named range to a regular cell range or formula.
|
||||
*/
|
||||
public static function resolveName(string $pDefinedName, Worksheet $pSheet): ?self
|
||||
{
|
||||
return $pSheet->getParent()->getDefinedName($pDefinedName, $pSheet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
$this->$key = clone $value;
|
||||
} else {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,632 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Document;
|
||||
|
||||
class Properties
|
||||
{
|
||||
/** constants */
|
||||
const PROPERTY_TYPE_BOOLEAN = 'b';
|
||||
const PROPERTY_TYPE_INTEGER = 'i';
|
||||
const PROPERTY_TYPE_FLOAT = 'f';
|
||||
const PROPERTY_TYPE_DATE = 'd';
|
||||
const PROPERTY_TYPE_STRING = 's';
|
||||
const PROPERTY_TYPE_UNKNOWN = 'u';
|
||||
|
||||
/**
|
||||
* Creator.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $creator = 'Unknown Creator';
|
||||
|
||||
/**
|
||||
* LastModifiedBy.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $lastModifiedBy;
|
||||
|
||||
/**
|
||||
* Created.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $created;
|
||||
|
||||
/**
|
||||
* Modified.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $modified;
|
||||
|
||||
/**
|
||||
* Title.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $title = 'Untitled Spreadsheet';
|
||||
|
||||
/**
|
||||
* Description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $description = '';
|
||||
|
||||
/**
|
||||
* Subject.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $subject = '';
|
||||
|
||||
/**
|
||||
* Keywords.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $keywords = '';
|
||||
|
||||
/**
|
||||
* Category.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $category = '';
|
||||
|
||||
/**
|
||||
* Manager.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $manager = '';
|
||||
|
||||
/**
|
||||
* Company.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $company = 'Microsoft Corporation';
|
||||
|
||||
/**
|
||||
* Custom Properties.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $customProperties = [];
|
||||
|
||||
/**
|
||||
* Create a new Document Properties instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->lastModifiedBy = $this->creator;
|
||||
$this->created = time();
|
||||
$this->modified = time();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Creator.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCreator()
|
||||
{
|
||||
return $this->creator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Creator.
|
||||
*
|
||||
* @param string $creator
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreator($creator)
|
||||
{
|
||||
$this->creator = $creator;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Last Modified By.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastModifiedBy()
|
||||
{
|
||||
return $this->lastModifiedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Last Modified By.
|
||||
*
|
||||
* @param string $pValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastModifiedBy($pValue)
|
||||
{
|
||||
$this->lastModifiedBy = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Created.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCreated()
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Created.
|
||||
*
|
||||
* @param int|string $time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreated($time)
|
||||
{
|
||||
if ($time === null) {
|
||||
$time = time();
|
||||
} elseif (is_string($time)) {
|
||||
if (is_numeric($time)) {
|
||||
$time = (int) $time;
|
||||
} else {
|
||||
$time = strtotime($time);
|
||||
}
|
||||
}
|
||||
|
||||
$this->created = $time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Modified.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getModified()
|
||||
{
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Modified.
|
||||
*
|
||||
* @param int|string $time
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setModified($time)
|
||||
{
|
||||
if ($time === null) {
|
||||
$time = time();
|
||||
} elseif (is_string($time)) {
|
||||
if (is_numeric($time)) {
|
||||
$time = (int) $time;
|
||||
} else {
|
||||
$time = strtotime($time);
|
||||
}
|
||||
}
|
||||
|
||||
$this->modified = $time;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Title.
|
||||
*
|
||||
* @param string $title
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Description.
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Subject.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Subject.
|
||||
*
|
||||
* @param string $subject
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSubject($subject)
|
||||
{
|
||||
$this->subject = $subject;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Keywords.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getKeywords()
|
||||
{
|
||||
return $this->keywords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Keywords.
|
||||
*
|
||||
* @param string $keywords
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setKeywords($keywords)
|
||||
{
|
||||
$this->keywords = $keywords;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Category.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Category.
|
||||
*
|
||||
* @param string $category
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCategory($category)
|
||||
{
|
||||
$this->category = $category;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Company.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCompany()
|
||||
{
|
||||
return $this->company;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Company.
|
||||
*
|
||||
* @param string $company
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCompany($company)
|
||||
{
|
||||
$this->company = $company;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Manager.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getManager()
|
||||
{
|
||||
return $this->manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Manager.
|
||||
*
|
||||
* @param string $manager
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setManager($manager)
|
||||
{
|
||||
$this->manager = $manager;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a List of Custom Property Names.
|
||||
*
|
||||
* @return array of string
|
||||
*/
|
||||
public function getCustomProperties()
|
||||
{
|
||||
return array_keys($this->customProperties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a Custom Property is defined.
|
||||
*
|
||||
* @param string $propertyName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isCustomPropertySet($propertyName)
|
||||
{
|
||||
return isset($this->customProperties[$propertyName]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Custom Property Value.
|
||||
*
|
||||
* @param string $propertyName
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCustomPropertyValue($propertyName)
|
||||
{
|
||||
if (isset($this->customProperties[$propertyName])) {
|
||||
return $this->customProperties[$propertyName]['value'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Custom Property Type.
|
||||
*
|
||||
* @param string $propertyName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCustomPropertyType($propertyName)
|
||||
{
|
||||
if (isset($this->customProperties[$propertyName])) {
|
||||
return $this->customProperties[$propertyName]['type'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Custom Property.
|
||||
*
|
||||
* @param string $propertyName
|
||||
* @param mixed $propertyValue
|
||||
* @param string $propertyType
|
||||
* 'i' : Integer
|
||||
* 'f' : Floating Point
|
||||
* 's' : String
|
||||
* 'd' : Date/Time
|
||||
* 'b' : Boolean
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
|
||||
{
|
||||
if (
|
||||
($propertyType === null) || (!in_array($propertyType, [self::PROPERTY_TYPE_INTEGER,
|
||||
self::PROPERTY_TYPE_FLOAT,
|
||||
self::PROPERTY_TYPE_STRING,
|
||||
self::PROPERTY_TYPE_DATE,
|
||||
self::PROPERTY_TYPE_BOOLEAN,
|
||||
]))
|
||||
) {
|
||||
if ($propertyValue === null) {
|
||||
$propertyType = self::PROPERTY_TYPE_STRING;
|
||||
} elseif (is_float($propertyValue)) {
|
||||
$propertyType = self::PROPERTY_TYPE_FLOAT;
|
||||
} elseif (is_int($propertyValue)) {
|
||||
$propertyType = self::PROPERTY_TYPE_INTEGER;
|
||||
} elseif (is_bool($propertyValue)) {
|
||||
$propertyType = self::PROPERTY_TYPE_BOOLEAN;
|
||||
} else {
|
||||
$propertyType = self::PROPERTY_TYPE_STRING;
|
||||
}
|
||||
}
|
||||
|
||||
$this->customProperties[$propertyName] = [
|
||||
'value' => $propertyValue,
|
||||
'type' => $propertyType,
|
||||
];
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
$this->$key = clone $value;
|
||||
} else {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function convertProperty($propertyValue, $propertyType)
|
||||
{
|
||||
switch ($propertyType) {
|
||||
case 'empty': // Empty
|
||||
return '';
|
||||
|
||||
break;
|
||||
case 'null': // Null
|
||||
return null;
|
||||
|
||||
break;
|
||||
case 'i1': // 1-Byte Signed Integer
|
||||
case 'i2': // 2-Byte Signed Integer
|
||||
case 'i4': // 4-Byte Signed Integer
|
||||
case 'i8': // 8-Byte Signed Integer
|
||||
case 'int': // Integer
|
||||
return (int) $propertyValue;
|
||||
|
||||
break;
|
||||
case 'ui1': // 1-Byte Unsigned Integer
|
||||
case 'ui2': // 2-Byte Unsigned Integer
|
||||
case 'ui4': // 4-Byte Unsigned Integer
|
||||
case 'ui8': // 8-Byte Unsigned Integer
|
||||
case 'uint': // Unsigned Integer
|
||||
return abs((int) $propertyValue);
|
||||
|
||||
break;
|
||||
case 'r4': // 4-Byte Real Number
|
||||
case 'r8': // 8-Byte Real Number
|
||||
case 'decimal': // Decimal
|
||||
return (float) $propertyValue;
|
||||
|
||||
break;
|
||||
case 'lpstr': // LPSTR
|
||||
case 'lpwstr': // LPWSTR
|
||||
case 'bstr': // Basic String
|
||||
return $propertyValue;
|
||||
|
||||
break;
|
||||
case 'date': // Date and Time
|
||||
case 'filetime': // File Time
|
||||
return strtotime($propertyValue);
|
||||
|
||||
break;
|
||||
case 'bool': // Boolean
|
||||
return $propertyValue == 'true';
|
||||
|
||||
break;
|
||||
case 'cy': // Currency
|
||||
case 'error': // Error Status Code
|
||||
case 'vector': // Vector
|
||||
case 'array': // Array
|
||||
case 'blob': // Binary Blob
|
||||
case 'oblob': // Binary Blob Object
|
||||
case 'stream': // Binary Stream
|
||||
case 'ostream': // Binary Stream Object
|
||||
case 'storage': // Binary Storage
|
||||
case 'ostorage': // Binary Storage Object
|
||||
case 'vstream': // Binary Versioned Stream
|
||||
case 'clsid': // Class ID
|
||||
case 'cf': // Clipboard Data
|
||||
return $propertyValue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return $propertyValue;
|
||||
}
|
||||
|
||||
public static function convertPropertyType($propertyType)
|
||||
{
|
||||
switch ($propertyType) {
|
||||
case 'i1': // 1-Byte Signed Integer
|
||||
case 'i2': // 2-Byte Signed Integer
|
||||
case 'i4': // 4-Byte Signed Integer
|
||||
case 'i8': // 8-Byte Signed Integer
|
||||
case 'int': // Integer
|
||||
case 'ui1': // 1-Byte Unsigned Integer
|
||||
case 'ui2': // 2-Byte Unsigned Integer
|
||||
case 'ui4': // 4-Byte Unsigned Integer
|
||||
case 'ui8': // 8-Byte Unsigned Integer
|
||||
case 'uint': // Unsigned Integer
|
||||
return self::PROPERTY_TYPE_INTEGER;
|
||||
|
||||
break;
|
||||
case 'r4': // 4-Byte Real Number
|
||||
case 'r8': // 8-Byte Real Number
|
||||
case 'decimal': // Decimal
|
||||
return self::PROPERTY_TYPE_FLOAT;
|
||||
|
||||
break;
|
||||
case 'empty': // Empty
|
||||
case 'null': // Null
|
||||
case 'lpstr': // LPSTR
|
||||
case 'lpwstr': // LPWSTR
|
||||
case 'bstr': // Basic String
|
||||
return self::PROPERTY_TYPE_STRING;
|
||||
|
||||
break;
|
||||
case 'date': // Date and Time
|
||||
case 'filetime': // File Time
|
||||
return self::PROPERTY_TYPE_DATE;
|
||||
|
||||
break;
|
||||
case 'bool': // Boolean
|
||||
return self::PROPERTY_TYPE_BOOLEAN;
|
||||
|
||||
break;
|
||||
case 'cy': // Currency
|
||||
case 'error': // Error Status Code
|
||||
case 'vector': // Vector
|
||||
case 'array': // Array
|
||||
case 'blob': // Binary Blob
|
||||
case 'oblob': // Binary Blob Object
|
||||
case 'stream': // Binary Stream
|
||||
case 'ostream': // Binary Stream Object
|
||||
case 'storage': // Binary Storage
|
||||
case 'ostorage': // Binary Storage Object
|
||||
case 'vstream': // Binary Versioned Stream
|
||||
case 'clsid': // Class ID
|
||||
case 'cf': // Clipboard Data
|
||||
return self::PROPERTY_TYPE_UNKNOWN;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return self::PROPERTY_TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
@ -1,205 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Document;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\PasswordHasher;
|
||||
|
||||
class Security
|
||||
{
|
||||
/**
|
||||
* LockRevision.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $lockRevision = false;
|
||||
|
||||
/**
|
||||
* LockStructure.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $lockStructure = false;
|
||||
|
||||
/**
|
||||
* LockWindows.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $lockWindows = false;
|
||||
|
||||
/**
|
||||
* RevisionsPassword.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $revisionsPassword = '';
|
||||
|
||||
/**
|
||||
* WorkbookPassword.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $workbookPassword = '';
|
||||
|
||||
/**
|
||||
* Create a new Document Security instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Is some sort of document security enabled?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSecurityEnabled()
|
||||
{
|
||||
return $this->lockRevision ||
|
||||
$this->lockStructure ||
|
||||
$this->lockWindows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LockRevision.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getLockRevision()
|
||||
{
|
||||
return $this->lockRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set LockRevision.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLockRevision($pValue)
|
||||
{
|
||||
$this->lockRevision = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LockStructure.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getLockStructure()
|
||||
{
|
||||
return $this->lockStructure;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set LockStructure.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLockStructure($pValue)
|
||||
{
|
||||
$this->lockStructure = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LockWindows.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getLockWindows()
|
||||
{
|
||||
return $this->lockWindows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set LockWindows.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLockWindows($pValue)
|
||||
{
|
||||
$this->lockWindows = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get RevisionsPassword (hashed).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRevisionsPassword()
|
||||
{
|
||||
return $this->revisionsPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set RevisionsPassword.
|
||||
*
|
||||
* @param string $pValue
|
||||
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRevisionsPassword($pValue, $pAlreadyHashed = false)
|
||||
{
|
||||
if (!$pAlreadyHashed) {
|
||||
$pValue = PasswordHasher::hashPassword($pValue);
|
||||
}
|
||||
$this->revisionsPassword = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get WorkbookPassword (hashed).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getWorkbookPassword()
|
||||
{
|
||||
return $this->workbookPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set WorkbookPassword.
|
||||
*
|
||||
* @param string $pValue
|
||||
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWorkbookPassword($pValue, $pAlreadyHashed = false)
|
||||
{
|
||||
if (!$pAlreadyHashed) {
|
||||
$pValue = PasswordHasher::hashPassword($pValue);
|
||||
}
|
||||
$this->workbookPassword = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
$this->$key = clone $value;
|
||||
} else {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Category;
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
||||
use ReflectionClass;
|
||||
use UnexpectedValueException;
|
||||
|
||||
class DocumentGenerator
|
||||
{
|
||||
/**
|
||||
* @param array[] $phpSpreadsheetFunctions
|
||||
*/
|
||||
public static function generateFunctionListByCategory(array $phpSpreadsheetFunctions): string
|
||||
{
|
||||
$result = "# Function list by category\n";
|
||||
foreach (self::getCategories() as $categoryConstant => $category) {
|
||||
$result .= "\n";
|
||||
$result .= "## {$categoryConstant}\n";
|
||||
$result .= "\n";
|
||||
$lengths = [20, 42];
|
||||
$result .= self::tableRow($lengths, ['Excel Function', 'PhpSpreadsheet Function']) . "\n";
|
||||
$result .= self::tableRow($lengths, null) . "\n";
|
||||
foreach ($phpSpreadsheetFunctions as $excelFunction => $functionInfo) {
|
||||
if ($category === $functionInfo['category']) {
|
||||
$phpFunction = self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']);
|
||||
$result .= self::tableRow($lengths, [$excelFunction, $phpFunction]) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private static function getCategories(): array
|
||||
{
|
||||
return (new ReflectionClass(Category::class))->getConstants();
|
||||
}
|
||||
|
||||
private static function tableRow(array $lengths, ?array $values = null): string
|
||||
{
|
||||
$result = '';
|
||||
foreach (array_map(null, $lengths, $values ?? []) as $i => [$length, $value]) {
|
||||
$pad = $value === null ? '-' : ' ';
|
||||
if ($i > 0) {
|
||||
$result .= '|' . $pad;
|
||||
}
|
||||
$result .= str_pad($value ?? '', $length, $pad);
|
||||
}
|
||||
|
||||
return rtrim($result, ' ');
|
||||
}
|
||||
|
||||
private static function getPhpSpreadsheetFunctionText($functionCall): string
|
||||
{
|
||||
if (is_string($functionCall)) {
|
||||
return $functionCall;
|
||||
}
|
||||
if ($functionCall === [Functions::class, 'DUMMY']) {
|
||||
return '**Not yet Implemented**';
|
||||
}
|
||||
if (is_array($functionCall)) {
|
||||
return "\\{$functionCall[0]}::{$functionCall[1]}";
|
||||
}
|
||||
|
||||
throw new UnexpectedValueException(
|
||||
'$functionCall is of type ' . gettype($functionCall) . '. string or array expected'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array[] $phpSpreadsheetFunctions
|
||||
*/
|
||||
public static function generateFunctionListByName(array $phpSpreadsheetFunctions): string
|
||||
{
|
||||
$categoryConstants = array_flip(self::getCategories());
|
||||
$result = "# Function list by name\n";
|
||||
$lastAlphabet = null;
|
||||
foreach ($phpSpreadsheetFunctions as $excelFunction => $functionInfo) {
|
||||
$lengths = [20, 31, 42];
|
||||
if ($lastAlphabet !== $excelFunction[0]) {
|
||||
$lastAlphabet = $excelFunction[0];
|
||||
$result .= "\n";
|
||||
$result .= "## {$lastAlphabet}\n";
|
||||
$result .= "\n";
|
||||
$result .= self::tableRow($lengths, ['Excel Function', 'Category', 'PhpSpreadsheet Function']) . "\n";
|
||||
$result .= self::tableRow($lengths, null) . "\n";
|
||||
}
|
||||
$category = $categoryConstants[$functionInfo['category']];
|
||||
$phpFunction = self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']);
|
||||
$result .= self::tableRow($lengths, [$excelFunction, $category, $phpFunction]) . "\n";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
class Exception extends \Exception
|
||||
{
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
class HashTable
|
||||
{
|
||||
/**
|
||||
* HashTable elements.
|
||||
*
|
||||
* @var IComparable[]
|
||||
*/
|
||||
protected $items = [];
|
||||
|
||||
/**
|
||||
* HashTable key map.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $keyMap = [];
|
||||
|
||||
/**
|
||||
* Create a new \PhpOffice\PhpSpreadsheet\HashTable.
|
||||
*
|
||||
* @param IComparable[] $pSource Optional source array to create HashTable from
|
||||
*/
|
||||
public function __construct($pSource = null)
|
||||
{
|
||||
if ($pSource !== null) {
|
||||
// Create HashTable
|
||||
$this->addFromSource($pSource);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add HashTable items from source.
|
||||
*
|
||||
* @param IComparable[] $pSource Source array to create HashTable from
|
||||
*/
|
||||
public function addFromSource(?array $pSource = null): void
|
||||
{
|
||||
// Check if an array was passed
|
||||
if ($pSource == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($pSource as $item) {
|
||||
$this->add($item);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add HashTable item.
|
||||
*
|
||||
* @param IComparable $pSource Item to add
|
||||
*/
|
||||
public function add(IComparable $pSource): void
|
||||
{
|
||||
$hash = $pSource->getHashCode();
|
||||
if (!isset($this->items[$hash])) {
|
||||
$this->items[$hash] = $pSource;
|
||||
$this->keyMap[count($this->items) - 1] = $hash;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove HashTable item.
|
||||
*
|
||||
* @param IComparable $pSource Item to remove
|
||||
*/
|
||||
public function remove(IComparable $pSource): void
|
||||
{
|
||||
$hash = $pSource->getHashCode();
|
||||
if (isset($this->items[$hash])) {
|
||||
unset($this->items[$hash]);
|
||||
|
||||
$deleteKey = -1;
|
||||
foreach ($this->keyMap as $key => $value) {
|
||||
if ($deleteKey >= 0) {
|
||||
$this->keyMap[$key - 1] = $value;
|
||||
}
|
||||
|
||||
if ($value == $hash) {
|
||||
$deleteKey = $key;
|
||||
}
|
||||
}
|
||||
unset($this->keyMap[count($this->keyMap) - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear HashTable.
|
||||
*/
|
||||
public function clear(): void
|
||||
{
|
||||
$this->items = [];
|
||||
$this->keyMap = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Count.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->items);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get index for hash code.
|
||||
*
|
||||
* @param string $pHashCode
|
||||
*
|
||||
* @return int Index
|
||||
*/
|
||||
public function getIndexForHashCode($pHashCode)
|
||||
{
|
||||
return array_search($pHashCode, $this->keyMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get by index.
|
||||
*
|
||||
* @param int $pIndex
|
||||
*
|
||||
* @return IComparable
|
||||
*/
|
||||
public function getByIndex($pIndex)
|
||||
{
|
||||
if (isset($this->keyMap[$pIndex])) {
|
||||
return $this->getByHashCode($this->keyMap[$pIndex]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get by hashcode.
|
||||
*
|
||||
* @param string $pHashCode
|
||||
*
|
||||
* @return IComparable
|
||||
*/
|
||||
public function getByHashCode($pHashCode)
|
||||
{
|
||||
if (isset($this->items[$pHashCode])) {
|
||||
return $this->items[$pHashCode];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* HashTable to array.
|
||||
*
|
||||
* @return IComparable[]
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if (is_object($value)) {
|
||||
$this->$key = clone $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,839 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Helper;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use DOMNode;
|
||||
use DOMText;
|
||||
use PhpOffice\PhpSpreadsheet\RichText\RichText;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Color;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Font;
|
||||
|
||||
class Html
|
||||
{
|
||||
protected static $colourMap = [
|
||||
'aliceblue' => 'f0f8ff',
|
||||
'antiquewhite' => 'faebd7',
|
||||
'antiquewhite1' => 'ffefdb',
|
||||
'antiquewhite2' => 'eedfcc',
|
||||
'antiquewhite3' => 'cdc0b0',
|
||||
'antiquewhite4' => '8b8378',
|
||||
'aqua' => '00ffff',
|
||||
'aquamarine1' => '7fffd4',
|
||||
'aquamarine2' => '76eec6',
|
||||
'aquamarine4' => '458b74',
|
||||
'azure1' => 'f0ffff',
|
||||
'azure2' => 'e0eeee',
|
||||
'azure3' => 'c1cdcd',
|
||||
'azure4' => '838b8b',
|
||||
'beige' => 'f5f5dc',
|
||||
'bisque1' => 'ffe4c4',
|
||||
'bisque2' => 'eed5b7',
|
||||
'bisque3' => 'cdb79e',
|
||||
'bisque4' => '8b7d6b',
|
||||
'black' => '000000',
|
||||
'blanchedalmond' => 'ffebcd',
|
||||
'blue' => '0000ff',
|
||||
'blue1' => '0000ff',
|
||||
'blue2' => '0000ee',
|
||||
'blue4' => '00008b',
|
||||
'blueviolet' => '8a2be2',
|
||||
'brown' => 'a52a2a',
|
||||
'brown1' => 'ff4040',
|
||||
'brown2' => 'ee3b3b',
|
||||
'brown3' => 'cd3333',
|
||||
'brown4' => '8b2323',
|
||||
'burlywood' => 'deb887',
|
||||
'burlywood1' => 'ffd39b',
|
||||
'burlywood2' => 'eec591',
|
||||
'burlywood3' => 'cdaa7d',
|
||||
'burlywood4' => '8b7355',
|
||||
'cadetblue' => '5f9ea0',
|
||||
'cadetblue1' => '98f5ff',
|
||||
'cadetblue2' => '8ee5ee',
|
||||
'cadetblue3' => '7ac5cd',
|
||||
'cadetblue4' => '53868b',
|
||||
'chartreuse1' => '7fff00',
|
||||
'chartreuse2' => '76ee00',
|
||||
'chartreuse3' => '66cd00',
|
||||
'chartreuse4' => '458b00',
|
||||
'chocolate' => 'd2691e',
|
||||
'chocolate1' => 'ff7f24',
|
||||
'chocolate2' => 'ee7621',
|
||||
'chocolate3' => 'cd661d',
|
||||
'coral' => 'ff7f50',
|
||||
'coral1' => 'ff7256',
|
||||
'coral2' => 'ee6a50',
|
||||
'coral3' => 'cd5b45',
|
||||
'coral4' => '8b3e2f',
|
||||
'cornflowerblue' => '6495ed',
|
||||
'cornsilk1' => 'fff8dc',
|
||||
'cornsilk2' => 'eee8cd',
|
||||
'cornsilk3' => 'cdc8b1',
|
||||
'cornsilk4' => '8b8878',
|
||||
'cyan1' => '00ffff',
|
||||
'cyan2' => '00eeee',
|
||||
'cyan3' => '00cdcd',
|
||||
'cyan4' => '008b8b',
|
||||
'darkgoldenrod' => 'b8860b',
|
||||
'darkgoldenrod1' => 'ffb90f',
|
||||
'darkgoldenrod2' => 'eead0e',
|
||||
'darkgoldenrod3' => 'cd950c',
|
||||
'darkgoldenrod4' => '8b6508',
|
||||
'darkgreen' => '006400',
|
||||
'darkkhaki' => 'bdb76b',
|
||||
'darkolivegreen' => '556b2f',
|
||||
'darkolivegreen1' => 'caff70',
|
||||
'darkolivegreen2' => 'bcee68',
|
||||
'darkolivegreen3' => 'a2cd5a',
|
||||
'darkolivegreen4' => '6e8b3d',
|
||||
'darkorange' => 'ff8c00',
|
||||
'darkorange1' => 'ff7f00',
|
||||
'darkorange2' => 'ee7600',
|
||||
'darkorange3' => 'cd6600',
|
||||
'darkorange4' => '8b4500',
|
||||
'darkorchid' => '9932cc',
|
||||
'darkorchid1' => 'bf3eff',
|
||||
'darkorchid2' => 'b23aee',
|
||||
'darkorchid3' => '9a32cd',
|
||||
'darkorchid4' => '68228b',
|
||||
'darksalmon' => 'e9967a',
|
||||
'darkseagreen' => '8fbc8f',
|
||||
'darkseagreen1' => 'c1ffc1',
|
||||
'darkseagreen2' => 'b4eeb4',
|
||||
'darkseagreen3' => '9bcd9b',
|
||||
'darkseagreen4' => '698b69',
|
||||
'darkslateblue' => '483d8b',
|
||||
'darkslategray' => '2f4f4f',
|
||||
'darkslategray1' => '97ffff',
|
||||
'darkslategray2' => '8deeee',
|
||||
'darkslategray3' => '79cdcd',
|
||||
'darkslategray4' => '528b8b',
|
||||
'darkturquoise' => '00ced1',
|
||||
'darkviolet' => '9400d3',
|
||||
'deeppink1' => 'ff1493',
|
||||
'deeppink2' => 'ee1289',
|
||||
'deeppink3' => 'cd1076',
|
||||
'deeppink4' => '8b0a50',
|
||||
'deepskyblue1' => '00bfff',
|
||||
'deepskyblue2' => '00b2ee',
|
||||
'deepskyblue3' => '009acd',
|
||||
'deepskyblue4' => '00688b',
|
||||
'dimgray' => '696969',
|
||||
'dodgerblue1' => '1e90ff',
|
||||
'dodgerblue2' => '1c86ee',
|
||||
'dodgerblue3' => '1874cd',
|
||||
'dodgerblue4' => '104e8b',
|
||||
'firebrick' => 'b22222',
|
||||
'firebrick1' => 'ff3030',
|
||||
'firebrick2' => 'ee2c2c',
|
||||
'firebrick3' => 'cd2626',
|
||||
'firebrick4' => '8b1a1a',
|
||||
'floralwhite' => 'fffaf0',
|
||||
'forestgreen' => '228b22',
|
||||
'fuchsia' => 'ff00ff',
|
||||
'gainsboro' => 'dcdcdc',
|
||||
'ghostwhite' => 'f8f8ff',
|
||||
'gold1' => 'ffd700',
|
||||
'gold2' => 'eec900',
|
||||
'gold3' => 'cdad00',
|
||||
'gold4' => '8b7500',
|
||||
'goldenrod' => 'daa520',
|
||||
'goldenrod1' => 'ffc125',
|
||||
'goldenrod2' => 'eeb422',
|
||||
'goldenrod3' => 'cd9b1d',
|
||||
'goldenrod4' => '8b6914',
|
||||
'gray' => 'bebebe',
|
||||
'gray1' => '030303',
|
||||
'gray10' => '1a1a1a',
|
||||
'gray11' => '1c1c1c',
|
||||
'gray12' => '1f1f1f',
|
||||
'gray13' => '212121',
|
||||
'gray14' => '242424',
|
||||
'gray15' => '262626',
|
||||
'gray16' => '292929',
|
||||
'gray17' => '2b2b2b',
|
||||
'gray18' => '2e2e2e',
|
||||
'gray19' => '303030',
|
||||
'gray2' => '050505',
|
||||
'gray20' => '333333',
|
||||
'gray21' => '363636',
|
||||
'gray22' => '383838',
|
||||
'gray23' => '3b3b3b',
|
||||
'gray24' => '3d3d3d',
|
||||
'gray25' => '404040',
|
||||
'gray26' => '424242',
|
||||
'gray27' => '454545',
|
||||
'gray28' => '474747',
|
||||
'gray29' => '4a4a4a',
|
||||
'gray3' => '080808',
|
||||
'gray30' => '4d4d4d',
|
||||
'gray31' => '4f4f4f',
|
||||
'gray32' => '525252',
|
||||
'gray33' => '545454',
|
||||
'gray34' => '575757',
|
||||
'gray35' => '595959',
|
||||
'gray36' => '5c5c5c',
|
||||
'gray37' => '5e5e5e',
|
||||
'gray38' => '616161',
|
||||
'gray39' => '636363',
|
||||
'gray4' => '0a0a0a',
|
||||
'gray40' => '666666',
|
||||
'gray41' => '696969',
|
||||
'gray42' => '6b6b6b',
|
||||
'gray43' => '6e6e6e',
|
||||
'gray44' => '707070',
|
||||
'gray45' => '737373',
|
||||
'gray46' => '757575',
|
||||
'gray47' => '787878',
|
||||
'gray48' => '7a7a7a',
|
||||
'gray49' => '7d7d7d',
|
||||
'gray5' => '0d0d0d',
|
||||
'gray50' => '7f7f7f',
|
||||
'gray51' => '828282',
|
||||
'gray52' => '858585',
|
||||
'gray53' => '878787',
|
||||
'gray54' => '8a8a8a',
|
||||
'gray55' => '8c8c8c',
|
||||
'gray56' => '8f8f8f',
|
||||
'gray57' => '919191',
|
||||
'gray58' => '949494',
|
||||
'gray59' => '969696',
|
||||
'gray6' => '0f0f0f',
|
||||
'gray60' => '999999',
|
||||
'gray61' => '9c9c9c',
|
||||
'gray62' => '9e9e9e',
|
||||
'gray63' => 'a1a1a1',
|
||||
'gray64' => 'a3a3a3',
|
||||
'gray65' => 'a6a6a6',
|
||||
'gray66' => 'a8a8a8',
|
||||
'gray67' => 'ababab',
|
||||
'gray68' => 'adadad',
|
||||
'gray69' => 'b0b0b0',
|
||||
'gray7' => '121212',
|
||||
'gray70' => 'b3b3b3',
|
||||
'gray71' => 'b5b5b5',
|
||||
'gray72' => 'b8b8b8',
|
||||
'gray73' => 'bababa',
|
||||
'gray74' => 'bdbdbd',
|
||||
'gray75' => 'bfbfbf',
|
||||
'gray76' => 'c2c2c2',
|
||||
'gray77' => 'c4c4c4',
|
||||
'gray78' => 'c7c7c7',
|
||||
'gray79' => 'c9c9c9',
|
||||
'gray8' => '141414',
|
||||
'gray80' => 'cccccc',
|
||||
'gray81' => 'cfcfcf',
|
||||
'gray82' => 'd1d1d1',
|
||||
'gray83' => 'd4d4d4',
|
||||
'gray84' => 'd6d6d6',
|
||||
'gray85' => 'd9d9d9',
|
||||
'gray86' => 'dbdbdb',
|
||||
'gray87' => 'dedede',
|
||||
'gray88' => 'e0e0e0',
|
||||
'gray89' => 'e3e3e3',
|
||||
'gray9' => '171717',
|
||||
'gray90' => 'e5e5e5',
|
||||
'gray91' => 'e8e8e8',
|
||||
'gray92' => 'ebebeb',
|
||||
'gray93' => 'ededed',
|
||||
'gray94' => 'f0f0f0',
|
||||
'gray95' => 'f2f2f2',
|
||||
'gray97' => 'f7f7f7',
|
||||
'gray98' => 'fafafa',
|
||||
'gray99' => 'fcfcfc',
|
||||
'green' => '00ff00',
|
||||
'green1' => '00ff00',
|
||||
'green2' => '00ee00',
|
||||
'green3' => '00cd00',
|
||||
'green4' => '008b00',
|
||||
'greenyellow' => 'adff2f',
|
||||
'honeydew1' => 'f0fff0',
|
||||
'honeydew2' => 'e0eee0',
|
||||
'honeydew3' => 'c1cdc1',
|
||||
'honeydew4' => '838b83',
|
||||
'hotpink' => 'ff69b4',
|
||||
'hotpink1' => 'ff6eb4',
|
||||
'hotpink2' => 'ee6aa7',
|
||||
'hotpink3' => 'cd6090',
|
||||
'hotpink4' => '8b3a62',
|
||||
'indianred' => 'cd5c5c',
|
||||
'indianred1' => 'ff6a6a',
|
||||
'indianred2' => 'ee6363',
|
||||
'indianred3' => 'cd5555',
|
||||
'indianred4' => '8b3a3a',
|
||||
'ivory1' => 'fffff0',
|
||||
'ivory2' => 'eeeee0',
|
||||
'ivory3' => 'cdcdc1',
|
||||
'ivory4' => '8b8b83',
|
||||
'khaki' => 'f0e68c',
|
||||
'khaki1' => 'fff68f',
|
||||
'khaki2' => 'eee685',
|
||||
'khaki3' => 'cdc673',
|
||||
'khaki4' => '8b864e',
|
||||
'lavender' => 'e6e6fa',
|
||||
'lavenderblush1' => 'fff0f5',
|
||||
'lavenderblush2' => 'eee0e5',
|
||||
'lavenderblush3' => 'cdc1c5',
|
||||
'lavenderblush4' => '8b8386',
|
||||
'lawngreen' => '7cfc00',
|
||||
'lemonchiffon1' => 'fffacd',
|
||||
'lemonchiffon2' => 'eee9bf',
|
||||
'lemonchiffon3' => 'cdc9a5',
|
||||
'lemonchiffon4' => '8b8970',
|
||||
'light' => 'eedd82',
|
||||
'lightblue' => 'add8e6',
|
||||
'lightblue1' => 'bfefff',
|
||||
'lightblue2' => 'b2dfee',
|
||||
'lightblue3' => '9ac0cd',
|
||||
'lightblue4' => '68838b',
|
||||
'lightcoral' => 'f08080',
|
||||
'lightcyan1' => 'e0ffff',
|
||||
'lightcyan2' => 'd1eeee',
|
||||
'lightcyan3' => 'b4cdcd',
|
||||
'lightcyan4' => '7a8b8b',
|
||||
'lightgoldenrod1' => 'ffec8b',
|
||||
'lightgoldenrod2' => 'eedc82',
|
||||
'lightgoldenrod3' => 'cdbe70',
|
||||
'lightgoldenrod4' => '8b814c',
|
||||
'lightgoldenrodyellow' => 'fafad2',
|
||||
'lightgray' => 'd3d3d3',
|
||||
'lightpink' => 'ffb6c1',
|
||||
'lightpink1' => 'ffaeb9',
|
||||
'lightpink2' => 'eea2ad',
|
||||
'lightpink3' => 'cd8c95',
|
||||
'lightpink4' => '8b5f65',
|
||||
'lightsalmon1' => 'ffa07a',
|
||||
'lightsalmon2' => 'ee9572',
|
||||
'lightsalmon3' => 'cd8162',
|
||||
'lightsalmon4' => '8b5742',
|
||||
'lightseagreen' => '20b2aa',
|
||||
'lightskyblue' => '87cefa',
|
||||
'lightskyblue1' => 'b0e2ff',
|
||||
'lightskyblue2' => 'a4d3ee',
|
||||
'lightskyblue3' => '8db6cd',
|
||||
'lightskyblue4' => '607b8b',
|
||||
'lightslateblue' => '8470ff',
|
||||
'lightslategray' => '778899',
|
||||
'lightsteelblue' => 'b0c4de',
|
||||
'lightsteelblue1' => 'cae1ff',
|
||||
'lightsteelblue2' => 'bcd2ee',
|
||||
'lightsteelblue3' => 'a2b5cd',
|
||||
'lightsteelblue4' => '6e7b8b',
|
||||
'lightyellow1' => 'ffffe0',
|
||||
'lightyellow2' => 'eeeed1',
|
||||
'lightyellow3' => 'cdcdb4',
|
||||
'lightyellow4' => '8b8b7a',
|
||||
'lime' => '00ff00',
|
||||
'limegreen' => '32cd32',
|
||||
'linen' => 'faf0e6',
|
||||
'magenta' => 'ff00ff',
|
||||
'magenta2' => 'ee00ee',
|
||||
'magenta3' => 'cd00cd',
|
||||
'magenta4' => '8b008b',
|
||||
'maroon' => 'b03060',
|
||||
'maroon1' => 'ff34b3',
|
||||
'maroon2' => 'ee30a7',
|
||||
'maroon3' => 'cd2990',
|
||||
'maroon4' => '8b1c62',
|
||||
'medium' => '66cdaa',
|
||||
'mediumaquamarine' => '66cdaa',
|
||||
'mediumblue' => '0000cd',
|
||||
'mediumorchid' => 'ba55d3',
|
||||
'mediumorchid1' => 'e066ff',
|
||||
'mediumorchid2' => 'd15fee',
|
||||
'mediumorchid3' => 'b452cd',
|
||||
'mediumorchid4' => '7a378b',
|
||||
'mediumpurple' => '9370db',
|
||||
'mediumpurple1' => 'ab82ff',
|
||||
'mediumpurple2' => '9f79ee',
|
||||
'mediumpurple3' => '8968cd',
|
||||
'mediumpurple4' => '5d478b',
|
||||
'mediumseagreen' => '3cb371',
|
||||
'mediumslateblue' => '7b68ee',
|
||||
'mediumspringgreen' => '00fa9a',
|
||||
'mediumturquoise' => '48d1cc',
|
||||
'mediumvioletred' => 'c71585',
|
||||
'midnightblue' => '191970',
|
||||
'mintcream' => 'f5fffa',
|
||||
'mistyrose1' => 'ffe4e1',
|
||||
'mistyrose2' => 'eed5d2',
|
||||
'mistyrose3' => 'cdb7b5',
|
||||
'mistyrose4' => '8b7d7b',
|
||||
'moccasin' => 'ffe4b5',
|
||||
'navajowhite1' => 'ffdead',
|
||||
'navajowhite2' => 'eecfa1',
|
||||
'navajowhite3' => 'cdb38b',
|
||||
'navajowhite4' => '8b795e',
|
||||
'navy' => '000080',
|
||||
'navyblue' => '000080',
|
||||
'oldlace' => 'fdf5e6',
|
||||
'olive' => '808000',
|
||||
'olivedrab' => '6b8e23',
|
||||
'olivedrab1' => 'c0ff3e',
|
||||
'olivedrab2' => 'b3ee3a',
|
||||
'olivedrab4' => '698b22',
|
||||
'orange' => 'ffa500',
|
||||
'orange1' => 'ffa500',
|
||||
'orange2' => 'ee9a00',
|
||||
'orange3' => 'cd8500',
|
||||
'orange4' => '8b5a00',
|
||||
'orangered1' => 'ff4500',
|
||||
'orangered2' => 'ee4000',
|
||||
'orangered3' => 'cd3700',
|
||||
'orangered4' => '8b2500',
|
||||
'orchid' => 'da70d6',
|
||||
'orchid1' => 'ff83fa',
|
||||
'orchid2' => 'ee7ae9',
|
||||
'orchid3' => 'cd69c9',
|
||||
'orchid4' => '8b4789',
|
||||
'pale' => 'db7093',
|
||||
'palegoldenrod' => 'eee8aa',
|
||||
'palegreen' => '98fb98',
|
||||
'palegreen1' => '9aff9a',
|
||||
'palegreen2' => '90ee90',
|
||||
'palegreen3' => '7ccd7c',
|
||||
'palegreen4' => '548b54',
|
||||
'paleturquoise' => 'afeeee',
|
||||
'paleturquoise1' => 'bbffff',
|
||||
'paleturquoise2' => 'aeeeee',
|
||||
'paleturquoise3' => '96cdcd',
|
||||
'paleturquoise4' => '668b8b',
|
||||
'palevioletred' => 'db7093',
|
||||
'palevioletred1' => 'ff82ab',
|
||||
'palevioletred2' => 'ee799f',
|
||||
'palevioletred3' => 'cd6889',
|
||||
'palevioletred4' => '8b475d',
|
||||
'papayawhip' => 'ffefd5',
|
||||
'peachpuff1' => 'ffdab9',
|
||||
'peachpuff2' => 'eecbad',
|
||||
'peachpuff3' => 'cdaf95',
|
||||
'peachpuff4' => '8b7765',
|
||||
'pink' => 'ffc0cb',
|
||||
'pink1' => 'ffb5c5',
|
||||
'pink2' => 'eea9b8',
|
||||
'pink3' => 'cd919e',
|
||||
'pink4' => '8b636c',
|
||||
'plum' => 'dda0dd',
|
||||
'plum1' => 'ffbbff',
|
||||
'plum2' => 'eeaeee',
|
||||
'plum3' => 'cd96cd',
|
||||
'plum4' => '8b668b',
|
||||
'powderblue' => 'b0e0e6',
|
||||
'purple' => 'a020f0',
|
||||
'rebeccapurple' => '663399',
|
||||
'purple1' => '9b30ff',
|
||||
'purple2' => '912cee',
|
||||
'purple3' => '7d26cd',
|
||||
'purple4' => '551a8b',
|
||||
'red' => 'ff0000',
|
||||
'red1' => 'ff0000',
|
||||
'red2' => 'ee0000',
|
||||
'red3' => 'cd0000',
|
||||
'red4' => '8b0000',
|
||||
'rosybrown' => 'bc8f8f',
|
||||
'rosybrown1' => 'ffc1c1',
|
||||
'rosybrown2' => 'eeb4b4',
|
||||
'rosybrown3' => 'cd9b9b',
|
||||
'rosybrown4' => '8b6969',
|
||||
'royalblue' => '4169e1',
|
||||
'royalblue1' => '4876ff',
|
||||
'royalblue2' => '436eee',
|
||||
'royalblue3' => '3a5fcd',
|
||||
'royalblue4' => '27408b',
|
||||
'saddlebrown' => '8b4513',
|
||||
'salmon' => 'fa8072',
|
||||
'salmon1' => 'ff8c69',
|
||||
'salmon2' => 'ee8262',
|
||||
'salmon3' => 'cd7054',
|
||||
'salmon4' => '8b4c39',
|
||||
'sandybrown' => 'f4a460',
|
||||
'seagreen1' => '54ff9f',
|
||||
'seagreen2' => '4eee94',
|
||||
'seagreen3' => '43cd80',
|
||||
'seagreen4' => '2e8b57',
|
||||
'seashell1' => 'fff5ee',
|
||||
'seashell2' => 'eee5de',
|
||||
'seashell3' => 'cdc5bf',
|
||||
'seashell4' => '8b8682',
|
||||
'sienna' => 'a0522d',
|
||||
'sienna1' => 'ff8247',
|
||||
'sienna2' => 'ee7942',
|
||||
'sienna3' => 'cd6839',
|
||||
'sienna4' => '8b4726',
|
||||
'silver' => 'c0c0c0',
|
||||
'skyblue' => '87ceeb',
|
||||
'skyblue1' => '87ceff',
|
||||
'skyblue2' => '7ec0ee',
|
||||
'skyblue3' => '6ca6cd',
|
||||
'skyblue4' => '4a708b',
|
||||
'slateblue' => '6a5acd',
|
||||
'slateblue1' => '836fff',
|
||||
'slateblue2' => '7a67ee',
|
||||
'slateblue3' => '6959cd',
|
||||
'slateblue4' => '473c8b',
|
||||
'slategray' => '708090',
|
||||
'slategray1' => 'c6e2ff',
|
||||
'slategray2' => 'b9d3ee',
|
||||
'slategray3' => '9fb6cd',
|
||||
'slategray4' => '6c7b8b',
|
||||
'snow1' => 'fffafa',
|
||||
'snow2' => 'eee9e9',
|
||||
'snow3' => 'cdc9c9',
|
||||
'snow4' => '8b8989',
|
||||
'springgreen1' => '00ff7f',
|
||||
'springgreen2' => '00ee76',
|
||||
'springgreen3' => '00cd66',
|
||||
'springgreen4' => '008b45',
|
||||
'steelblue' => '4682b4',
|
||||
'steelblue1' => '63b8ff',
|
||||
'steelblue2' => '5cacee',
|
||||
'steelblue3' => '4f94cd',
|
||||
'steelblue4' => '36648b',
|
||||
'tan' => 'd2b48c',
|
||||
'tan1' => 'ffa54f',
|
||||
'tan2' => 'ee9a49',
|
||||
'tan3' => 'cd853f',
|
||||
'tan4' => '8b5a2b',
|
||||
'teal' => '008080',
|
||||
'thistle' => 'd8bfd8',
|
||||
'thistle1' => 'ffe1ff',
|
||||
'thistle2' => 'eed2ee',
|
||||
'thistle3' => 'cdb5cd',
|
||||
'thistle4' => '8b7b8b',
|
||||
'tomato1' => 'ff6347',
|
||||
'tomato2' => 'ee5c42',
|
||||
'tomato3' => 'cd4f39',
|
||||
'tomato4' => '8b3626',
|
||||
'turquoise' => '40e0d0',
|
||||
'turquoise1' => '00f5ff',
|
||||
'turquoise2' => '00e5ee',
|
||||
'turquoise3' => '00c5cd',
|
||||
'turquoise4' => '00868b',
|
||||
'violet' => 'ee82ee',
|
||||
'violetred' => 'd02090',
|
||||
'violetred1' => 'ff3e96',
|
||||
'violetred2' => 'ee3a8c',
|
||||
'violetred3' => 'cd3278',
|
||||
'violetred4' => '8b2252',
|
||||
'wheat' => 'f5deb3',
|
||||
'wheat1' => 'ffe7ba',
|
||||
'wheat2' => 'eed8ae',
|
||||
'wheat3' => 'cdba96',
|
||||
'wheat4' => '8b7e66',
|
||||
'white' => 'ffffff',
|
||||
'whitesmoke' => 'f5f5f5',
|
||||
'yellow' => 'ffff00',
|
||||
'yellow1' => 'ffff00',
|
||||
'yellow2' => 'eeee00',
|
||||
'yellow3' => 'cdcd00',
|
||||
'yellow4' => '8b8b00',
|
||||
'yellowgreen' => '9acd32',
|
||||
];
|
||||
|
||||
protected $face;
|
||||
|
||||
protected $size;
|
||||
|
||||
protected $color;
|
||||
|
||||
protected $bold = false;
|
||||
|
||||
protected $italic = false;
|
||||
|
||||
protected $underline = false;
|
||||
|
||||
protected $superscript = false;
|
||||
|
||||
protected $subscript = false;
|
||||
|
||||
protected $strikethrough = false;
|
||||
|
||||
protected $startTagCallbacks = [
|
||||
'font' => 'startFontTag',
|
||||
'b' => 'startBoldTag',
|
||||
'strong' => 'startBoldTag',
|
||||
'i' => 'startItalicTag',
|
||||
'em' => 'startItalicTag',
|
||||
'u' => 'startUnderlineTag',
|
||||
'ins' => 'startUnderlineTag',
|
||||
'del' => 'startStrikethruTag',
|
||||
'sup' => 'startSuperscriptTag',
|
||||
'sub' => 'startSubscriptTag',
|
||||
];
|
||||
|
||||
protected $endTagCallbacks = [
|
||||
'font' => 'endFontTag',
|
||||
'b' => 'endBoldTag',
|
||||
'strong' => 'endBoldTag',
|
||||
'i' => 'endItalicTag',
|
||||
'em' => 'endItalicTag',
|
||||
'u' => 'endUnderlineTag',
|
||||
'ins' => 'endUnderlineTag',
|
||||
'del' => 'endStrikethruTag',
|
||||
'sup' => 'endSuperscriptTag',
|
||||
'sub' => 'endSubscriptTag',
|
||||
'br' => 'breakTag',
|
||||
'p' => 'breakTag',
|
||||
'h1' => 'breakTag',
|
||||
'h2' => 'breakTag',
|
||||
'h3' => 'breakTag',
|
||||
'h4' => 'breakTag',
|
||||
'h5' => 'breakTag',
|
||||
'h6' => 'breakTag',
|
||||
];
|
||||
|
||||
protected $stack = [];
|
||||
|
||||
protected $stringData = '';
|
||||
|
||||
/**
|
||||
* @var RichText
|
||||
*/
|
||||
protected $richTextObject;
|
||||
|
||||
protected function initialise(): void
|
||||
{
|
||||
$this->face = $this->size = $this->color = null;
|
||||
$this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false;
|
||||
|
||||
$this->stack = [];
|
||||
|
||||
$this->stringData = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse HTML formatting and return the resulting RichText.
|
||||
*
|
||||
* @param string $html
|
||||
*
|
||||
* @return RichText
|
||||
*/
|
||||
public function toRichTextObject($html)
|
||||
{
|
||||
$this->initialise();
|
||||
|
||||
// Create a new DOM object
|
||||
$dom = new DOMDocument();
|
||||
// Load the HTML file into the DOM object
|
||||
// Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup
|
||||
$prefix = '<?xml encoding="UTF-8">';
|
||||
@$dom->loadHTML($prefix . $html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
// Discard excess white space
|
||||
$dom->preserveWhiteSpace = false;
|
||||
|
||||
$this->richTextObject = new RichText();
|
||||
$this->parseElements($dom);
|
||||
|
||||
// Clean any further spurious whitespace
|
||||
$this->cleanWhitespace();
|
||||
|
||||
return $this->richTextObject;
|
||||
}
|
||||
|
||||
protected function cleanWhitespace(): void
|
||||
{
|
||||
foreach ($this->richTextObject->getRichTextElements() as $key => $element) {
|
||||
$text = $element->getText();
|
||||
// Trim any leading spaces on the first run
|
||||
if ($key == 0) {
|
||||
$text = ltrim($text);
|
||||
}
|
||||
// Trim any spaces immediately after a line break
|
||||
$text = preg_replace('/\n */mu', "\n", $text);
|
||||
$element->setText($text);
|
||||
}
|
||||
}
|
||||
|
||||
protected function buildTextRun(): void
|
||||
{
|
||||
$text = $this->stringData;
|
||||
if (trim($text) === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$richtextRun = $this->richTextObject->createTextRun($this->stringData);
|
||||
if ($this->face) {
|
||||
$richtextRun->getFont()->setName($this->face);
|
||||
}
|
||||
if ($this->size) {
|
||||
$richtextRun->getFont()->setSize($this->size);
|
||||
}
|
||||
if ($this->color) {
|
||||
$richtextRun->getFont()->setColor(new Color('ff' . $this->color));
|
||||
}
|
||||
if ($this->bold) {
|
||||
$richtextRun->getFont()->setBold(true);
|
||||
}
|
||||
if ($this->italic) {
|
||||
$richtextRun->getFont()->setItalic(true);
|
||||
}
|
||||
if ($this->underline) {
|
||||
$richtextRun->getFont()->setUnderline(Font::UNDERLINE_SINGLE);
|
||||
}
|
||||
if ($this->superscript) {
|
||||
$richtextRun->getFont()->setSuperscript(true);
|
||||
}
|
||||
if ($this->subscript) {
|
||||
$richtextRun->getFont()->setSubscript(true);
|
||||
}
|
||||
if ($this->strikethrough) {
|
||||
$richtextRun->getFont()->setStrikethrough(true);
|
||||
}
|
||||
$this->stringData = '';
|
||||
}
|
||||
|
||||
protected function rgbToColour($rgb)
|
||||
{
|
||||
preg_match_all('/\d+/', $rgb, $values);
|
||||
foreach ($values[0] as &$value) {
|
||||
$value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
return implode('', $values[0]);
|
||||
}
|
||||
|
||||
public static function colourNameLookup(string $rgb): string
|
||||
{
|
||||
return self::$colourMap[$rgb] ?? '';
|
||||
}
|
||||
|
||||
protected function startFontTag($tag): void
|
||||
{
|
||||
foreach ($tag->attributes as $attribute) {
|
||||
$attributeName = strtolower($attribute->name);
|
||||
$attributeValue = $attribute->value;
|
||||
|
||||
if ($attributeName == 'color') {
|
||||
if (preg_match('/rgb\s*\(/', $attributeValue)) {
|
||||
$this->$attributeName = $this->rgbToColour($attributeValue);
|
||||
} elseif (strpos(trim($attributeValue), '#') === 0) {
|
||||
$this->$attributeName = ltrim($attributeValue, '#');
|
||||
} else {
|
||||
$this->$attributeName = $this->colourNameLookup($attributeValue);
|
||||
}
|
||||
} else {
|
||||
$this->$attributeName = $attributeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function endFontTag(): void
|
||||
{
|
||||
$this->face = $this->size = $this->color = null;
|
||||
}
|
||||
|
||||
protected function startBoldTag(): void
|
||||
{
|
||||
$this->bold = true;
|
||||
}
|
||||
|
||||
protected function endBoldTag(): void
|
||||
{
|
||||
$this->bold = false;
|
||||
}
|
||||
|
||||
protected function startItalicTag(): void
|
||||
{
|
||||
$this->italic = true;
|
||||
}
|
||||
|
||||
protected function endItalicTag(): void
|
||||
{
|
||||
$this->italic = false;
|
||||
}
|
||||
|
||||
protected function startUnderlineTag(): void
|
||||
{
|
||||
$this->underline = true;
|
||||
}
|
||||
|
||||
protected function endUnderlineTag(): void
|
||||
{
|
||||
$this->underline = false;
|
||||
}
|
||||
|
||||
protected function startSubscriptTag(): void
|
||||
{
|
||||
$this->subscript = true;
|
||||
}
|
||||
|
||||
protected function endSubscriptTag(): void
|
||||
{
|
||||
$this->subscript = false;
|
||||
}
|
||||
|
||||
protected function startSuperscriptTag(): void
|
||||
{
|
||||
$this->superscript = true;
|
||||
}
|
||||
|
||||
protected function endSuperscriptTag(): void
|
||||
{
|
||||
$this->superscript = false;
|
||||
}
|
||||
|
||||
protected function startStrikethruTag(): void
|
||||
{
|
||||
$this->strikethrough = true;
|
||||
}
|
||||
|
||||
protected function endStrikethruTag(): void
|
||||
{
|
||||
$this->strikethrough = false;
|
||||
}
|
||||
|
||||
protected function breakTag(): void
|
||||
{
|
||||
$this->stringData .= "\n";
|
||||
}
|
||||
|
||||
protected function parseTextNode(DOMText $textNode): void
|
||||
{
|
||||
$domText = preg_replace(
|
||||
'/\s+/u',
|
||||
' ',
|
||||
str_replace(["\r", "\n"], ' ', $textNode->nodeValue)
|
||||
);
|
||||
$this->stringData .= $domText;
|
||||
$this->buildTextRun();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $callbackTag
|
||||
*/
|
||||
protected function handleCallback(DOMElement $element, $callbackTag, array $callbacks): void
|
||||
{
|
||||
if (isset($callbacks[$callbackTag])) {
|
||||
$elementHandler = $callbacks[$callbackTag];
|
||||
if (method_exists($this, $elementHandler)) {
|
||||
call_user_func([$this, $elementHandler], $element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function parseElementNode(DOMElement $element): void
|
||||
{
|
||||
$callbackTag = strtolower($element->nodeName);
|
||||
$this->stack[] = $callbackTag;
|
||||
|
||||
$this->handleCallback($element, $callbackTag, $this->startTagCallbacks);
|
||||
|
||||
$this->parseElements($element);
|
||||
array_pop($this->stack);
|
||||
|
||||
$this->handleCallback($element, $callbackTag, $this->endTagCallbacks);
|
||||
}
|
||||
|
||||
protected function parseElements(DOMNode $element): void
|
||||
{
|
||||
foreach ($element->childNodes as $child) {
|
||||
if ($child instanceof DOMText) {
|
||||
$this->parseTextNode($child);
|
||||
} elseif ($child instanceof DOMElement) {
|
||||
$this->parseElementNode($child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,229 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Helper;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\IWriter;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Pdf;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use RecursiveRegexIterator;
|
||||
use ReflectionClass;
|
||||
use RegexIterator;
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Helper class to be used in sample code.
|
||||
*/
|
||||
class Sample
|
||||
{
|
||||
/**
|
||||
* Returns whether we run on CLI or browser.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isCli()
|
||||
{
|
||||
return PHP_SAPI === 'cli';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the filename currently being executed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getScriptFilename()
|
||||
{
|
||||
return basename($_SERVER['SCRIPT_FILENAME'], '.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether we are executing the index page.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isIndex()
|
||||
{
|
||||
return $this->getScriptFilename() === 'index';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the page title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPageTitle()
|
||||
{
|
||||
return $this->isIndex() ? 'PHPSpreadsheet' : $this->getScriptFilename();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the page heading.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPageHeading()
|
||||
{
|
||||
return $this->isIndex() ? '' : '<h1>' . str_replace('_', ' ', $this->getScriptFilename()) . '</h1>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of all known samples.
|
||||
*
|
||||
* @return string[] [$name => $path]
|
||||
*/
|
||||
public function getSamples()
|
||||
{
|
||||
// Populate samples
|
||||
$baseDir = realpath(__DIR__ . '/../../../samples');
|
||||
$directory = new RecursiveDirectoryIterator($baseDir);
|
||||
$iterator = new RecursiveIteratorIterator($directory);
|
||||
$regex = new RegexIterator($iterator, '/^.+\.php$/', RecursiveRegexIterator::GET_MATCH);
|
||||
|
||||
$files = [];
|
||||
foreach ($regex as $file) {
|
||||
$file = str_replace(str_replace('\\', '/', $baseDir) . '/', '', str_replace('\\', '/', $file[0]));
|
||||
$info = pathinfo($file);
|
||||
$category = str_replace('_', ' ', $info['dirname']);
|
||||
$name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));
|
||||
if (!in_array($category, ['.', 'boostrap', 'templates'])) {
|
||||
if (!isset($files[$category])) {
|
||||
$files[$category] = [];
|
||||
}
|
||||
$files[$category][$name] = $file;
|
||||
}
|
||||
}
|
||||
|
||||
// Sort everything
|
||||
ksort($files);
|
||||
foreach ($files as &$f) {
|
||||
asort($f);
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write documents.
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string[] $writers
|
||||
*/
|
||||
public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xlsx', 'Xls']): void
|
||||
{
|
||||
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
||||
$spreadsheet->setActiveSheetIndex(0);
|
||||
|
||||
// Write documents
|
||||
foreach ($writers as $writerType) {
|
||||
$path = $this->getFilename($filename, mb_strtolower($writerType));
|
||||
$writer = IOFactory::createWriter($spreadsheet, $writerType);
|
||||
if ($writer instanceof Pdf) {
|
||||
// PDF writer needs temporary directory
|
||||
$tempDir = $this->getTemporaryFolder();
|
||||
$writer->setTempDir($tempDir);
|
||||
}
|
||||
$callStartTime = microtime(true);
|
||||
$writer->save($path);
|
||||
$this->logWrite($writer, $path, $callStartTime);
|
||||
}
|
||||
|
||||
$this->logEndingNotes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the temporary directory and make sure it exists.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTemporaryFolder()
|
||||
{
|
||||
$tempFolder = sys_get_temp_dir() . '/phpspreadsheet';
|
||||
if (!is_dir($tempFolder)) {
|
||||
if (!mkdir($tempFolder) && !is_dir($tempFolder)) {
|
||||
throw new RuntimeException(sprintf('Directory "%s" was not created', $tempFolder));
|
||||
}
|
||||
}
|
||||
|
||||
return $tempFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the filename that should be used for sample output.
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string $extension
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilename($filename, $extension = 'xlsx')
|
||||
{
|
||||
$originalExtension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
|
||||
return $this->getTemporaryFolder() . '/' . str_replace('.' . $originalExtension, '.' . $extension, basename($filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a random temporary file name.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTemporaryFilename($extension = 'xlsx')
|
||||
{
|
||||
$temporaryFilename = tempnam($this->getTemporaryFolder(), 'phpspreadsheet-');
|
||||
unlink($temporaryFilename);
|
||||
|
||||
return $temporaryFilename . '.' . $extension;
|
||||
}
|
||||
|
||||
public function log($message): void
|
||||
{
|
||||
$eol = $this->isCli() ? PHP_EOL : '<br />';
|
||||
echo date('H:i:s ') . $message . $eol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log ending notes.
|
||||
*/
|
||||
public function logEndingNotes(): void
|
||||
{
|
||||
// Do not show execution time for index
|
||||
$this->log('Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . 'MB');
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a line about the write operation.
|
||||
*
|
||||
* @param string $path
|
||||
* @param float $callStartTime
|
||||
*/
|
||||
public function logWrite(IWriter $writer, $path, $callStartTime): void
|
||||
{
|
||||
$callEndTime = microtime(true);
|
||||
$callTime = $callEndTime - $callStartTime;
|
||||
$reflection = new ReflectionClass($writer);
|
||||
$format = $reflection->getShortName();
|
||||
$message = "Write {$format} format to <code>{$path}</code> in " . sprintf('%.4f', $callTime) . ' seconds';
|
||||
|
||||
$this->log($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a line about the read operation.
|
||||
*
|
||||
* @param string $format
|
||||
* @param string $path
|
||||
* @param float $callStartTime
|
||||
*/
|
||||
public function logRead($format, $path, $callStartTime): void
|
||||
{
|
||||
$callEndTime = microtime(true);
|
||||
$callTime = $callEndTime - $callStartTime;
|
||||
$message = "Read {$format} format from <code>{$path}</code> in " . sprintf('%.4f', $callTime) . ' seconds';
|
||||
|
||||
$this->log($message);
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
interface IComparable
|
||||
{
|
||||
/**
|
||||
* Get hash code.
|
||||
*
|
||||
* @return string Hash code
|
||||
*/
|
||||
public function getHashCode();
|
||||
}
|
@ -1,217 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Shared\File;
|
||||
|
||||
/**
|
||||
* Factory to create readers and writers easily.
|
||||
*
|
||||
* It is not required to use this class, but it should make it easier to read and write files.
|
||||
* Especially for reading files with an unknown format.
|
||||
*/
|
||||
abstract class IOFactory
|
||||
{
|
||||
private static $readers = [
|
||||
'Xlsx' => Reader\Xlsx::class,
|
||||
'Xls' => Reader\Xls::class,
|
||||
'Xml' => Reader\Xml::class,
|
||||
'Ods' => Reader\Ods::class,
|
||||
'Slk' => Reader\Slk::class,
|
||||
'Gnumeric' => Reader\Gnumeric::class,
|
||||
'Html' => Reader\Html::class,
|
||||
'Csv' => Reader\Csv::class,
|
||||
];
|
||||
|
||||
private static $writers = [
|
||||
'Xls' => Writer\Xls::class,
|
||||
'Xlsx' => Writer\Xlsx::class,
|
||||
'Ods' => Writer\Ods::class,
|
||||
'Csv' => Writer\Csv::class,
|
||||
'Html' => Writer\Html::class,
|
||||
'Tcpdf' => Writer\Pdf\Tcpdf::class,
|
||||
'Dompdf' => Writer\Pdf\Dompdf::class,
|
||||
'Mpdf' => Writer\Pdf\Mpdf::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Create Writer\IWriter.
|
||||
*
|
||||
* @param string $writerType Example: Xlsx
|
||||
*
|
||||
* @return Writer\IWriter
|
||||
*/
|
||||
public static function createWriter(Spreadsheet $spreadsheet, $writerType)
|
||||
{
|
||||
if (!isset(self::$writers[$writerType])) {
|
||||
throw new Writer\Exception("No writer found for type $writerType");
|
||||
}
|
||||
|
||||
// Instantiate writer
|
||||
$className = self::$writers[$writerType];
|
||||
|
||||
return new $className($spreadsheet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Reader\IReader.
|
||||
*
|
||||
* @param string $readerType Example: Xlsx
|
||||
*
|
||||
* @return Reader\IReader
|
||||
*/
|
||||
public static function createReader($readerType)
|
||||
{
|
||||
if (!isset(self::$readers[$readerType])) {
|
||||
throw new Reader\Exception("No reader found for type $readerType");
|
||||
}
|
||||
|
||||
// Instantiate reader
|
||||
$className = self::$readers[$readerType];
|
||||
|
||||
return new $className();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads Spreadsheet from file using automatic Reader\IReader resolution.
|
||||
*
|
||||
* @param string $pFilename The name of the spreadsheet file
|
||||
*
|
||||
* @return Spreadsheet
|
||||
*/
|
||||
public static function load($pFilename)
|
||||
{
|
||||
$reader = self::createReaderForFile($pFilename);
|
||||
|
||||
return $reader->load($pFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Identify file type using automatic Reader\IReader resolution.
|
||||
*
|
||||
* @param string $pFilename The name of the spreadsheet file to identify
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function identify($pFilename)
|
||||
{
|
||||
$reader = self::createReaderForFile($pFilename);
|
||||
$className = get_class($reader);
|
||||
$classType = explode('\\', $className);
|
||||
unset($reader);
|
||||
|
||||
return array_pop($classType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Reader\IReader for file using automatic Reader\IReader resolution.
|
||||
*
|
||||
* @param string $filename The name of the spreadsheet file
|
||||
*
|
||||
* @return Reader\IReader
|
||||
*/
|
||||
public static function createReaderForFile($filename)
|
||||
{
|
||||
File::assertFile($filename);
|
||||
|
||||
// First, lucky guess by inspecting file extension
|
||||
$guessedReader = self::getReaderTypeFromExtension($filename);
|
||||
if ($guessedReader !== null) {
|
||||
$reader = self::createReader($guessedReader);
|
||||
|
||||
// Let's see if we are lucky
|
||||
if (isset($reader) && $reader->canRead($filename)) {
|
||||
return $reader;
|
||||
}
|
||||
}
|
||||
|
||||
// If we reach here then "lucky guess" didn't give any result
|
||||
// Try walking through all the options in self::$autoResolveClasses
|
||||
foreach (self::$readers as $type => $class) {
|
||||
// Ignore our original guess, we know that won't work
|
||||
if ($type !== $guessedReader) {
|
||||
$reader = self::createReader($type);
|
||||
if ($reader->canRead($filename)) {
|
||||
return $reader;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new Reader\Exception('Unable to identify a reader for this file');
|
||||
}
|
||||
|
||||
/**
|
||||
* Guess a reader type from the file extension, if any.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
private static function getReaderTypeFromExtension($filename)
|
||||
{
|
||||
$pathinfo = pathinfo($filename);
|
||||
if (!isset($pathinfo['extension'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (strtolower($pathinfo['extension'])) {
|
||||
case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet
|
||||
case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded)
|
||||
case 'xltx': // Excel (OfficeOpenXML) Template
|
||||
case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded)
|
||||
return 'Xlsx';
|
||||
case 'xls': // Excel (BIFF) Spreadsheet
|
||||
case 'xlt': // Excel (BIFF) Template
|
||||
return 'Xls';
|
||||
case 'ods': // Open/Libre Offic Calc
|
||||
case 'ots': // Open/Libre Offic Calc Template
|
||||
return 'Ods';
|
||||
case 'slk':
|
||||
return 'Slk';
|
||||
case 'xml': // Excel 2003 SpreadSheetML
|
||||
return 'Xml';
|
||||
case 'gnumeric':
|
||||
return 'Gnumeric';
|
||||
case 'htm':
|
||||
case 'html':
|
||||
return 'Html';
|
||||
case 'csv':
|
||||
// Do nothing
|
||||
// We must not try to use CSV reader since it loads
|
||||
// all files including Excel files etc.
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a writer with its type and class name.
|
||||
*
|
||||
* @param string $writerType
|
||||
* @param string $writerClass
|
||||
*/
|
||||
public static function registerWriter($writerType, $writerClass): void
|
||||
{
|
||||
if (!is_a($writerClass, Writer\IWriter::class, true)) {
|
||||
throw new Writer\Exception('Registered writers must implement ' . Writer\IWriter::class);
|
||||
}
|
||||
|
||||
self::$writers[$writerType] = $writerClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a reader with its type and class name.
|
||||
*
|
||||
* @param string $readerType
|
||||
* @param string $readerClass
|
||||
*/
|
||||
public static function registerReader($readerType, $readerClass): void
|
||||
{
|
||||
if (!is_a($readerClass, Reader\IReader::class, true)) {
|
||||
throw new Reader\Exception('Registered readers must implement ' . Reader\IReader::class);
|
||||
}
|
||||
|
||||
self::$readers[$readerType] = $readerClass;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class NamedFormula extends DefinedName
|
||||
{
|
||||
/**
|
||||
* Create a new Named Formula.
|
||||
*/
|
||||
public function __construct(
|
||||
string $name,
|
||||
?Worksheet $worksheet = null,
|
||||
?string $formula = null,
|
||||
bool $localOnly = false,
|
||||
?Worksheet $scope = null
|
||||
) {
|
||||
// Validate data
|
||||
if (empty($formula)) {
|
||||
throw new Exception('Tou must specify a Formula value for a Named Formula');
|
||||
}
|
||||
parent::__construct($name, $worksheet, $formula, $localOnly, $scope);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formula value.
|
||||
*/
|
||||
public function getFormula(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the formula value.
|
||||
*/
|
||||
public function setFormula(string $formula): self
|
||||
{
|
||||
if (!empty($formula)) {
|
||||
$this->value = $formula;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
class NamedRange extends DefinedName
|
||||
{
|
||||
/**
|
||||
* Create a new Named Range.
|
||||
*/
|
||||
public function __construct(
|
||||
string $name,
|
||||
?Worksheet $worksheet = null,
|
||||
string $range = 'A1',
|
||||
bool $localOnly = false,
|
||||
?Worksheet $scope = null
|
||||
) {
|
||||
if ($worksheet === null && $scope === null) {
|
||||
throw new Exception('You must specify a worksheet or a scope for a Named Range');
|
||||
}
|
||||
parent::__construct($name, $worksheet, $range, $localOnly, $scope);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the range value.
|
||||
*/
|
||||
public function getRange(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the range value.
|
||||
*/
|
||||
public function setRange(string $range): self
|
||||
{
|
||||
if (!empty($range)) {
|
||||
$this->value = $range;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCellsInRange(): array
|
||||
{
|
||||
$range = $this->value;
|
||||
if (substr($range, 0, 1) === '=') {
|
||||
$range = substr($range, 1);
|
||||
}
|
||||
|
||||
return Coordinate::extractAllCellReferencesInRange($range);
|
||||
}
|
||||
}
|
@ -1,161 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Reader;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Exception as ReaderException;
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\File;
|
||||
|
||||
abstract class BaseReader implements IReader
|
||||
{
|
||||
/**
|
||||
* Read data only?
|
||||
* Identifies whether the Reader should only read data values for cells, and ignore any formatting information;
|
||||
* or whether it should read both data and formatting.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $readDataOnly = false;
|
||||
|
||||
/**
|
||||
* Read empty cells?
|
||||
* Identifies whether the Reader should read data values for cells all cells, or should ignore cells containing
|
||||
* null value or empty string.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $readEmptyCells = true;
|
||||
|
||||
/**
|
||||
* Read charts that are defined in the workbook?
|
||||
* Identifies whether the Reader should read the definitions for any charts that exist in the workbook;.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $includeCharts = false;
|
||||
|
||||
/**
|
||||
* Restrict which sheets should be loaded?
|
||||
* This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.
|
||||
*
|
||||
* @var array of string
|
||||
*/
|
||||
protected $loadSheetsOnly;
|
||||
|
||||
/**
|
||||
* IReadFilter instance.
|
||||
*
|
||||
* @var IReadFilter
|
||||
*/
|
||||
protected $readFilter;
|
||||
|
||||
protected $fileHandle;
|
||||
|
||||
/**
|
||||
* @var XmlScanner
|
||||
*/
|
||||
protected $securityScanner;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->readFilter = new DefaultReadFilter();
|
||||
}
|
||||
|
||||
public function getReadDataOnly()
|
||||
{
|
||||
return $this->readDataOnly;
|
||||
}
|
||||
|
||||
public function setReadDataOnly($pValue)
|
||||
{
|
||||
$this->readDataOnly = (bool) $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReadEmptyCells()
|
||||
{
|
||||
return $this->readEmptyCells;
|
||||
}
|
||||
|
||||
public function setReadEmptyCells($pValue)
|
||||
{
|
||||
$this->readEmptyCells = (bool) $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIncludeCharts()
|
||||
{
|
||||
return $this->includeCharts;
|
||||
}
|
||||
|
||||
public function setIncludeCharts($pValue)
|
||||
{
|
||||
$this->includeCharts = (bool) $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLoadSheetsOnly()
|
||||
{
|
||||
return $this->loadSheetsOnly;
|
||||
}
|
||||
|
||||
public function setLoadSheetsOnly($value)
|
||||
{
|
||||
if ($value === null) {
|
||||
return $this->setLoadAllSheets();
|
||||
}
|
||||
|
||||
$this->loadSheetsOnly = is_array($value) ? $value : [$value];
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setLoadAllSheets()
|
||||
{
|
||||
$this->loadSheetsOnly = null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getReadFilter()
|
||||
{
|
||||
return $this->readFilter;
|
||||
}
|
||||
|
||||
public function setReadFilter(IReadFilter $pValue)
|
||||
{
|
||||
$this->readFilter = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSecurityScanner()
|
||||
{
|
||||
return $this->securityScanner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open file for reading.
|
||||
*
|
||||
* @param string $pFilename
|
||||
*/
|
||||
protected function openFile($pFilename): void
|
||||
{
|
||||
if ($pFilename) {
|
||||
File::assertFile($pFilename);
|
||||
|
||||
// Open file
|
||||
$fileHandle = fopen($pFilename, 'rb');
|
||||
} else {
|
||||
$fileHandle = false;
|
||||
}
|
||||
if ($fileHandle !== false) {
|
||||
$this->fileHandle = $fileHandle;
|
||||
} else {
|
||||
throw new ReaderException('Could not open file ' . $pFilename . ' for reading.');
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue