Fix dos files

This commit is contained in:
Laurent Destailleur
2014-09-07 12:28:58 +02:00
parent 342e26f679
commit 97c9d6bafc
24 changed files with 18658 additions and 18658 deletions

View File

@@ -1,280 +1,280 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_APC * PHPExcel_CachedObjectStorage_APC
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Prefix used to uniquely identify cache data for this worksheet * Prefix used to uniquely identify cache data for this worksheet
* *
* @access private * @access private
* @var string * @var string
*/ */
private $_cachePrefix = null; private $_cachePrefix = null;
/** /**
* Cache timeout * Cache timeout
* *
* @access private * @access private
* @var integer * @var integer
*/ */
private $_cacheTime = 600; private $_cacheTime = 600;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @access private * @access private
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) { if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$this->_currentObjectID.' in APC'); throw new Exception('Failed to store cell '.$this->_currentObjectID.' in APC');
} }
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @access public * @access public
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_cellCache[$pCoord] = true; $this->_cellCache[$pCoord] = true;
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
* *
* @access public * @access public
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return void * @return void
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) { public function isDataSet($pCoord) {
// Check if the requested entry is the current object, or exists in the cache // Check if the requested entry is the current object, or exists in the cache
if (parent::isDataSet($pCoord)) { if (parent::isDataSet($pCoord)) {
if ($this->_currentObjectID == $pCoord) { if ($this->_currentObjectID == $pCoord) {
return true; return true;
} }
// Check if the requested entry still exists in apc // Check if the requested entry still exists in apc
$success = apc_fetch($this->_cachePrefix.$pCoord.'.cache'); $success = apc_fetch($this->_cachePrefix.$pCoord.'.cache');
if ($success === false) { if ($success === false) {
// Entry no longer exists in APC, so clear it from the cache array // Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new Exception('Cell entry '.$pCoord.' no longer exists in APC'); throw new Exception('Cell entry '.$pCoord.' no longer exists in APC');
} }
return true; return true;
} }
return false; return false;
} // function isDataSet() } // function isDataSet()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @access public * @access public
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (parent::isDataSet($pCoord)) { if (parent::isDataSet($pCoord)) {
$obj = apc_fetch($this->_cachePrefix.$pCoord.'.cache'); $obj = apc_fetch($this->_cachePrefix.$pCoord.'.cache');
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array // Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new Exception('Cell entry '.$pCoord.' no longer exists in APC'); throw new Exception('Cell entry '.$pCoord.' no longer exists in APC');
} }
} else { } else {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize($obj); $this->_currentObject = unserialize($obj);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @access public * @access public
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws Exception * @throws Exception
*/ */
public function deleteCacheData($pCoord) { public function deleteCacheData($pCoord) {
// Delete the entry from APC // Delete the entry from APC
apc_delete($this->_cachePrefix.$pCoord.'.cache'); apc_delete($this->_cachePrefix.$pCoord.'.cache');
// Delete the entry from our cell address array // Delete the entry from our cell address array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
} // function deleteCacheData() } // function deleteCacheData()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @access public * @access public
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$newCachePrefix = substr(md5($baseUnique),0,8).'.'; $newCachePrefix = substr(md5($baseUnique),0,8).'.';
$cacheList = $this->getCellList(); $cacheList = $this->getCellList();
foreach($cacheList as $cellID) { foreach($cacheList as $cellID) {
if ($cellID != $this->_currentObjectID) { if ($cellID != $this->_currentObjectID) {
$obj = apc_fetch($this->_cachePrefix.$cellID.'.cache'); $obj = apc_fetch($this->_cachePrefix.$cellID.'.cache');
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array // Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($cellID); parent::deleteCacheData($cellID);
throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); throw new Exception('Cell entry '.$cellID.' no longer exists in APC');
} }
if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) { if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$cellID.' in APC'); throw new Exception('Failed to store cell '.$cellID.' in APC');
} }
} }
} }
$this->_cachePrefix = $newCachePrefix; $this->_cachePrefix = $newCachePrefix;
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if ($this->_currentObject !== NULL) { if ($this->_currentObject !== NULL) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
// Flush the APC cache // Flush the APC cache
$this->__destruct(); $this->__destruct();
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(PHPExcel_Worksheet $parent, $arguments) { public function __construct(PHPExcel_Worksheet $parent, $arguments) {
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
if ($this->_cachePrefix === NULL) { if ($this->_cachePrefix === NULL) {
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; $this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
$this->_cacheTime = $cacheTime; $this->_cacheTime = $cacheTime;
parent::__construct($parent); parent::__construct($parent);
} }
} // function __construct() } // function __construct()
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
$cacheList = $this->getCellList(); $cacheList = $this->getCellList();
foreach($cacheList as $cellID) { foreach($cacheList as $cellID) {
apc_delete($this->_cachePrefix.$cellID.'.cache'); apc_delete($this->_cachePrefix.$cellID.'.cache');
} }
} // function __destruct() } // function __destruct()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!function_exists('apc_store')) { if (!function_exists('apc_store')) {
return false; return false;
} }
if (apc_sma_info() === false) { if (apc_sma_info() === false) {
return false; return false;
} }
return true; return true;
} }
} }

View File

@@ -1,252 +1,252 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_CacheBase * PHPExcel_CachedObjectStorage_CacheBase
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
abstract class PHPExcel_CachedObjectStorage_CacheBase { abstract class PHPExcel_CachedObjectStorage_CacheBase {
/** /**
* Parent worksheet * Parent worksheet
* *
* @var PHPExcel_Worksheet * @var PHPExcel_Worksheet
*/ */
protected $_parent; protected $_parent;
/** /**
* The currently active Cell * The currently active Cell
* *
* @var PHPExcel_Cell * @var PHPExcel_Cell
*/ */
protected $_currentObject = null; protected $_currentObject = null;
/** /**
* Coordinate address of the currently active Cell * Coordinate address of the currently active Cell
* *
* @var string * @var string
*/ */
protected $_currentObjectID = null; protected $_currentObjectID = null;
/** /**
* Flag indicating whether the currently active Cell requires saving * Flag indicating whether the currently active Cell requires saving
* *
* @var boolean * @var boolean
*/ */
protected $_currentCellIsDirty = true; protected $_currentCellIsDirty = true;
/** /**
* An array of cells or cell pointers for the worksheet cells held in this cache, * An array of cells or cell pointers for the worksheet cells held in this cache,
* and indexed by their coordinate address within the worksheet * and indexed by their coordinate address within the worksheet
* *
* @var array of mixed * @var array of mixed
*/ */
protected $_cellCache = array(); protected $_cellCache = array();
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
*/ */
public function __construct(PHPExcel_Worksheet $parent) { public function __construct(PHPExcel_Worksheet $parent) {
// Set our parent worksheet. // Set our parent worksheet.
// This is maintained within the cache controller to facilitate re-attaching it to PHPExcel_Cell objects when // This is maintained within the cache controller to facilitate re-attaching it to PHPExcel_Cell objects when
// they are woken from a serialized state // they are woken from a serialized state
$this->_parent = $parent; $this->_parent = $parent;
} // function __construct() } // function __construct()
/** /**
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) { public function isDataSet($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return true; return true;
} }
// Check if the requested entry exists in the cache // Check if the requested entry exists in the cache
return isset($this->_cellCache[$pCoord]); return isset($this->_cellCache[$pCoord]);
} // function isDataSet() } // function isDataSet()
/** /**
* Add or Update a cell in cache * Add or Update a cell in cache
* *
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function updateCacheData(PHPExcel_Cell $cell) { public function updateCacheData(PHPExcel_Cell $cell) {
return $this->addCacheData($cell->getCoordinate(),$cell); return $this->addCacheData($cell->getCoordinate(),$cell);
} // function updateCacheData() } // function updateCacheData()
/** /**
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws Exception * @throws Exception
*/ */
public function deleteCacheData($pCoord) { public function deleteCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} }
if (is_object($this->_cellCache[$pCoord])) { if (is_object($this->_cellCache[$pCoord])) {
$this->_cellCache[$pCoord]->detach(); $this->_cellCache[$pCoord]->detach();
unset($this->_cellCache[$pCoord]); unset($this->_cellCache[$pCoord]);
} }
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} // function deleteCacheData() } // function deleteCacheData()
/** /**
* Get a list of all cell addresses currently held in cache * Get a list of all cell addresses currently held in cache
* *
* @return array of string * @return array of string
*/ */
public function getCellList() { public function getCellList() {
return array_keys($this->_cellCache); return array_keys($this->_cellCache);
} // function getCellList() } // function getCellList()
/** /**
* Sort the list of all cell addresses currently held in cache by row and column * Sort the list of all cell addresses currently held in cache by row and column
* *
* @return void * @return void
*/ */
public function getSortedCellList() { public function getSortedCellList() {
$sortKeys = array(); $sortKeys = array();
foreach ($this->getCellList() as $coord) { foreach ($this->getCellList() as $coord) {
list($column,$row) = sscanf($coord,'%[A-Z]%d'); list($column,$row) = sscanf($coord,'%[A-Z]%d');
$sortKeys[sprintf('%09d%3s',$row,$column)] = $coord; $sortKeys[sprintf('%09d%3s',$row,$column)] = $coord;
} }
ksort($sortKeys); ksort($sortKeys);
return array_values($sortKeys); return array_values($sortKeys);
} // function sortCellList() } // function sortCellList()
/** /**
* Get highest worksheet column and highest row that have cell records * Get highest worksheet column and highest row that have cell records
* *
* @return array Highest column name and highest row number * @return array Highest column name and highest row number
*/ */
public function getHighestRowAndColumn() public function getHighestRowAndColumn()
{ {
// Lookup highest column and highest row // Lookup highest column and highest row
$col = array('A' => '1A'); $col = array('A' => '1A');
$row = array(1); $row = array(1);
foreach ($this->getCellList() as $coord) { foreach ($this->getCellList() as $coord) {
list($c,$r) = sscanf($coord,'%[A-Z]%d'); list($c,$r) = sscanf($coord,'%[A-Z]%d');
$row[$r] = $r; $row[$r] = $r;
$col[$c] = strlen($c).$c; $col[$c] = strlen($c).$c;
} }
if (!empty($row)) { if (!empty($row)) {
// Determine highest column and row // Determine highest column and row
$highestRow = max($row); $highestRow = max($row);
$highestColumn = substr(max($col),1); $highestColumn = substr(max($col),1);
} }
return array( 'row' => $highestRow, return array( 'row' => $highestRow,
'column' => $highestColumn 'column' => $highestColumn
); );
} }
/** /**
* Get highest worksheet column * Get highest worksheet column
* *
* @return string Highest column name * @return string Highest column name
*/ */
public function getHighestColumn() public function getHighestColumn()
{ {
$colRow = $this->getHighestRowAndColumn(); $colRow = $this->getHighestRowAndColumn();
return $colRow['column']; return $colRow['column'];
} }
/** /**
* Get highest worksheet row * Get highest worksheet row
* *
* @return int Highest row number * @return int Highest row number
*/ */
public function getHighestRow() public function getHighestRow()
{ {
$colRow = $this->getHighestRowAndColumn(); $colRow = $this->getHighestRowAndColumn();
return $colRow['row']; return $colRow['row'];
} }
/** /**
* Generate a unique ID for cache referencing * Generate a unique ID for cache referencing
* *
* @return string Unique Reference * @return string Unique Reference
*/ */
protected function _getUniqueID() { protected function _getUniqueID() {
if (function_exists('posix_getpid')) { if (function_exists('posix_getpid')) {
$baseUnique = posix_getpid(); $baseUnique = posix_getpid();
} else { } else {
$baseUnique = mt_rand(); $baseUnique = mt_rand();
} }
return uniqid($baseUnique,true); return uniqid($baseUnique,true);
} }
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
$this->_parent = $parent; $this->_parent = $parent;
if (($this->_currentObject !== NULL) && (is_object($this->_currentObject))) { if (($this->_currentObject !== NULL) && (is_object($this->_currentObject))) {
$this->_currentObject->attach($parent); $this->_currentObject->attach($parent);
} }
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
return true; return true;
} }
} }

View File

@@ -1,205 +1,205 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_DiscISAM * PHPExcel_CachedObjectStorage_DiscISAM
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Name of the file for this cache * Name of the file for this cache
* *
* @var string * @var string
*/ */
private $_fileName = null; private $_fileName = null;
/** /**
* File handle for this cache file * File handle for this cache file
* *
* @var resource * @var resource
*/ */
private $_fileHandle = null; private $_fileHandle = null;
/** /**
* Directory/Folder where the cache file is located * Directory/Folder where the cache file is located
* *
* @var string * @var string
*/ */
private $_cacheDirectory = NULL; private $_cacheDirectory = NULL;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
fseek($this->_fileHandle,0,SEEK_END); fseek($this->_fileHandle,0,SEEK_END);
$offset = ftell($this->_fileHandle); $offset = ftell($this->_fileHandle);
fwrite($this->_fileHandle, serialize($this->_currentObject)); fwrite($this->_fileHandle, serialize($this->_currentObject));
$this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset, $this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
'sz' => ftell($this->_fileHandle) - $offset 'sz' => ftell($this->_fileHandle) - $offset
); );
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) { if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']); fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']);
$this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz'])); $this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz']));
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; $newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
// Copy the existing cell cache file // Copy the existing cell cache file
copy ($this->_fileName,$newFileName); copy ($this->_fileName,$newFileName);
$this->_fileName = $newFileName; $this->_fileName = $newFileName;
// Open the copied cell cache file // Open the copied cell cache file
$this->_fileHandle = fopen($this->_fileName,'a+'); $this->_fileHandle = fopen($this->_fileName,'a+');
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
// Close down the temporary cache file // Close down the temporary cache file
$this->__destruct(); $this->__destruct();
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(PHPExcel_Worksheet $parent, $arguments) { public function __construct(PHPExcel_Worksheet $parent, $arguments) {
$this->_cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== NULL)) $this->_cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== NULL))
? $arguments['dir'] ? $arguments['dir']
: PHPExcel_Shared_File::sys_get_temp_dir(); : PHPExcel_Shared_File::sys_get_temp_dir();
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->_fileHandle)) { if (is_null($this->_fileHandle)) {
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$this->_fileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; $this->_fileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
$this->_fileHandle = fopen($this->_fileName,'a+'); $this->_fileHandle = fopen($this->_fileName,'a+');
} }
} // function __construct() } // function __construct()
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
if (!is_null($this->_fileHandle)) { if (!is_null($this->_fileHandle)) {
fclose($this->_fileHandle); fclose($this->_fileHandle);
unlink($this->_fileName); unlink($this->_fileName);
} }
$this->_fileHandle = null; $this->_fileHandle = null;
} // function __destruct() } // function __destruct()
} }

View File

@@ -1,138 +1,138 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_Igbinary * PHPExcel_CachedObjectStorage_Igbinary
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject); $this->_cellCache[$this->_currentObjectID] = igbinary_serialize($this->_currentObject);
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) { if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = igbinary_unserialize($this->_cellCache[$pCoord]); $this->_currentObject = igbinary_unserialize($this->_cellCache[$pCoord]);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!function_exists('igbinary_serialize')) { if (!function_exists('igbinary_serialize')) {
return false; return false;
} }
return true; return true;
} }
} }

View File

@@ -1,298 +1,298 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_Memcache * PHPExcel_CachedObjectStorage_Memcache
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Prefix used to uniquely identify cache data for this worksheet * Prefix used to uniquely identify cache data for this worksheet
* *
* @var string * @var string
*/ */
private $_cachePrefix = null; private $_cachePrefix = null;
/** /**
* Cache timeout * Cache timeout
* *
* @var integer * @var integer
*/ */
private $_cacheTime = 600; private $_cacheTime = 600;
/** /**
* Memcache interface * Memcache interface
* *
* @var resource * @var resource
*/ */
private $_memcache = null; private $_memcache = null;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$obj = serialize($this->_currentObject); $obj = serialize($this->_currentObject);
if (!$this->_memcache->replace($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) { if (!$this->_memcache->replace($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) {
if (!$this->_memcache->add($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) { if (!$this->_memcache->add($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$this->_currentObjectID.' in MemCache'); throw new Exception('Failed to store cell '.$this->_currentObjectID.' in MemCache');
} }
} }
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_cellCache[$pCoord] = true; $this->_cellCache[$pCoord] = true;
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return void * @return void
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) { public function isDataSet($pCoord) {
// Check if the requested entry is the current object, or exists in the cache // Check if the requested entry is the current object, or exists in the cache
if (parent::isDataSet($pCoord)) { if (parent::isDataSet($pCoord)) {
if ($this->_currentObjectID == $pCoord) { if ($this->_currentObjectID == $pCoord) {
return true; return true;
} }
// Check if the requested entry still exists in Memcache // Check if the requested entry still exists in Memcache
$success = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache'); $success = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache');
if ($success === false) { if ($success === false) {
// Entry no longer exists in Memcache, so clear it from the cache array // Entry no longer exists in Memcache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); throw new Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
} }
return true; return true;
} }
return false; return false;
} // function isDataSet() } // function isDataSet()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (parent::isDataSet($pCoord)) { if (parent::isDataSet($pCoord)) {
$obj = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache'); $obj = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache');
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in Memcache, so clear it from the cache array // Entry no longer exists in Memcache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); throw new Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
} }
} else { } else {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize($obj); $this->_currentObject = unserialize($obj);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws Exception * @throws Exception
*/ */
public function deleteCacheData($pCoord) { public function deleteCacheData($pCoord) {
// Delete the entry from Memcache // Delete the entry from Memcache
$this->_memcache->delete($this->_cachePrefix.$pCoord.'.cache'); $this->_memcache->delete($this->_cachePrefix.$pCoord.'.cache');
// Delete the entry from our cell address array // Delete the entry from our cell address array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
} // function deleteCacheData() } // function deleteCacheData()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$newCachePrefix = substr(md5($baseUnique),0,8).'.'; $newCachePrefix = substr(md5($baseUnique),0,8).'.';
$cacheList = $this->getCellList(); $cacheList = $this->getCellList();
foreach($cacheList as $cellID) { foreach($cacheList as $cellID) {
if ($cellID != $this->_currentObjectID) { if ($cellID != $this->_currentObjectID) {
$obj = $this->_memcache->get($this->_cachePrefix.$cellID.'.cache'); $obj = $this->_memcache->get($this->_cachePrefix.$cellID.'.cache');
if ($obj === false) { if ($obj === false) {
// Entry no longer exists in Memcache, so clear it from the cache array // Entry no longer exists in Memcache, so clear it from the cache array
parent::deleteCacheData($cellID); parent::deleteCacheData($cellID);
throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache'); throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache');
} }
if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) { if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$cellID.' in MemCache'); throw new Exception('Failed to store cell '.$cellID.' in MemCache');
} }
} }
} }
$this->_cachePrefix = $newCachePrefix; $this->_cachePrefix = $newCachePrefix;
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
// Flush the Memcache cache // Flush the Memcache cache
$this->__destruct(); $this->__destruct();
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(PHPExcel_Worksheet $parent, $arguments) { public function __construct(PHPExcel_Worksheet $parent, $arguments) {
$memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost'; $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost';
$memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211; $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211;
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
if (is_null($this->_cachePrefix)) { if (is_null($this->_cachePrefix)) {
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; $this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
// Set a new Memcache object and connect to the Memcache server // Set a new Memcache object and connect to the Memcache server
$this->_memcache = new Memcache(); $this->_memcache = new Memcache();
if (!$this->_memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) { if (!$this->_memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) {
throw new Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort); throw new Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort);
} }
$this->_cacheTime = $cacheTime; $this->_cacheTime = $cacheTime;
parent::__construct($parent); parent::__construct($parent);
} }
} // function __construct() } // function __construct()
/** /**
* Memcache error handler * Memcache error handler
* *
* @param string $host Memcache server * @param string $host Memcache server
* @param integer $port Memcache port * @param integer $port Memcache port
* @throws Exception * @throws Exception
*/ */
public function failureCallback($host, $port) { public function failureCallback($host, $port) {
throw new Exception('memcache '.$host.':'.$port.' failed'); throw new Exception('memcache '.$host.':'.$port.' failed');
} }
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
$cacheList = $this->getCellList(); $cacheList = $this->getCellList();
foreach($cacheList as $cellID) { foreach($cacheList as $cellID) {
$this->_memcache->delete($this->_cachePrefix.$cellID.'.cache'); $this->_memcache->delete($this->_cachePrefix.$cellID.'.cache');
} }
} // function __destruct() } // function __destruct()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!function_exists('memcache_add')) { if (!function_exists('memcache_add')) {
return false; return false;
} }
return true; return true;
} }
} }

View File

@@ -1,109 +1,109 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_Memory * PHPExcel_CachedObjectStorage_Memory
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
$this->_cellCache[$pCoord] = $cell; $this->_cellCache[$pCoord] = $cell;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) { if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Return requested entry // Return requested entry
return $this->_cellCache[$pCoord]; return $this->_cellCache[$pCoord];
} // function getCacheData() } // function getCacheData()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
$newCollection = array(); $newCollection = array();
foreach($this->_cellCache as $k => &$cell) { foreach($this->_cellCache as $k => &$cell) {
$newCollection[$k] = clone $cell; $newCollection[$k] = clone $cell;
$newCollection[$k]->attach($parent); $newCollection[$k]->attach($parent);
} }
$this->_cellCache = $newCollection; $this->_cellCache = $newCollection;
} }
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
// Because cells are all stored as intact objects in memory, we need to detach each one from the parent // Because cells are all stored as intact objects in memory, we need to detach each one from the parent
foreach($this->_cellCache as $k => &$cell) { foreach($this->_cellCache as $k => &$cell) {
$cell->detach(); $cell->detach();
$this->_cellCache[$k] = null; $this->_cellCache[$k] = null;
} }
unset($cell); unset($cell);
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
} }

View File

@@ -1,123 +1,123 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_MemoryGZip * PHPExcel_CachedObjectStorage_MemoryGZip
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject)); $this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject));
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) { if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord])); $this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord]));
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
} }

View File

@@ -1,123 +1,123 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_MemorySerialized * PHPExcel_CachedObjectStorage_MemorySerialized
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject); $this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) { if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize($this->_cellCache[$pCoord]); $this->_currentObject = unserialize($this->_cellCache[$pCoord]);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
} }

View File

@@ -1,192 +1,192 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_PHPTemp * PHPExcel_CachedObjectStorage_PHPTemp
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Name of the file for this cache * Name of the file for this cache
* *
* @var string * @var string
*/ */
private $_fileHandle = null; private $_fileHandle = null;
/** /**
* Memory limit to use before reverting to file cache * Memory limit to use before reverting to file cache
* *
* @var integer * @var integer
*/ */
private $_memoryCacheSize = null; private $_memoryCacheSize = null;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
fseek($this->_fileHandle,0,SEEK_END); fseek($this->_fileHandle,0,SEEK_END);
$offset = ftell($this->_fileHandle); $offset = ftell($this->_fileHandle);
fwrite($this->_fileHandle, serialize($this->_currentObject)); fwrite($this->_fileHandle, serialize($this->_currentObject));
$this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset, $this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
'sz' => ftell($this->_fileHandle) - $offset 'sz' => ftell($this->_fileHandle) - $offset
); );
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
if (!isset($this->_cellCache[$pCoord])) { if (!isset($this->_cellCache[$pCoord])) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']); fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']);
$this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz'])); $this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz']));
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Open a new stream for the cell cache data // Open a new stream for the cell cache data
$newFileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+'); $newFileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+');
// Copy the existing cell cache data to the new stream // Copy the existing cell cache data to the new stream
fseek($this->_fileHandle,0); fseek($this->_fileHandle,0);
while (!feof($this->_fileHandle)) { while (!feof($this->_fileHandle)) {
fwrite($newFileHandle,fread($this->_fileHandle, 1024)); fwrite($newFileHandle,fread($this->_fileHandle, 1024));
} }
$this->_fileHandle = $newFileHandle; $this->_fileHandle = $newFileHandle;
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
// Close down the php://temp file // Close down the php://temp file
$this->__destruct(); $this->__destruct();
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(PHPExcel_Worksheet $parent, $arguments) { public function __construct(PHPExcel_Worksheet $parent, $arguments) {
$this->_memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB'; $this->_memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB';
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->_fileHandle)) { if (is_null($this->_fileHandle)) {
$this->_fileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+'); $this->_fileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+');
} }
} // function __construct() } // function __construct()
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
if (!is_null($this->_fileHandle)) { if (!is_null($this->_fileHandle)) {
fclose($this->_fileHandle); fclose($this->_fileHandle);
} }
$this->_fileHandle = null; $this->_fileHandle = null;
} // function __destruct() } // function __destruct()
} }

View File

@@ -1,270 +1,270 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_SQLite * PHPExcel_CachedObjectStorage_SQLite
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Database table name * Database table name
* *
* @var string * @var string
*/ */
private $_TableName = null; private $_TableName = null;
/** /**
* Database handle * Database handle
* *
* @var resource * @var resource
*/ */
private $_DBHandle = null; private $_DBHandle = null;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')")) if (!$this->_DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES('".$this->_currentObjectID."','".sqlite_escape_string(serialize($this->_currentObject))."')"))
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
$query = "SELECT value FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; $query = "SELECT value FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
$cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC); $cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC);
if ($cellResultSet === false) { if ($cellResultSet === false) {
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
} elseif ($cellResultSet->numRows() == 0) { } elseif ($cellResultSet->numRows() == 0) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$cellResult = $cellResultSet->fetchSingle(); $cellResult = $cellResultSet->fetchSingle();
$this->_currentObject = unserialize($cellResult); $this->_currentObject = unserialize($cellResult);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Is a value set for an indexed cell? * Is a value set for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) { public function isDataSet($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return true; return true;
} }
// Check if the requested entry exists in the cache // Check if the requested entry exists in the cache
$query = "SELECT id FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; $query = "SELECT id FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
$cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC); $cellResultSet = $this->_DBHandle->query($query,SQLITE_ASSOC);
if ($cellResultSet === false) { if ($cellResultSet === false) {
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
} elseif ($cellResultSet->numRows() == 0) { } elseif ($cellResultSet->numRows() == 0) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return false; return false;
} }
return true; return true;
} // function isDataSet() } // function isDataSet()
/** /**
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws Exception * @throws Exception
*/ */
public function deleteCacheData($pCoord) { public function deleteCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} }
// Check if the requested entry exists in the cache // Check if the requested entry exists in the cache
$query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; $query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
if (!$this->_DBHandle->queryExec($query)) if (!$this->_DBHandle->queryExec($query))
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} // function deleteCacheData() } // function deleteCacheData()
/** /**
* Get a list of all cell addresses currently held in cache * Get a list of all cell addresses currently held in cache
* *
* @return array of string * @return array of string
*/ */
public function getCellList() { public function getCellList() {
$query = "SELECT id FROM kvp_".$this->_TableName; $query = "SELECT id FROM kvp_".$this->_TableName;
$cellIdsResult = $this->_DBHandle->unbufferedQuery($query,SQLITE_ASSOC); $cellIdsResult = $this->_DBHandle->unbufferedQuery($query,SQLITE_ASSOC);
if ($cellIdsResult === false) if ($cellIdsResult === false)
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
$cellKeys = array(); $cellKeys = array();
foreach($cellIdsResult as $row) { foreach($cellIdsResult as $row) {
$cellKeys[] = $row['id']; $cellKeys[] = $row['id'];
} }
return $cellKeys; return $cellKeys;
} // function getCellList() } // function getCellList()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
// Get a new id for the new table name // Get a new id for the new table name
$tableName = str_replace('.','_',$this->_getUniqueID()); $tableName = str_replace('.','_',$this->_getUniqueID());
if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
AS SELECT * FROM kvp_'.$this->_TableName)) AS SELECT * FROM kvp_'.$this->_TableName))
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
// Copy the existing cell cache file // Copy the existing cell cache file
$this->_TableName = $tableName; $this->_TableName = $tableName;
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
// Close down the temporary cache file // Close down the temporary cache file
$this->__destruct(); $this->__destruct();
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
*/ */
public function __construct(PHPExcel_Worksheet $parent) { public function __construct(PHPExcel_Worksheet $parent) {
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->_DBHandle)) { if (is_null($this->_DBHandle)) {
$this->_TableName = str_replace('.','_',$this->_getUniqueID()); $this->_TableName = str_replace('.','_',$this->_getUniqueID());
$_DBName = ':memory:'; $_DBName = ':memory:';
$this->_DBHandle = new SQLiteDatabase($_DBName); $this->_DBHandle = new SQLiteDatabase($_DBName);
if ($this->_DBHandle === false) if ($this->_DBHandle === false)
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) if (!$this->_DBHandle->queryExec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)'))
throw new Exception(sqlite_error_string($this->_DBHandle->lastError())); throw new Exception(sqlite_error_string($this->_DBHandle->lastError()));
} }
} // function __construct() } // function __construct()
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
$this->_DBHandle = null; $this->_DBHandle = null;
} // function __destruct() } // function __destruct()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!function_exists('sqlite_open')) { if (!function_exists('sqlite_open')) {
return false; return false;
} }
return true; return true;
} }
} }

View File

@@ -1,277 +1,277 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_SQLite3 * PHPExcel_CachedObjectStorage_SQLite3
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Database table name * Database table name
* *
* @var string * @var string
*/ */
private $_TableName = null; private $_TableName = null;
/** /**
* Database handle * Database handle
* *
* @var resource * @var resource
*/ */
private $_DBHandle = null; private $_DBHandle = null;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$query = $this->_DBHandle->prepare("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES(:id,:data)"); $query = $this->_DBHandle->prepare("INSERT OR REPLACE INTO kvp_".$this->_TableName." VALUES(:id,:data)");
$query->bindValue('id',$this->_currentObjectID,SQLITE3_TEXT); $query->bindValue('id',$this->_currentObjectID,SQLITE3_TEXT);
$query->bindValue('data',serialize($this->_currentObject),SQLITE3_BLOB); $query->bindValue('data',serialize($this->_currentObject),SQLITE3_BLOB);
$result = $query->execute(); $result = $query->execute();
if ($result === false) if ($result === false)
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
$query = "SELECT value FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; $query = "SELECT value FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
$cellResult = $this->_DBHandle->querySingle($query); $cellResult = $this->_DBHandle->querySingle($query);
if ($cellResult === false) { if ($cellResult === false) {
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
} elseif (is_null($cellResult)) { } elseif (is_null($cellResult)) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize($cellResult); $this->_currentObject = unserialize($cellResult);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Is a value set for an indexed cell? * Is a value set for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) { public function isDataSet($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return true; return true;
} }
// Check if the requested entry exists in the cache // Check if the requested entry exists in the cache
$query = "SELECT id FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; $query = "SELECT id FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
$cellResult = $this->_DBHandle->querySingle($query); $cellResult = $this->_DBHandle->querySingle($query);
if ($cellResult === false) { if ($cellResult === false) {
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
} elseif (is_null($cellResult)) { } elseif (is_null($cellResult)) {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return false; return false;
} }
return true; return true;
} // function isDataSet() } // function isDataSet()
/** /**
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws Exception * @throws Exception
*/ */
public function deleteCacheData($pCoord) { public function deleteCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} }
// Check if the requested entry exists in the cache // Check if the requested entry exists in the cache
$query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'"; $query = "DELETE FROM kvp_".$this->_TableName." WHERE id='".$pCoord."'";
$result = $this->_DBHandle->exec($query); $result = $this->_DBHandle->exec($query);
if ($result === false) if ($result === false)
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} // function deleteCacheData() } // function deleteCacheData()
/** /**
* Get a list of all cell addresses currently held in cache * Get a list of all cell addresses currently held in cache
* *
* @return array of string * @return array of string
*/ */
public function getCellList() { public function getCellList() {
$query = "SELECT id FROM kvp_".$this->_TableName; $query = "SELECT id FROM kvp_".$this->_TableName;
$cellIdsResult = $this->_DBHandle->query($query); $cellIdsResult = $this->_DBHandle->query($query);
if ($cellIdsResult === false) if ($cellIdsResult === false)
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
$cellKeys = array(); $cellKeys = array();
while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) { while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) {
$cellKeys[] = $row['id']; $cellKeys[] = $row['id'];
} }
return $cellKeys; return $cellKeys;
} // function getCellList() } // function getCellList()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
// Get a new id for the new table name // Get a new id for the new table name
$tableName = str_replace('.','_',$this->_getUniqueID()); $tableName = str_replace('.','_',$this->_getUniqueID());
if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
AS SELECT * FROM kvp_'.$this->_TableName)) AS SELECT * FROM kvp_'.$this->_TableName))
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
// Copy the existing cell cache file // Copy the existing cell cache file
$this->_TableName = $tableName; $this->_TableName = $tableName;
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
// Close down the temporary cache file // Close down the temporary cache file
$this->__destruct(); $this->__destruct();
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
*/ */
public function __construct(PHPExcel_Worksheet $parent) { public function __construct(PHPExcel_Worksheet $parent) {
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->_DBHandle)) { if (is_null($this->_DBHandle)) {
$this->_TableName = str_replace('.','_',$this->_getUniqueID()); $this->_TableName = str_replace('.','_',$this->_getUniqueID());
$_DBName = ':memory:'; $_DBName = ':memory:';
$this->_DBHandle = new SQLite3($_DBName); $this->_DBHandle = new SQLite3($_DBName);
if ($this->_DBHandle === false) if ($this->_DBHandle === false)
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) if (!$this->_DBHandle->exec('CREATE TABLE kvp_'.$this->_TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)'))
throw new Exception($this->_DBHandle->lastErrorMsg()); throw new Exception($this->_DBHandle->lastErrorMsg());
} }
} // function __construct() } // function __construct()
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
if (!is_null($this->_DBHandle)) { if (!is_null($this->_DBHandle)) {
$this->_DBHandle->close(); $this->_DBHandle->close();
} }
$this->_DBHandle = null; $this->_DBHandle = null;
} // function __destruct() } // function __destruct()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!class_exists('SQLite3',FALSE)) { if (!class_exists('SQLite3',FALSE)) {
return false; return false;
} }
return true; return true;
} }
} }

View File

@@ -1,280 +1,280 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorage_Wincache * PHPExcel_CachedObjectStorage_Wincache
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache { class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
/** /**
* Prefix used to uniquely identify cache data for this worksheet * Prefix used to uniquely identify cache data for this worksheet
* *
* @var string * @var string
*/ */
private $_cachePrefix = null; private $_cachePrefix = null;
/** /**
* Cache timeout * Cache timeout
* *
* @var integer * @var integer
*/ */
private $_cacheTime = 600; private $_cacheTime = 600;
/** /**
* Store cell data in cache for the current cell object if it's "dirty", * Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object * and the 'nullify' the current cell object
* *
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
private function _storeData() { private function _storeData() {
if ($this->_currentCellIsDirty) { if ($this->_currentCellIsDirty) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$obj = serialize($this->_currentObject); $obj = serialize($this->_currentObject);
if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.'.cache')) { if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.'.cache')) {
if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) { if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache'); throw new Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache');
} }
} else { } else {
if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) { if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache'); throw new Exception('Failed to store cell '.$this->_currentObjectID.' in WinCache');
} }
} }
$this->_currentCellIsDirty = false; $this->_currentCellIsDirty = false;
} }
$this->_currentObjectID = $this->_currentObject = null; $this->_currentObjectID = $this->_currentObject = null;
} // function _storeData() } // function _storeData()
/** /**
* Add or Update a cell in cache identified by coordinate address * Add or Update a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to update * @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update * @param PHPExcel_Cell $cell Cell to update
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function addCacheData($pCoord, PHPExcel_Cell $cell) { public function addCacheData($pCoord, PHPExcel_Cell $cell) {
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
$this->_storeData(); $this->_storeData();
} }
$this->_cellCache[$pCoord] = true; $this->_cellCache[$pCoord] = true;
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = $cell; $this->_currentObject = $cell;
$this->_currentCellIsDirty = true; $this->_currentCellIsDirty = true;
return $cell; return $cell;
} // function addCacheData() } // function addCacheData()
/** /**
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
* *
* @param string $pCoord Coordinate address of the cell to check * @param string $pCoord Coordinate address of the cell to check
* @return boolean * @return boolean
*/ */
public function isDataSet($pCoord) { public function isDataSet($pCoord) {
// Check if the requested entry is the current object, or exists in the cache // Check if the requested entry is the current object, or exists in the cache
if (parent::isDataSet($pCoord)) { if (parent::isDataSet($pCoord)) {
if ($this->_currentObjectID == $pCoord) { if ($this->_currentObjectID == $pCoord) {
return true; return true;
} }
// Check if the requested entry still exists in cache // Check if the requested entry still exists in cache
$success = wincache_ucache_exists($this->_cachePrefix.$pCoord.'.cache'); $success = wincache_ucache_exists($this->_cachePrefix.$pCoord.'.cache');
if ($success === false) { if ($success === false) {
// Entry no longer exists in Wincache, so clear it from the cache array // Entry no longer exists in Wincache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); throw new Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
} }
return true; return true;
} }
return false; return false;
} // function isDataSet() } // function isDataSet()
/** /**
* Get cell at a specific coordinate * Get cell at a specific coordinate
* *
* @param string $pCoord Coordinate of the cell * @param string $pCoord Coordinate of the cell
* @throws Exception * @throws Exception
* @return PHPExcel_Cell Cell that was found, or null if not found * @return PHPExcel_Cell Cell that was found, or null if not found
*/ */
public function getCacheData($pCoord) { public function getCacheData($pCoord) {
if ($pCoord === $this->_currentObjectID) { if ($pCoord === $this->_currentObjectID) {
return $this->_currentObject; return $this->_currentObject;
} }
$this->_storeData(); $this->_storeData();
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
$obj = null; $obj = null;
if (parent::isDataSet($pCoord)) { if (parent::isDataSet($pCoord)) {
$success = false; $success = false;
$obj = wincache_ucache_get($this->_cachePrefix.$pCoord.'.cache', $success); $obj = wincache_ucache_get($this->_cachePrefix.$pCoord.'.cache', $success);
if ($success === false) { if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array // Entry no longer exists in WinCache, so clear it from the cache array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
throw new Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); throw new Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
} }
} else { } else {
// Return null if requested entry doesn't exist in cache // Return null if requested entry doesn't exist in cache
return null; return null;
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->_currentObjectID = $pCoord; $this->_currentObjectID = $pCoord;
$this->_currentObject = unserialize($obj); $this->_currentObject = unserialize($obj);
// Re-attach the parent worksheet // Re-attach the parent worksheet
$this->_currentObject->attach($this->_parent); $this->_currentObject->attach($this->_parent);
// Return requested entry // Return requested entry
return $this->_currentObject; return $this->_currentObject;
} // function getCacheData() } // function getCacheData()
/** /**
* Delete a cell in cache identified by coordinate address * Delete a cell in cache identified by coordinate address
* *
* @param string $pCoord Coordinate address of the cell to delete * @param string $pCoord Coordinate address of the cell to delete
* @throws Exception * @throws Exception
*/ */
public function deleteCacheData($pCoord) { public function deleteCacheData($pCoord) {
// Delete the entry from Wincache // Delete the entry from Wincache
wincache_ucache_delete($this->_cachePrefix.$pCoord.'.cache'); wincache_ucache_delete($this->_cachePrefix.$pCoord.'.cache');
// Delete the entry from our cell address array // Delete the entry from our cell address array
parent::deleteCacheData($pCoord); parent::deleteCacheData($pCoord);
} // function deleteCacheData() } // function deleteCacheData()
/** /**
* Clone the cell collection * Clone the cell collection
* *
* @param PHPExcel_Worksheet $parent The new worksheet * @param PHPExcel_Worksheet $parent The new worksheet
* @return void * @return void
*/ */
public function copyCellCollection(PHPExcel_Worksheet $parent) { public function copyCellCollection(PHPExcel_Worksheet $parent) {
parent::copyCellCollection($parent); parent::copyCellCollection($parent);
// Get a new id for the new file name // Get a new id for the new file name
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$newCachePrefix = substr(md5($baseUnique),0,8).'.'; $newCachePrefix = substr(md5($baseUnique),0,8).'.';
$cacheList = $this->getCellList(); $cacheList = $this->getCellList();
foreach($cacheList as $cellID) { foreach($cacheList as $cellID) {
if ($cellID != $this->_currentObjectID) { if ($cellID != $this->_currentObjectID) {
$success = false; $success = false;
$obj = wincache_ucache_get($this->_cachePrefix.$cellID.'.cache', $success); $obj = wincache_ucache_get($this->_cachePrefix.$cellID.'.cache', $success);
if ($success === false) { if ($success === false) {
// Entry no longer exists in WinCache, so clear it from the cache array // Entry no longer exists in WinCache, so clear it from the cache array
parent::deleteCacheData($cellID); parent::deleteCacheData($cellID);
throw new Exception('Cell entry '.$cellID.' no longer exists in Wincache'); throw new Exception('Cell entry '.$cellID.' no longer exists in Wincache');
} }
if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) { if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) {
$this->__destruct(); $this->__destruct();
throw new Exception('Failed to store cell '.$cellID.' in Wincache'); throw new Exception('Failed to store cell '.$cellID.' in Wincache');
} }
} }
} }
$this->_cachePrefix = $newCachePrefix; $this->_cachePrefix = $newCachePrefix;
} // function copyCellCollection() } // function copyCellCollection()
/** /**
* Clear the cell collection and disconnect from our parent * Clear the cell collection and disconnect from our parent
* *
* @return void * @return void
*/ */
public function unsetWorksheetCells() { public function unsetWorksheetCells() {
if(!is_null($this->_currentObject)) { if(!is_null($this->_currentObject)) {
$this->_currentObject->detach(); $this->_currentObject->detach();
$this->_currentObject = $this->_currentObjectID = null; $this->_currentObject = $this->_currentObjectID = null;
} }
// Flush the WinCache cache // Flush the WinCache cache
$this->__destruct(); $this->__destruct();
$this->_cellCache = array(); $this->_cellCache = array();
// detach ourself from the worksheet, so that it can then delete this object successfully // detach ourself from the worksheet, so that it can then delete this object successfully
$this->_parent = null; $this->_parent = null;
} // function unsetWorksheetCells() } // function unsetWorksheetCells()
/** /**
* Initialise this new cell collection * Initialise this new cell collection
* *
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
* @param array of mixed $arguments Additional initialisation arguments * @param array of mixed $arguments Additional initialisation arguments
*/ */
public function __construct(PHPExcel_Worksheet $parent, $arguments) { public function __construct(PHPExcel_Worksheet $parent, $arguments) {
$cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
if (is_null($this->_cachePrefix)) { if (is_null($this->_cachePrefix)) {
$baseUnique = $this->_getUniqueID(); $baseUnique = $this->_getUniqueID();
$this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; $this->_cachePrefix = substr(md5($baseUnique),0,8).'.';
$this->_cacheTime = $cacheTime; $this->_cacheTime = $cacheTime;
parent::__construct($parent); parent::__construct($parent);
} }
} // function __construct() } // function __construct()
/** /**
* Destroy this cell collection * Destroy this cell collection
*/ */
public function __destruct() { public function __destruct() {
$cacheList = $this->getCellList(); $cacheList = $this->getCellList();
foreach($cacheList as $cellID) { foreach($cacheList as $cellID) {
wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache'); wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache');
} }
} // function __destruct() } // function __destruct()
/** /**
* Identify whether the caching method is currently available * Identify whether the caching method is currently available
* Some methods are dependent on the availability of certain extensions being enabled in the PHP build * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
* *
* @return boolean * @return boolean
*/ */
public static function cacheMethodIsAvailable() { public static function cacheMethodIsAvailable() {
if (!function_exists('wincache_ucache_add')) { if (!function_exists('wincache_ucache_add')) {
return false; return false;
} }
return true; return true;
} }
} }

View File

@@ -1,239 +1,239 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel
* *
* Copyright (c) 2006 - 2012 PHPExcel * Copyright (c) 2006 - 2012 PHPExcel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel * @package PHPExcel
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.8, 2012-10-12 * @version 1.7.8, 2012-10-12
*/ */
/** /**
* PHPExcel_CachedObjectStorageFactory * PHPExcel_CachedObjectStorageFactory
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_CachedObjectStorage * @package PHPExcel_CachedObjectStorage
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_CachedObjectStorageFactory class PHPExcel_CachedObjectStorageFactory
{ {
const cache_in_memory = 'Memory'; const cache_in_memory = 'Memory';
const cache_in_memory_gzip = 'MemoryGZip'; const cache_in_memory_gzip = 'MemoryGZip';
const cache_in_memory_serialized = 'MemorySerialized'; const cache_in_memory_serialized = 'MemorySerialized';
const cache_igbinary = 'Igbinary'; const cache_igbinary = 'Igbinary';
const cache_to_discISAM = 'DiscISAM'; const cache_to_discISAM = 'DiscISAM';
const cache_to_apc = 'APC'; const cache_to_apc = 'APC';
const cache_to_memcache = 'Memcache'; const cache_to_memcache = 'Memcache';
const cache_to_phpTemp = 'PHPTemp'; const cache_to_phpTemp = 'PHPTemp';
const cache_to_wincache = 'Wincache'; const cache_to_wincache = 'Wincache';
const cache_to_sqlite = 'SQLite'; const cache_to_sqlite = 'SQLite';
const cache_to_sqlite3 = 'SQLite3'; const cache_to_sqlite3 = 'SQLite3';
/** /**
* Name of the method used for cell cacheing * Name of the method used for cell cacheing
* *
* @var string * @var string
*/ */
private static $_cacheStorageMethod = NULL; private static $_cacheStorageMethod = NULL;
/** /**
* Name of the class used for cell cacheing * Name of the class used for cell cacheing
* *
* @var string * @var string
*/ */
private static $_cacheStorageClass = NULL; private static $_cacheStorageClass = NULL;
/** /**
* List of all possible cache storage methods * List of all possible cache storage methods
* *
* @var string[] * @var string[]
*/ */
private static $_storageMethods = array( private static $_storageMethods = array(
self::cache_in_memory, self::cache_in_memory,
self::cache_in_memory_gzip, self::cache_in_memory_gzip,
self::cache_in_memory_serialized, self::cache_in_memory_serialized,
self::cache_igbinary, self::cache_igbinary,
self::cache_to_phpTemp, self::cache_to_phpTemp,
self::cache_to_discISAM, self::cache_to_discISAM,
self::cache_to_apc, self::cache_to_apc,
self::cache_to_memcache, self::cache_to_memcache,
self::cache_to_wincache, self::cache_to_wincache,
self::cache_to_sqlite, self::cache_to_sqlite,
self::cache_to_sqlite3, self::cache_to_sqlite3,
); );
/** /**
* Default arguments for each cache storage method * Default arguments for each cache storage method
* *
* @var array of mixed array * @var array of mixed array
*/ */
private static $_storageMethodDefaultParameters = array( private static $_storageMethodDefaultParameters = array(
self::cache_in_memory => array( self::cache_in_memory => array(
), ),
self::cache_in_memory_gzip => array( self::cache_in_memory_gzip => array(
), ),
self::cache_in_memory_serialized => array( self::cache_in_memory_serialized => array(
), ),
self::cache_igbinary => array( self::cache_igbinary => array(
), ),
self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB' self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB'
), ),
self::cache_to_discISAM => array( 'dir' => NULL self::cache_to_discISAM => array( 'dir' => NULL
), ),
self::cache_to_apc => array( 'cacheTime' => 600 self::cache_to_apc => array( 'cacheTime' => 600
), ),
self::cache_to_memcache => array( 'memcacheServer' => 'localhost', self::cache_to_memcache => array( 'memcacheServer' => 'localhost',
'memcachePort' => 11211, 'memcachePort' => 11211,
'cacheTime' => 600 'cacheTime' => 600
), ),
self::cache_to_wincache => array( 'cacheTime' => 600 self::cache_to_wincache => array( 'cacheTime' => 600
), ),
self::cache_to_sqlite => array( self::cache_to_sqlite => array(
), ),
self::cache_to_sqlite3 => array( self::cache_to_sqlite3 => array(
), ),
); );
/** /**
* Arguments for the active cache storage method * Arguments for the active cache storage method
* *
* @var array of mixed array * @var array of mixed array
*/ */
private static $_storageMethodParameters = array(); private static $_storageMethodParameters = array();
/** /**
* Return the current cache storage method * Return the current cache storage method
* *
* @return string|NULL * @return string|NULL
**/ **/
public static function getCacheStorageMethod() public static function getCacheStorageMethod()
{ {
return self::$_cacheStorageMethod; return self::$_cacheStorageMethod;
} // function getCacheStorageMethod() } // function getCacheStorageMethod()
/** /**
* Return the current cache storage class * Return the current cache storage class
* *
* @return PHPExcel_CachedObjectStorage_ICache|NULL * @return PHPExcel_CachedObjectStorage_ICache|NULL
**/ **/
public static function getCacheStorageClass() public static function getCacheStorageClass()
{ {
return self::$_cacheStorageClass; return self::$_cacheStorageClass;
} // function getCacheStorageClass() } // function getCacheStorageClass()
/** /**
* Return the list of all possible cache storage methods * Return the list of all possible cache storage methods
* *
* @return string[] * @return string[]
**/ **/
public static function getAllCacheStorageMethods() public static function getAllCacheStorageMethods()
{ {
return self::$_storageMethods; return self::$_storageMethods;
} // function getCacheStorageMethods() } // function getCacheStorageMethods()
/** /**
* Return the list of all available cache storage methods * Return the list of all available cache storage methods
* *
* @return string[] * @return string[]
**/ **/
public static function getCacheStorageMethods() public static function getCacheStorageMethods()
{ {
$activeMethods = array(); $activeMethods = array();
foreach(self::$_storageMethods as $storageMethod) { foreach(self::$_storageMethods as $storageMethod) {
$cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $storageMethod; $cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $storageMethod;
if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) { if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) {
$activeMethods[] = $storageMethod; $activeMethods[] = $storageMethod;
} }
} }
return $activeMethods; return $activeMethods;
} // function getCacheStorageMethods() } // function getCacheStorageMethods()
/** /**
* Identify the cache storage method to use * Identify the cache storage method to use
* *
* @param string $method Name of the method to use for cell cacheing * @param string $method Name of the method to use for cell cacheing
* @param array of mixed $arguments Additional arguments to pass to the cell caching class * @param array of mixed $arguments Additional arguments to pass to the cell caching class
* when instantiating * when instantiating
* @return boolean * @return boolean
**/ **/
public static function initialize($method = self::cache_in_memory, $arguments = array()) public static function initialize($method = self::cache_in_memory, $arguments = array())
{ {
if (!in_array($method,self::$_storageMethods)) { if (!in_array($method,self::$_storageMethods)) {
return FALSE; return FALSE;
} }
$cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method; $cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method;
if (!call_user_func(array( $cacheStorageClass, if (!call_user_func(array( $cacheStorageClass,
'cacheMethodIsAvailable'))) { 'cacheMethodIsAvailable'))) {
return FALSE; return FALSE;
} }
self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method]; self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method];
foreach($arguments as $k => $v) { foreach($arguments as $k => $v) {
if (isset(self::$_storageMethodParameters[$method][$k])) { if (isset(self::$_storageMethodParameters[$method][$k])) {
self::$_storageMethodParameters[$method][$k] = $v; self::$_storageMethodParameters[$method][$k] = $v;
} }
} }
if (self::$_cacheStorageMethod === NULL) { if (self::$_cacheStorageMethod === NULL) {
self::$_cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method; self::$_cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method;
self::$_cacheStorageMethod = $method; self::$_cacheStorageMethod = $method;
} }
return TRUE; return TRUE;
} // function initialize() } // function initialize()
/** /**
* Initialise the cache storage * Initialise the cache storage
* *
* @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet * @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet
* @return PHPExcel_CachedObjectStorage_ICache * @return PHPExcel_CachedObjectStorage_ICache
**/ **/
public static function getInstance(PHPExcel_Worksheet $parent) public static function getInstance(PHPExcel_Worksheet $parent)
{ {
$cacheMethodIsAvailable = TRUE; $cacheMethodIsAvailable = TRUE;
if (self::$_cacheStorageMethod === NULL) { if (self::$_cacheStorageMethod === NULL) {
$cacheMethodIsAvailable = self::initialize(); $cacheMethodIsAvailable = self::initialize();
} }
if ($cacheMethodIsAvailable) { if ($cacheMethodIsAvailable) {
$instance = new self::$_cacheStorageClass( $parent, $instance = new self::$_cacheStorageClass( $parent,
self::$_storageMethodParameters[self::$_cacheStorageMethod] self::$_storageMethodParameters[self::$_cacheStorageMethod]
); );
if ($instance !== NULL) { if ($instance !== NULL) {
return $instance; return $instance;
} }
} }
return FALSE; return FALSE;
} // function getInstance() } // function getInstance()
} }

View File

@@ -1,17 +1,17 @@
ChartDirector ChartDirector
http://www.advsofteng.com/cdphp.html http://www.advsofteng.com/cdphp.html
GraPHPite GraPHPite
http://graphpite.sourceforge.net/ http://graphpite.sourceforge.net/
JpGraph JpGraph
http://www.aditus.nu/jpgraph/ http://www.aditus.nu/jpgraph/
LibChart LibChart
http://naku.dohcrew.com/libchart/pages/introduction/ http://naku.dohcrew.com/libchart/pages/introduction/
pChart pChart
http://pchart.sourceforge.net/ http://pchart.sourceforge.net/
TeeChart TeeChart
http://www.steema.com/products/teechart/overview.html http://www.steema.com/products/teechart/overview.html

File diff suppressed because it is too large Load Diff

View File

@@ -53,14 +53,14 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
*/ */
private $_readDataOnly = FALSE; private $_readDataOnly = FALSE;
/** /**
* Read charts that are defined in the workbook? * Read charts that are defined in the workbook?
* Identifies whether the Reader should read the definitions for any charts that exist in the workbook; * Identifies whether the Reader should read the definitions for any charts that exist in the workbook;
* *
* @var boolean * @var boolean
*/ */
private $_includeCharts = FALSE; private $_includeCharts = FALSE;
/** /**
* Restrict which sheets should be loaded? * 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. * This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded.
@@ -91,15 +91,15 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
private static $_theme = NULL; private static $_theme = NULL;
/** /**
* Create a new PHPExcel_Reader_Excel2007 instance * Create a new PHPExcel_Reader_Excel2007 instance
*/ */
public function __construct() { public function __construct() {
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
$this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance(); $this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance();
} }
/** /**
* Read data only? * Read data only?
* If this is true, then the Reader will only read data values for cells, it will not read any formatting information. * If this is true, then the Reader will only read data values for cells, it will not read any formatting information.
@@ -111,7 +111,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $this->_readDataOnly; return $this->_readDataOnly;
} }
/** /**
* Set read data only * Set read data only
* Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
@@ -125,37 +125,37 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$this->_readDataOnly = $pValue; $this->_readDataOnly = $pValue;
return $this; return $this;
} }
/**
* Read charts in workbook? /**
* If this is true, then the Reader will include any charts that exist in the workbook. * Read charts in workbook?
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. * If this is true, then the Reader will include any charts that exist in the workbook.
* If false (the default) it will ignore any charts defined in the workbook file. * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
* * If false (the default) it will ignore any charts defined in the workbook file.
* @return boolean *
*/ * @return boolean
public function getIncludeCharts() { */
return $this->_includeCharts; public function getIncludeCharts() {
} return $this->_includeCharts;
}
/**
* Set read charts in workbook /**
* Set to true, to advise the Reader to include any charts that exist in the workbook. * Set read charts in workbook
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. * Set to true, to advise the Reader to include any charts that exist in the workbook.
* Set to false (the default) to discard charts. * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
* * Set to false (the default) to discard charts.
* @param boolean $pValue *
* * @param boolean $pValue
* @return PHPExcel_Reader_Excel2007 *
*/ * @return PHPExcel_Reader_Excel2007
public function setIncludeCharts($pValue = FALSE) { */
$this->_includeCharts = (boolean) $pValue; public function setIncludeCharts($pValue = FALSE) {
return $this; $this->_includeCharts = (boolean) $pValue;
} return $this;
}
/** /**
* Get which sheets to load * Get which sheets to load
* Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null
@@ -168,7 +168,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $this->_loadSheetsOnly; return $this->_loadSheetsOnly;
} }
/** /**
* Set which sheets to load * Set which sheets to load
* *
@@ -185,7 +185,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $this; return $this;
} }
/** /**
* Set all sheets to load * Set all sheets to load
* Tells the Reader to load all worksheets from the workbook. * Tells the Reader to load all worksheets from the workbook.
@@ -198,7 +198,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $this; return $this;
} }
/** /**
* Read filter * Read filter
* *
@@ -208,7 +208,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $this->_readFilter; return $this->_readFilter;
} }
/** /**
* Set read filter * Set read filter
* *
@@ -264,82 +264,82 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $xl; return $xl;
} }
/** /**
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
* *
* @param string $pFilename * @param string $pFilename
* @throws Exception * @throws Exception
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($pFilename)
{ {
// Check if file exists // Check if file exists
if (!file_exists($pFilename)) { if (!file_exists($pFilename)) {
throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); throw new Exception("Could not open " . $pFilename . " for reading! File does not exist.");
} }
$worksheetInfo = array(); $worksheetInfo = array();
$zip = new ZipArchive; $zip = new ZipArchive;
$zip->open($pFilename); $zip->open($pFilename);
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); $rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships");
foreach ($rels->Relationship as $rel) { foreach ($rels->Relationship as $rel) {
if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") { if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") {
$dir = dirname($rel["Target"]); $dir = dirname($rel["Target"]);
$relsWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); $relsWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships");
$relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
$worksheets = array(); $worksheets = array();
foreach ($relsWorkbook->Relationship as $ele) { foreach ($relsWorkbook->Relationship as $ele) {
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") { if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
$worksheets[(string) $ele["Id"]] = $ele["Target"]; $worksheets[(string) $ele["Id"]] = $ele["Target"];
} }
} }
$xmlWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); $xmlWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
if ($xmlWorkbook->sheets) { if ($xmlWorkbook->sheets) {
$dir = dirname($rel["Target"]); $dir = dirname($rel["Target"]);
foreach ($xmlWorkbook->sheets->sheet as $eleSheet) { foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
$tmpInfo = array(); $tmpInfo = array();
$tmpInfo['worksheetName'] = (string) $eleSheet["name"]; $tmpInfo['worksheetName'] = (string) $eleSheet["name"];
$tmpInfo['lastColumnLetter'] = 'A'; $tmpInfo['lastColumnLetter'] = 'A';
$tmpInfo['lastColumnIndex'] = 0; $tmpInfo['lastColumnIndex'] = 0;
$tmpInfo['totalRows'] = 0; $tmpInfo['totalRows'] = 0;
$tmpInfo['totalColumns'] = 0; $tmpInfo['totalColumns'] = 0;
$fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; $fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
$xmlSheet = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$fileWorksheet")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); $xmlSheet = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$fileWorksheet")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) { if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) {
foreach ($xmlSheet->sheetData->row as $row) { foreach ($xmlSheet->sheetData->row as $row) {
foreach ($row->c as $c) { foreach ($row->c as $c) {
$r = (string) $c["r"]; $r = (string) $c["r"];
$coordinates = PHPExcel_Cell::coordinateFromString($r); $coordinates = PHPExcel_Cell::coordinateFromString($r);
$rowIndex = $coordinates[1]; $rowIndex = $coordinates[1];
$columnIndex = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1; $columnIndex = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1;
$tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex); $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex);
$tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex); $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex);
} }
} }
} }
$tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
$tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
$worksheetInfo[] = $tmpInfo; $worksheetInfo[] = $tmpInfo;
} }
} }
} }
} }
$zip->close(); $zip->close();
return $worksheetInfo; return $worksheetInfo;
} }
private static function _castToBool($c) { private static function _castToBool($c) {
// echo 'Initial Cast to Boolean<br />'; // echo 'Initial Cast to Boolean<br />';
$value = isset($c->v) ? (string) $c->v : NULL; $value = isset($c->v) ? (string) $c->v : NULL;
@@ -353,19 +353,19 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $value; return $value;
} // function _castToBool() } // function _castToBool()
private static function _castToError($c) { private static function _castToError($c) {
// echo 'Initial Cast to Error<br />'; // echo 'Initial Cast to Error<br />';
return isset($c->v) ? (string) $c->v : NULL; return isset($c->v) ? (string) $c->v : NULL;
} // function _castToError() } // function _castToError()
private static function _castToString($c) { private static function _castToString($c) {
// echo 'Initial Cast to String<br />'; // echo 'Initial Cast to String<br />';
return isset($c->v) ? (string) $c->v : NULL; return isset($c->v) ? (string) $c->v : NULL;
} // function _castToString() } // function _castToString()
private function _castToFormula($c,$r,&$cellDataType,&$value,&$calculatedValue,&$sharedFormulas,$castBaseType) { private function _castToFormula($c,$r,&$cellDataType,&$value,&$calculatedValue,&$sharedFormulas,$castBaseType) {
// echo 'Formula<br />'; // echo 'Formula<br />';
// echo '$c->f is '.$c->f.'<br />'; // echo '$c->f is '.$c->f.'<br />';
@@ -414,7 +414,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
} }
public function _getFromZipArchive(ZipArchive $archive, $fileName = '') public function _getFromZipArchive(ZipArchive $archive, $fileName = '')
{ {
// Root-relative paths // Root-relative paths
@@ -434,7 +434,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $contents; return $contents;
} }
/** /**
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
* *
@@ -510,7 +510,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$xmlThemeName = $xmlTheme->attributes(); $xmlThemeName = $xmlTheme->attributes();
$xmlTheme = $xmlTheme->children("http://schemas.openxmlformats.org/drawingml/2006/main"); $xmlTheme = $xmlTheme->children("http://schemas.openxmlformats.org/drawingml/2006/main");
$themeName = (string)$xmlThemeName['name']; $themeName = (string)$xmlThemeName['name'];
$colourScheme = $xmlTheme->themeElements->clrScheme->attributes(); $colourScheme = $xmlTheme->themeElements->clrScheme->attributes();
$colourSchemeName = (string)$colourScheme['name']; $colourSchemeName = (string)$colourScheme['name'];
$colourScheme = $xmlTheme->themeElements->clrScheme->children("http://schemas.openxmlformats.org/drawingml/2006/main"); $colourScheme = $xmlTheme->themeElements->clrScheme->children("http://schemas.openxmlformats.org/drawingml/2006/main");
@@ -689,7 +689,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$dxfs = array(); $dxfs = array();
if (!$this->_readDataOnly && $xmlStyles) { if (!$this->_readDataOnly && $xmlStyles) {
// Conditional Styles // Conditional Styles
if ($xmlStyles->dxfs) { if ($xmlStyles->dxfs) {
foreach ($xmlStyles->dxfs->dxf as $dxf) { foreach ($xmlStyles->dxfs->dxf as $dxf) {
$style = new PHPExcel_Style(FALSE, TRUE); $style = new PHPExcel_Style(FALSE, TRUE);
@@ -697,7 +697,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$dxfs[] = $style; $dxfs[] = $style;
} }
} }
// Cell Styles // Cell Styles
if ($xmlStyles->cellStyles) { if ($xmlStyles->cellStyles) {
foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) { foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) {
if (intval($cellStyle['builtinId']) == 0) { if (intval($cellStyle['builtinId']) == 0) {
@@ -751,10 +751,10 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
// Load sheet // Load sheet
$docSheet = $excel->createSheet(); $docSheet = $excel->createSheet();
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet
// references in formula cells... during the load, all formulae should be correct, // references in formula cells... during the load, all formulae should be correct,
// and we're simply bringing the worksheet name in line with the formula, not the // and we're simply bringing the worksheet name in line with the formula, not the
// reverse // reverse
$docSheet->setTitle((string) $eleSheet["name"],false); $docSheet->setTitle((string) $eleSheet["name"],false);
$fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; $fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
$xmlSheet = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$fileWorksheet")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); $xmlSheet = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$fileWorksheet")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
@@ -774,10 +774,10 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$docSheet->getSheetView()->setZoomScaleNormal( intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal']) ); $docSheet->getSheetView()->setZoomScaleNormal( intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal']) );
} }
if (isset($xmlSheet->sheetViews->sheetView['view'])) { if (isset($xmlSheet->sheetViews->sheetView['view'])) {
$docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']); $docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']);
} }
if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) { if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) {
$docSheet->setShowGridLines((string)$xmlSheet->sheetViews->sheetView['showGridLines'] ? true : false); $docSheet->setShowGridLines((string)$xmlSheet->sheetViews->sheetView['showGridLines'] ? true : false);
} }
@@ -855,9 +855,9 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) { if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) {
$docSheet->getDefaultColumnDimension()->setWidth( (float)$xmlSheet->sheetFormatPr['defaultColWidth'] ); $docSheet->getDefaultColumnDimension()->setWidth( (float)$xmlSheet->sheetFormatPr['defaultColWidth'] );
} }
if (isset($xmlSheet->sheetFormatPr['zeroHeight']) && if (isset($xmlSheet->sheetFormatPr['zeroHeight']) &&
((string)$xmlSheet->sheetFormatPr['zeroHeight'] == '1')) { ((string)$xmlSheet->sheetFormatPr['zeroHeight'] == '1')) {
$docSheet->getDefaultRowDimension()->setzeroHeight(true); $docSheet->getDefaultRowDimension()->setzeroHeight(true);
} }
} }
@@ -965,11 +965,11 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} else { } else {
// Formula // Formula
$this->_castToFormula($c,$r,$cellDataType,$value,$calculatedValue,$sharedFormulas,'_castToBool'); $this->_castToFormula($c,$r,$cellDataType,$value,$calculatedValue,$sharedFormulas,'_castToBool');
if (isset($c->f['t'])) { if (isset($c->f['t'])) {
$att = array(); $att = array();
$att = $c->f; $att = $c->f;
$docSheet->getCell($r)->setFormulaAttributes($att); $docSheet->getCell($r)->setFormulaAttributes($att);
} }
// echo '$calculatedValue = '.$calculatedValue.'<br />'; // echo '$calculatedValue = '.$calculatedValue.'<br />';
} }
break; break;
@@ -1086,7 +1086,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
} }
} }
$aKeys = array("sheet", "objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells"); $aKeys = array("sheet", "objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells");
if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
foreach ($aKeys as $key) { foreach ($aKeys as $key) {
@@ -1105,111 +1105,111 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
if ($xmlSheet && $xmlSheet->autoFilter && !$this->_readDataOnly) { if ($xmlSheet && $xmlSheet->autoFilter && !$this->_readDataOnly) {
$autoFilter = $docSheet->getAutoFilter(); $autoFilter = $docSheet->getAutoFilter();
$autoFilter->setRange((string) $xmlSheet->autoFilter["ref"]); $autoFilter->setRange((string) $xmlSheet->autoFilter["ref"]);
foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) { foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) {
$column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]); $column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]);
// Check for standard filters // Check for standard filters
if ($filterColumn->filters) { if ($filterColumn->filters) {
$column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER); $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER);
$filters = $filterColumn->filters; $filters = $filterColumn->filters;
if ((isset($filters["blank"])) && ($filters["blank"] == 1)) { if ((isset($filters["blank"])) && ($filters["blank"] == 1)) {
$column->createRule()->setRule( $column->createRule()->setRule(
NULL, // Operator is undefined, but always treated as EQUAL NULL, // Operator is undefined, but always treated as EQUAL
'' ''
) )
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER); ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
} }
// Standard filters are always an OR join, so no join rule needs to be set // Standard filters are always an OR join, so no join rule needs to be set
// Entries can be either filter elements // Entries can be either filter elements
foreach ($filters->filter as $filterRule) { foreach ($filters->filter as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
NULL, // Operator is undefined, but always treated as EQUAL NULL, // Operator is undefined, but always treated as EQUAL
(string) $filterRule["val"] (string) $filterRule["val"]
) )
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER); ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
} }
// Or Date Group elements // Or Date Group elements
foreach ($filters->dateGroupItem as $dateGroupItem) { foreach ($filters->dateGroupItem as $dateGroupItem) {
$column->createRule()->setRule( $column->createRule()->setRule(
NULL, // Operator is undefined, but always treated as EQUAL NULL, // Operator is undefined, but always treated as EQUAL
array( array(
'year' => (string) $dateGroupItem["year"], 'year' => (string) $dateGroupItem["year"],
'month' => (string) $dateGroupItem["month"], 'month' => (string) $dateGroupItem["month"],
'day' => (string) $dateGroupItem["day"], 'day' => (string) $dateGroupItem["day"],
'hour' => (string) $dateGroupItem["hour"], 'hour' => (string) $dateGroupItem["hour"],
'minute' => (string) $dateGroupItem["minute"], 'minute' => (string) $dateGroupItem["minute"],
'second' => (string) $dateGroupItem["second"], 'second' => (string) $dateGroupItem["second"],
), ),
(string) $dateGroupItem["dateTimeGrouping"] (string) $dateGroupItem["dateTimeGrouping"]
) )
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP); ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP);
} }
} }
// Check for custom filters // Check for custom filters
if ($filterColumn->customFilters) { if ($filterColumn->customFilters) {
$column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
$customFilters = $filterColumn->customFilters; $customFilters = $filterColumn->customFilters;
// Custom filters can an AND or an OR join; // Custom filters can an AND or an OR join;
// and there should only ever be one or two entries // and there should only ever be one or two entries
if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) { if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) {
$column->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND); $column->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
} }
foreach ($customFilters->customFilter as $filterRule) { foreach ($customFilters->customFilter as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
(string) $filterRule["operator"], (string) $filterRule["operator"],
(string) $filterRule["val"] (string) $filterRule["val"]
) )
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
} }
} }
// Check for dynamic filters // Check for dynamic filters
if ($filterColumn->dynamicFilter) { if ($filterColumn->dynamicFilter) {
$column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
// We should only ever have one dynamic filter // We should only ever have one dynamic filter
foreach ($filterColumn->dynamicFilter as $filterRule) { foreach ($filterColumn->dynamicFilter as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
NULL, // Operator is undefined, but always treated as EQUAL NULL, // Operator is undefined, but always treated as EQUAL
(string) $filterRule["val"], (string) $filterRule["val"],
(string) $filterRule["type"] (string) $filterRule["type"]
) )
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);
if (isset($filterRule["val"])) { if (isset($filterRule["val"])) {
$column->setAttribute('val',(string) $filterRule["val"]); $column->setAttribute('val',(string) $filterRule["val"]);
} }
if (isset($filterRule["maxVal"])) { if (isset($filterRule["maxVal"])) {
$column->setAttribute('maxVal',(string) $filterRule["maxVal"]); $column->setAttribute('maxVal',(string) $filterRule["maxVal"]);
} }
} }
} }
// Check for dynamic filters // Check for dynamic filters
if ($filterColumn->top10) { if ($filterColumn->top10) {
$column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER);
// We should only ever have one top10 filter // We should only ever have one top10 filter
foreach ($filterColumn->top10 as $filterRule) { foreach ($filterColumn->top10 as $filterRule) {
$column->createRule()->setRule( $column->createRule()->setRule(
(((isset($filterRule["percent"])) && ($filterRule["percent"] == 1)) (((isset($filterRule["percent"])) && ($filterRule["percent"] == 1))
? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT
: PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE
), ),
(string) $filterRule["val"], (string) $filterRule["val"],
(((isset($filterRule["top"])) && ($filterRule["top"] == 1)) (((isset($filterRule["top"])) && ($filterRule["top"] == 1))
? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP
: PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM
) )
) )
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER);
} }
} }
} }
} }
if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->_readDataOnly) { if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->_readDataOnly) {
foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) { foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) {
$mergeRef = (string) $mergeCell["ref"]; $mergeRef = (string) $mergeCell["ref"];
if (strpos($mergeRef,':') !== FALSE) { if (strpos($mergeRef,':') !== FALSE) {
$docSheet->mergeCells((string) $mergeCell["ref"]); $docSheet->mergeCells((string) $mergeCell["ref"]);
} }
} }
} }
@@ -1534,12 +1534,12 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") { if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
$images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]); $images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
} elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") { } elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") {
if ($this->_includeCharts) { if ($this->_includeCharts) {
$charts[self::dir_add($fileDrawing, $ele["Target"])] = array('id' => (string) $ele["Id"], $charts[self::dir_add($fileDrawing, $ele["Target"])] = array('id' => (string) $ele["Id"],
'sheet' => $docSheet->getTitle() 'sheet' => $docSheet->getTitle()
); );
} }
} }
} }
} }
$xmlDrawing = simplexml_load_string($this->_getFromZipArchive($zip, $fileDrawing))->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); $xmlDrawing = simplexml_load_string($this->_getFromZipArchive($zip, $fileDrawing))->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
@@ -1575,7 +1575,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
$objDrawing->setWorksheet($docSheet); $objDrawing->setWorksheet($docSheet);
} else { } else {
// ? Can charts be positioned with a oneCellAnchor ? // ? Can charts be positioned with a oneCellAnchor ?
$coordinates = PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); $coordinates = PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1);
$offsetX = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff); $offsetX = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff);
$offsetY = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff); $offsetY = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
@@ -1616,7 +1616,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); $shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
} }
$objDrawing->setWorksheet($docSheet); $objDrawing->setWorksheet($docSheet);
} elseif(($this->_includeCharts) && ($twoCellAnchor->graphicFrame)) { } elseif(($this->_includeCharts) && ($twoCellAnchor->graphicFrame)) {
$fromCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); $fromCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1);
$fromOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff); $fromOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff);
$fromOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff); $fromOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
@@ -1636,7 +1636,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
'toOffsetY' => $toOffsetY, 'toOffsetY' => $toOffsetY,
'worksheetTitle' => $docSheet->getTitle() 'worksheetTitle' => $docSheet->getTitle()
); );
} }
} }
} }
@@ -1666,10 +1666,10 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
// Switch on type // Switch on type
switch ((string)$definedName['name']) { switch ((string)$definedName['name']) {
case '_xlnm._FilterDatabase': case '_xlnm._FilterDatabase':
if ((string)$definedName['hidden'] !== '1') { if ((string)$definedName['hidden'] !== '1') {
$docSheet->getAutoFilter()->setRange($extractedRange); $docSheet->getAutoFilter()->setRange($extractedRange);
} }
break; break;
case '_xlnm.Print_Titles': case '_xlnm.Print_Titles':
@@ -1805,7 +1805,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
foreach ($contentTypes->Override as $contentType) { foreach ($contentTypes->Override as $contentType) {
switch ($contentType["ContentType"]) { switch ($contentType["ContentType"]) {
case "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": case "application/vnd.openxmlformats-officedocument.drawingml.chart+xml":
if ($this->_includeCharts) { if ($this->_includeCharts) {
$chartEntryRef = ltrim($contentType['PartName'],'/'); $chartEntryRef = ltrim($contentType['PartName'],'/');
$chartElements = simplexml_load_string($this->_getFromZipArchive($zip, $chartEntryRef)); $chartElements = simplexml_load_string($this->_getFromZipArchive($zip, $chartEntryRef));
$objChart = PHPExcel_Reader_Excel2007_Chart::readChart($chartElements,basename($chartEntryRef,'.xml')); $objChart = PHPExcel_Reader_Excel2007_Chart::readChart($chartElements,basename($chartEntryRef,'.xml'));
@@ -1818,7 +1818,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
// echo 'Position Ref ',$chartPositionRef,'<br />'; // echo 'Position Ref ',$chartPositionRef,'<br />';
if (isset($chartDetails[$chartPositionRef])) { if (isset($chartDetails[$chartPositionRef])) {
// var_dump($chartDetails[$chartPositionRef]); // var_dump($chartDetails[$chartPositionRef]);
$excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart); $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart);
$objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet'])); $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet']));
$objChart->setTopLeftPosition( $chartDetails[$chartPositionRef]['fromCoordinate'], $objChart->setTopLeftPosition( $chartDetails[$chartPositionRef]['fromCoordinate'],
@@ -1830,7 +1830,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
$chartDetails[$chartPositionRef]['toOffsetY'] $chartDetails[$chartPositionRef]['toOffsetY']
); );
} }
} }
} }
} }
} }
@@ -1840,7 +1840,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $excel; return $excel;
} }
private static function _readColor($color, $background=FALSE) { private static function _readColor($color, $background=FALSE) {
if (isset($color["rgb"])) { if (isset($color["rgb"])) {
@@ -1864,16 +1864,16 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return 'FF000000'; return 'FF000000';
} }
private static function _readStyle($docStyle, $style) { private static function _readStyle($docStyle, $style) {
// format code // format code
// if (isset($style->numFmt)) { // if (isset($style->numFmt)) {
// if (isset($style->numFmt['formatCode'])) { // if (isset($style->numFmt['formatCode'])) {
// $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']); // $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']);
// } else { // } else {
$docStyle->getNumberFormat()->setFormatCode($style->numFmt); $docStyle->getNumberFormat()->setFormatCode($style->numFmt);
// } // }
// } // }
// font // font
if (isset($style->font)) { if (isset($style->font)) {
@@ -1911,7 +1911,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
if (isset($style->fill)) { if (isset($style->fill)) {
if ($style->fill->gradientFill) { if ($style->fill->gradientFill) {
$gradientFill = $style->fill->gradientFill[0]; $gradientFill = $style->fill->gradientFill[0];
if(!empty($gradientFill["type"])) { if(!empty($gradientFill["type"])) {
$docStyle->getFill()->setFillType((string) $gradientFill["type"]); $docStyle->getFill()->setFillType((string) $gradientFill["type"]);
} }
$docStyle->getFill()->setRotation(floatval($gradientFill["degree"])); $docStyle->getFill()->setRotation(floatval($gradientFill["degree"]));
@@ -1995,7 +1995,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
} }
} }
private static function _readBorder($docBorder, $eleBorder) { private static function _readBorder($docBorder, $eleBorder) {
if (isset($eleBorder["style"])) { if (isset($eleBorder["style"])) {
@@ -2006,7 +2006,7 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
} }
} }
private function _parseRichText($is = null) { private function _parseRichText($is = null) {
$value = new PHPExcel_RichText(); $value = new PHPExcel_RichText();
@@ -2069,17 +2069,17 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader
return $value; return $value;
} }
private static function array_item($array, $key = 0) { private static function array_item($array, $key = 0) {
return (isset($array[$key]) ? $array[$key] : null); return (isset($array[$key]) ? $array[$key] : null);
} }
private static function dir_add($base, $add) { private static function dir_add($base, $add) {
return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add");
} }
private static function toCSSArray($style) { private static function toCSSArray($style) {
$style = str_replace(array("\r","\n"), "", $style); $style = str_replace(array("\r","\n"), "", $style);

File diff suppressed because it is too large Load Diff

View File

@@ -78,13 +78,13 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
if (is_resource($filename)) { if (is_resource($filename)) {
$this->_FILEH_ = $filename; $this->_FILEH_ = $filename;
} else if ($filename == '-' || $filename == '') { } else if ($filename == '-' || $filename == '') {
if ($this->_tmp_dir === NULL) if ($this->_tmp_dir === NULL)
$this->_tmp_dir = PHPExcel_Shared_File::sys_get_temp_dir(); $this->_tmp_dir = PHPExcel_Shared_File::sys_get_temp_dir();
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root"); $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
$this->_FILEH_ = fopen($this->_tmp_filename,"w+b"); $this->_FILEH_ = fopen($this->_tmp_filename,"w+b");
if ($this->_FILEH_ == false) { if ($this->_FILEH_ == false) {
throw new Exception("Can't create temporary file."); throw new Exception("Can't create temporary file.");
} }
} else { } else {
$this->_FILEH_ = fopen($filename, "wb"); $this->_FILEH_ = fopen($filename, "wb");
@@ -94,7 +94,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
} }
// Make an array of PPS's (for Save) // Make an array of PPS's (for Save)
$aList = array(); $aList = array();
PHPExcel_Shared_OLE_PPS::_savePpsSetPnt($aList, array($this)); PHPExcel_Shared_OLE_PPS::_savePpsSetPnt($aList, array($this));
// calculate values for header // calculate values for header
list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo); list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo);
// Save Header // Save Header

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,421 +1,421 @@
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// PclZip 2.8.2 - readme.txt // PclZip 2.8.2 - readme.txt
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// License GNU/LGPL - August 2009 // License GNU/LGPL - August 2009
// Vincent Blavet - vincent@phpconcept.net // Vincent Blavet - vincent@phpconcept.net
// http://www.phpconcept.net // http://www.phpconcept.net
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $ // $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
0 - Sommaire 0 - Sommaire
============ ============
1 - Introduction 1 - Introduction
2 - What's new 2 - What's new
3 - Corrected bugs 3 - Corrected bugs
4 - Known bugs or limitations 4 - Known bugs or limitations
5 - License 5 - License
6 - Warning 6 - Warning
7 - Documentation 7 - Documentation
8 - Author 8 - Author
9 - Contribute 9 - Contribute
1 - Introduction 1 - Introduction
================ ================
PclZip is a library that allow you to manage a Zip archive. PclZip is a library that allow you to manage a Zip archive.
Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
2 - What's new 2 - What's new
============== ==============
Version 2.8.2 : Version 2.8.2 :
- PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with - PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with
extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string
can also be modified in the post-extract call back. can also be modified in the post-extract call back.
**Bugs correction : **Bugs correction :
- PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly - PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly
- Remove use of eval() and do direct call to callback functions - Remove use of eval() and do direct call to callback functions
- Correct support of 64bits systems (Thanks to WordPress team) - Correct support of 64bits systems (Thanks to WordPress team)
Version 2.8.1 : Version 2.8.1 :
- Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is - Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is
deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will
automatically replace it by PCLZIP_OPT_BY_PREG. automatically replace it by PCLZIP_OPT_BY_PREG.
Version 2.8 : Version 2.8 :
- Improve extraction of zip archive for large files by using temporary files - Improve extraction of zip archive for large files by using temporary files
This feature is working like the one defined in r2.7. This feature is working like the one defined in r2.7.
Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF, Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF,
PCLZIP_OPT_TEMP_FILE_THRESHOLD PCLZIP_OPT_TEMP_FILE_THRESHOLD
- Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto - Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto
sense of temporary file use. sense of temporary file use.
- Bug correction : Reduce filepath in returned file list to remove ennoying - Bug correction : Reduce filepath in returned file list to remove ennoying
'.//' preambule in file path. './/' preambule in file path.
Version 2.7 : Version 2.7 :
- Improve creation of zip archive for large files : - Improve creation of zip archive for large files :
PclZip will now autosense the configured memory and use temporary files PclZip will now autosense the configured memory and use temporary files
when large file is suspected. when large file is suspected.
This feature can also ne triggered by manual options in create() and add() This feature can also ne triggered by manual options in create() and add()
methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files, methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files,
'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic, 'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic,
'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size
threshold to use temporary files. threshold to use temporary files.
Using "temporary files" rather than "memory" might take more time, but Using "temporary files" rather than "memory" might take more time, but
might give the ability to zip very large files : might give the ability to zip very large files :
Tested on my win laptop with a 88Mo file : Tested on my win laptop with a 88Mo file :
Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo) Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo)
Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo) Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo)
- Replace use of mktime() by time() to limit the E_STRICT error messages. - Replace use of mktime() by time() to limit the E_STRICT error messages.
- Bug correction : When adding files with full windows path (drive letter) - Bug correction : When adding files with full windows path (drive letter)
PclZip is now working. Before, if the drive letter is not the default PclZip is now working. Before, if the drive letter is not the default
path, PclZip was not able to add the file. path, PclZip was not able to add the file.
Version 2.6 : Version 2.6 :
- Code optimisation - Code optimisation
- New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
add a comment for a specific file. (Don't really know if this is usefull) add a comment for a specific file. (Don't really know if this is usefull)
- New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string
as a file. as a file.
- New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
a file. a file.
- Correct a bug. Files archived with a timestamp with 0h0m0s were extracted - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
with current time with current time
- Add CRC value in the informations returned back for each file after an - Add CRC value in the informations returned back for each file after an
action. action.
- Add missing closedir() statement. - Add missing closedir() statement.
- When adding a folder, and removing the path of this folder, files were - When adding a folder, and removing the path of this folder, files were
incorrectly added with a '/' at the beginning. Which means files are incorrectly added with a '/' at the beginning. Which means files are
related to root in unix systems. Corrected. related to root in unix systems. Corrected.
- Add conditional if before constant definition. This will allow users - Add conditional if before constant definition. This will allow users
to redefine constants without changing the file, and then improve to redefine constants without changing the file, and then improve
upgrade of pclzip code for new versions. upgrade of pclzip code for new versions.
Version 2.5 : Version 2.5 :
- Introduce the ability to add file/folder with individual properties (file descriptor). - Introduce the ability to add file/folder with individual properties (file descriptor).
This gives for example the ability to change the filename of a zipped file. This gives for example the ability to change the filename of a zipped file.
. Able to add files individually . Able to add files individually
. Able to change full name . Able to change full name
. Able to change short name . Able to change short name
. Compatible with global options . Compatible with global options
- New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
- New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
- Add a security control feature. PclZip can extract any file in any folder - Add a security control feature. PclZip can extract any file in any folder
of a system. People may use this to upload a zip file and try to override of a system. People may use this to upload a zip file and try to override
a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
ability to forgive any directory transversal behavior. ability to forgive any directory transversal behavior.
- New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
- New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
- Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
by current path (getcwd()) by current path (getcwd())
Version 2.4 : Version 2.4 :
- Code improvment : try to speed up the code by removing unusefull call to pack() - Code improvment : try to speed up the code by removing unusefull call to pack()
- Correct bug in delete() : delete() should be called with no argument. This was not - Correct bug in delete() : delete() should be called with no argument. This was not
the case in 2.3. This is corrected in 2.4. the case in 2.3. This is corrected in 2.4.
- Correct a bug in path_inclusion function. When the path has several '../../', the - Correct a bug in path_inclusion function. When the path has several '../../', the
result was bad. result was bad.
- Add a check for magic_quotes_runtime configuration. If enabled, PclZip will - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will
disable it while working and det it back to its original value. disable it while working and det it back to its original value.
This resolve a lots of bad formated archive errors. This resolve a lots of bad formated archive errors.
- Bug correction : PclZip now correctly unzip file in some specific situation, - Bug correction : PclZip now correctly unzip file in some specific situation,
when compressed content has same size as uncompressed content. when compressed content has same size as uncompressed content.
- Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH',
directories are not any more created. directories are not any more created.
- Code improvment : correct unclosed opendir(), better handling of . and .. in - Code improvment : correct unclosed opendir(), better handling of . and .. in
loops. loops.
Version 2.3 : Version 2.3 :
- Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
give the same result in PHP4 and PHP5 .... give the same result in PHP4 and PHP5 ....
Version 2.2 : Version 2.2 :
- Try development of PCLZIP_OPT_CRYPT ..... - Try development of PCLZIP_OPT_CRYPT .....
However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers, However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
the result (greater than a long) is not supported by PHP. Even the use of bcmath the result (greater than a long) is not supported by PHP. Even the use of bcmath
functions does not help. I did not find yet a solution ...; functions does not help. I did not find yet a solution ...;
- Add missing '/' at end of directory entries - Add missing '/' at end of directory entries
- Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION. error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
- Corrected : Bad "version need to extract" field in local file header - Corrected : Bad "version need to extract" field in local file header
- Add private method privCheckFileHeaders() in order to check local and central - Add private method privCheckFileHeaders() in order to check local and central
file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
the ability to have a local file header without size, compressed size and crc filled. the ability to have a local file header without size, compressed size and crc filled.
- Add a generic status 'error' for file status - Add a generic status 'error' for file status
- Add control of compression type. PclZip only support deflate compression method. - Add control of compression type. PclZip only support deflate compression method.
Before v2.2, PclZip does not check the compression method used in an archive while Before v2.2, PclZip does not check the compression method used in an archive while
extracting. With v2.2 PclZip returns a new error status for a file using an unsupported extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
compression method. New status is "unsupported_compression". New error code is compression method. New status is "unsupported_compression". New error code is
PCLZIP_ERR_UNSUPPORTED_COMPRESSION. PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
- Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
when errors like 'a folder with same name exists' or 'a newer file exists' or when errors like 'a folder with same name exists' or 'a newer file exists' or
'a write protected file' exists, rather than set a status for the concerning file 'a write protected file' exists, rather than set a status for the concerning file
and resume the extract of the zip. and resume the extract of the zip.
- Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the
replacement of the file, even if a newer version of the file exists. replacement of the file, even if a newer version of the file exists.
Note that today if a file with the same name already exists but is older it will be Note that today if a file with the same name already exists but is older it will be
replaced by the extracted one. replaced by the extracted one.
- Improve PclZipUtilOption() - Improve PclZipUtilOption()
- Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central
directory structure is the last data in the archive. Crypt encryption/decryption of directory structure is the last data in the archive. Crypt encryption/decryption of
zip archive put trailing 0 bytes after decryption. PclZip is now supporting this. zip archive put trailing 0 bytes after decryption. PclZip is now supporting this.
Version 2.1 : Version 2.1 :
- Add the ability to abort the extraction by using a user callback function. - Add the ability to abort the extraction by using a user callback function.
The user can now return the value '2' in its callback which indicates to stop the The user can now return the value '2' in its callback which indicates to stop the
extraction. For a pre call-back extract is stopped before the extration of the current extraction. For a pre call-back extract is stopped before the extration of the current
file. For a post call back, the extraction is stopped after. file. For a post call back, the extraction is stopped after.
- Add the ability to extract a file (or several files) directly in the standard output. - Add the ability to extract a file (or several files) directly in the standard output.
This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract(). This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
- Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT, - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
in the zip archive. in the zip archive.
- When merging two archives, the comments are not any more lost, but merged, with a - When merging two archives, the comments are not any more lost, but merged, with a
blank space separator. blank space separator.
- Corrected bug : Files are not deleted when all files are asked to be deleted. - Corrected bug : Files are not deleted when all files are asked to be deleted.
- Corrected bug : Folders with name '0' made PclZip to abort the create or add feature. - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
Version 2.0 : Version 2.0 :
***** Warning : Some new features may break the backward compatibility for your scripts. ***** Warning : Some new features may break the backward compatibility for your scripts.
Please carefully read the readme file. Please carefully read the readme file.
- Add the ability to delete by Index, name and regular expression. This feature is - Add the ability to delete by Index, name and regular expression. This feature is
performed by the method delete(), which uses the optional parameters performed by the method delete(), which uses the optional parameters
PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG. PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
- Add the ability to extract by regular expression. To extract by regexp you must use the method - Add the ability to extract by regular expression. To extract by regexp you must use the method
extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG
(depending if you want to use ereg() or preg_match() syntax) followed by the (depending if you want to use ereg() or preg_match() syntax) followed by the
regular expression pattern. regular expression pattern.
- Add the ability to extract by index, directly with the extract() method. This is a - Add the ability to extract by index, directly with the extract() method. This is a
code improvment of the extractByIndex() method. code improvment of the extractByIndex() method.
- Add the ability to extract by name. To extract by name you must use the method - Add the ability to extract by name. To extract by name you must use the method
extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
extract or an array of filenames to extract. To extract all a folder, use the folder extract or an array of filenames to extract. To extract all a folder, use the folder
name rather than the filename with a '/' at the end. name rather than the filename with a '/' at the end.
- Add the ability to add files without compression. This is done with a new attribute - Add the ability to add files without compression. This is done with a new attribute
which is PCLZIP_OPT_NO_COMPRESSION. which is PCLZIP_OPT_NO_COMPRESSION.
- Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
in a string without using any file (or temporary file). in a string without using any file (or temporary file).
- Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string. - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
The default separator is now a comma (,) and not any more a blank space. The default separator is now a comma (,) and not any more a blank space.
THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
your script. your script.
- Improve algorythm performance by removing the use of temporary files when adding or - Improve algorythm performance by removing the use of temporary files when adding or
extracting files in an archive. extracting files in an archive.
- Add (correct) detection of empty filename zipping. This can occurs when the removed - Add (correct) detection of empty filename zipping. This can occurs when the removed
path is the same path is the same
as a zipped dir. The dir is not zipped (['status'] = filtered), only its content. as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
- Add better support for windows paths (thanks for help from manus@manusfreedom.com). - Add better support for windows paths (thanks for help from manus@manusfreedom.com).
- Corrected bug : When the archive file already exists with size=0, the add() method - Corrected bug : When the archive file already exists with size=0, the add() method
fails. Corrected in 2.0. fails. Corrected in 2.0.
- Remove the use of OS_WINDOWS constant. Use php_uname() function rather. - Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
- Control the order of index ranges in extract by index feature. - Control the order of index ranges in extract by index feature.
- Change the internal management of folders (better handling of internal flag). - Change the internal management of folders (better handling of internal flag).
Version 1.3 : Version 1.3 :
- Removing the double include check. This is now done by include_once() and require_once() - Removing the double include check. This is now done by include_once() and require_once()
PHP directives. PHP directives.
- Changing the error handling mecanism : Remove the use of an external error library. - Changing the error handling mecanism : Remove the use of an external error library.
The former PclError...() functions are replaced by internal equivalent methods. The former PclError...() functions are replaced by internal equivalent methods.
By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library. By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
Introducing the use of constants for error codes rather than integer values. This will help Introducing the use of constants for error codes rather than integer values. This will help
in futur improvment. in futur improvment.
Introduction of error handling functions like errorCode(), errorName() and errorInfo(). Introduction of error handling functions like errorCode(), errorName() and errorInfo().
- Remove the deprecated use of calling function with arguments passed by reference. - Remove the deprecated use of calling function with arguments passed by reference.
- Add the calling of extract(), extractByIndex(), create() and add() functions - Add the calling of extract(), extractByIndex(), create() and add() functions
with variable options rather than fixed arguments. with variable options rather than fixed arguments.
- Add the ability to remove all the file path while extracting or adding, - Add the ability to remove all the file path while extracting or adding,
without any need to specify the path to remove. without any need to specify the path to remove.
This is available for extract(), extractByIndex(), create() and add() functionS by using This is available for extract(), extractByIndex(), create() and add() functionS by using
the new variable options parameters : the new variable options parameters :
- PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct. - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
- Ability to change the mode of a file after the extraction (chmod()). - Ability to change the mode of a file after the extraction (chmod()).
This is available for extract() and extractByIndex() functionS by using This is available for extract() and extractByIndex() functionS by using
the new variable options parameters. the new variable options parameters.
- PCLZIP_OPT_SET_CHMOD : by setting the value of this option. - PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
- Ability to definition call-back options. These call-back will be called during the adding, - Ability to definition call-back options. These call-back will be called during the adding,
or the extracting of file (extract(), extractByIndex(), create() and add() functions) : or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
- PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
can trigerred the change the filename of the extracted file. The user can triggered the can trigerred the change the filename of the extracted file. The user can triggered the
skip of the extraction. This is adding a 'skipped' status in the file list result value. skip of the extraction. This is adding a 'skipped' status in the file list result value.
- PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file. - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
Nothing can be triggered from that point. Nothing can be triggered from that point.
- PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
can trigerred the change the stored filename of the added file. The user can triggered the can trigerred the change the stored filename of the added file. The user can triggered the
skip of the add. This is adding a 'skipped' status in the file list result value. skip of the add. This is adding a 'skipped' status in the file list result value.
- PCLZIP_CB_POST_ADD : will be called after each add of a file. - PCLZIP_CB_POST_ADD : will be called after each add of a file.
Nothing can be triggered from that point. Nothing can be triggered from that point.
- Two status are added in the file list returned as function result : skipped & filename_too_long - Two status are added in the file list returned as function result : skipped & filename_too_long
'skipped' is used when a call-back function ask for skipping the file. 'skipped' is used when a call-back function ask for skipping the file.
'filename_too_long' is used while adding a file with a too long filename to archive (the file is 'filename_too_long' is used while adding a file with a too long filename to archive (the file is
not added) not added)
- Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
a directory. a directory.
- Add a check of the presence of the archive file before some actions (like list, ...) - Add a check of the presence of the archive file before some actions (like list, ...)
- Add the initialisation of field "index" in header array. This means that by - Add the initialisation of field "index" in header array. This means that by
default index will be -1 when not explicitly set by the methods. default index will be -1 when not explicitly set by the methods.
Version 1.2 : Version 1.2 :
- Adding a duplicate function. - Adding a duplicate function.
- Adding a merge function. The merge function is a "quick merge" function, - Adding a merge function. The merge function is a "quick merge" function,
it just append the content of an archive at the end of the first one. There it just append the content of an archive at the end of the first one. There
is no check for duplicate files or more recent files. is no check for duplicate files or more recent files.
- Improve the search of the central directory end. - Improve the search of the central directory end.
Version 1.1.2 : Version 1.1.2 :
- Changing the license of PclZip. PclZip is now released under the GNU / LGPL license - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
(see License section). (see License section).
- Adding the optional support of a static temporary directory. You will need to configure - Adding the optional support of a static temporary directory. You will need to configure
the constant PCLZIP_TEMPORARY_DIR if you want to use this feature. the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
- Improving the rename() function. In some cases rename() does not work (different - Improving the rename() function. In some cases rename() does not work (different
Filesystems), so it will be replaced by a copy() + unlink() functions. Filesystems), so it will be replaced by a copy() + unlink() functions.
Version 1.1.1 : Version 1.1.1 :
- Maintenance release, no new feature. - Maintenance release, no new feature.
Version 1.1 : Version 1.1 :
- New method Add() : adding files in the archive - New method Add() : adding files in the archive
- New method ExtractByIndex() : partial extract of the archive, files are identified by - New method ExtractByIndex() : partial extract of the archive, files are identified by
their index in the archive their index in the archive
- New method DeleteByIndex() : delete some files/folder entries from the archive, - New method DeleteByIndex() : delete some files/folder entries from the archive,
files are identified by their index in the archive. files are identified by their index in the archive.
- Adding a test of the zlib extension presence. If not present abort the script. - Adding a test of the zlib extension presence. If not present abort the script.
Version 1.0.1 : Version 1.0.1 :
- No new feature - No new feature
3 - Corrected bugs 3 - Corrected bugs
================== ==================
Corrected in Version 2.0 : Corrected in Version 2.0 :
- Corrected : During an extraction, if a call-back fucntion is used and try to skip - Corrected : During an extraction, if a call-back fucntion is used and try to skip
a file, all the extraction process is stopped. a file, all the extraction process is stopped.
Corrected in Version 1.3 : Corrected in Version 1.3 :
- Corrected : Support of static synopsis for method extract() is broken. - Corrected : Support of static synopsis for method extract() is broken.
- Corrected : invalid size of archive content field (0xFF) should be (0xFFFF). - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
- Corrected : When an extract is done with a remove_path parameter, the entry for - Corrected : When an extract is done with a remove_path parameter, the entry for
the directory with exactly the same path is not skipped/filtered. the directory with exactly the same path is not skipped/filtered.
- Corrected : extractByIndex() and deleteByIndex() were not managing index in the - Corrected : extractByIndex() and deleteByIndex() were not managing index in the
right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
is due to a sort of the index resulting table that puts 11 before 3-5 (sort on is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
string and not interger). The sort is temporarilly removed, this means that string and not interger). The sort is temporarilly removed, this means that
you must provide a sorted list of index ranges. you must provide a sorted list of index ranges.
Corrected in Version 1.2 : Corrected in Version 1.2 :
- Nothing. - Nothing.
Corrected in Version 1.1.2 : Corrected in Version 1.1.2 :
- Corrected : Winzip is unable to delete or add new files in a PclZip created archives. - Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
Corrected in Version 1.1.1 : Corrected in Version 1.1.1 :
- Corrected : When archived file is not compressed (0% compression), the - Corrected : When archived file is not compressed (0% compression), the
extract method fails. extract method fails.
Corrected in Version 1.1 : Corrected in Version 1.1 :
- Corrected : Adding a complete tree of folder may result in a bad archive - Corrected : Adding a complete tree of folder may result in a bad archive
creation. creation.
Corrected in Version 1.0.1 : Corrected in Version 1.0.1 :
- Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
4 - Known bugs or limitations 4 - Known bugs or limitations
============================= =============================
Please publish bugs reports in SourceForge : Please publish bugs reports in SourceForge :
http://sourceforge.net/tracker/?group_id=40254&atid=427564 http://sourceforge.net/tracker/?group_id=40254&atid=427564
In Version 2.x : In Version 2.x :
- PclZip does only support file uncompressed or compressed with deflate (compression method 8) - PclZip does only support file uncompressed or compressed with deflate (compression method 8)
- PclZip does not support password protected zip archive - PclZip does not support password protected zip archive
- Some concern were seen when changing mtime of a file while archiving. - Some concern were seen when changing mtime of a file while archiving.
Seems to be linked to Daylight Saving Time (PclTest_changing_mtime). Seems to be linked to Daylight Saving Time (PclTest_changing_mtime).
In Version 1.2 : In Version 1.2 :
- merge() methods does not check for duplicate files or last date of modifications. - merge() methods does not check for duplicate files or last date of modifications.
In Version 1.1 : In Version 1.1 :
- Limitation : Using 'extract' fields in the file header in the zip archive is not supported. - Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
- WinZip is unable to delete a single file in a PclZip created archive. It is also unable to - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
add a file in a PclZip created archive. (Corrected in v.1.2) add a file in a PclZip created archive. (Corrected in v.1.2)
In Version 1.0.1 : In Version 1.0.1 :
- Adding a complete tree of folder may result in a bad archive - Adding a complete tree of folder may result in a bad archive
creation. (Corrected in V.1.1). creation. (Corrected in V.1.1).
- Path given to methods must be in the unix format (/) and not the Windows format (\). - Path given to methods must be in the unix format (/) and not the Windows format (\).
Workaround : Use only / directory separators. Workaround : Use only / directory separators.
- PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
added suffix. Files with these names may already exist and may be overwritten. added suffix. Files with these names may already exist and may be overwritten.
Workaround : none. Workaround : none.
- PclZip does not check if the zlib extension is present. If it is absent, the zip - PclZip does not check if the zlib extension is present. If it is absent, the zip
file is not created and the lib abort without warning. file is not created and the lib abort without warning.
Workaround : enable the zlib extension on the php install Workaround : enable the zlib extension on the php install
In Version 1.0 : In Version 1.0 :
- Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
(Corrected in v.1.0.1) (Corrected in v.1.0.1)
- Limitation : Multi-disk zip archive are not supported. - Limitation : Multi-disk zip archive are not supported.
5 - License 5 - License
=========== ===========
Since version 1.1.2, PclZip Library is released under GNU/LGPL license. Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
This library is free, so you can use it at no cost. This library is free, so you can use it at no cost.
HOWEVER, if you release a script, an application, a library or any kind of HOWEVER, if you release a script, an application, a library or any kind of
code using PclZip library (or a part of it), YOU MUST : code using PclZip library (or a part of it), YOU MUST :
- Indicate in the documentation (or a readme file), that your work - Indicate in the documentation (or a readme file), that your work
uses PclZip Library, and make a reference to the author and the web site uses PclZip Library, and make a reference to the author and the web site
http://www.phpconcept.net http://www.phpconcept.net
- Gives the ability to the final user to update the PclZip libary. - Gives the ability to the final user to update the PclZip libary.
I will also appreciate that you send me a mail (vincent@phpconcept.net), just to I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
be aware that someone is using PclZip. be aware that someone is using PclZip.
For more information about GNU/LGPL license : http://www.gnu.org For more information about GNU/LGPL license : http://www.gnu.org
6 - Warning 6 - Warning
================= =================
This library and the associated files are non commercial, non professional work. This library and the associated files are non commercial, non professional work.
It should not have unexpected results. However if any damage is caused by this software It should not have unexpected results. However if any damage is caused by this software
the author can not be responsible. the author can not be responsible.
The use of this software is at the risk of the user. The use of this software is at the risk of the user.
7 - Documentation 7 - Documentation
================= =================
PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php
A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/ A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/
8 - Author 8 - Author
========== ==========
This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time. This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
9 - Contribute 9 - Contribute
============== ==============
If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net. If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
If you can help in financing PhpConcept hosting service, please go to If you can help in financing PhpConcept hosting service, please go to
http://www.phpconcept.net/soutien.php http://www.phpconcept.net/soutien.php

View File

@@ -1,408 +1,408 @@
## ##
## Add-in and Automation functions Funções Suplemento e Automação ## 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 GETPIVOTDATA = INFODADOSTABELADINÂMICA ## Retorna os dados armazenados em um relatório de tabela dinâmica
## ##
## Cube functions Funções de Cubo ## 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. 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. 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. 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. 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. 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. CUBESETCOUNT = CONTAGEMCONJUNTOCUBO ## Retorna o número de itens em um conjunto.
CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo. CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo.
## ##
## Database functions Funções de banco de dados ## Database functions Funções de banco de dados
## ##
DAVERAGE = BDMÉDIA ## Retorna a média das entradas selecionadas de um 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 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 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 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 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 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 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 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 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 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 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 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 and time functions Funções de data e hora
## ##
DATE = DATA ## Retorna o número de série de uma data específica 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 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 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 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 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 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 HOUR = HORA ## Converte um número de série em uma hora
MINUTE = MINUTO ## Converte um número de série em um minuto 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 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 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 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 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 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 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 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 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 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 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 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 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 ## Engineering functions Funções de engenharia
## ##
BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada
BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x) BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x)
BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada
BESSELY = BESSELY ## Retorna a função de Bessel Yn(x) BESSELY = BESSELY ## Retorna a função de Bessel Yn(x)
BIN2DEC = BIN2DEC ## Converte um número binário em decimal BIN2DEC = BIN2DEC ## Converte um número binário em decimal
BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal
BIN2OCT = BIN2OCT ## Converte um número binário em octal BIN2OCT = BIN2OCT ## Converte um número binário em octal
COMPLEX = COMPLEX ## Converte coeficientes reais e imaginários e um número complexo 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 CONVERT = CONVERTER ## Converte um número de um sistema de medida para outro
DEC2BIN = DECABIN ## Converte um número decimal em binário DEC2BIN = DECABIN ## Converte um número decimal em binário
DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
DEC2OCT = DECAOCT ## Converte um número decimal em octal DEC2OCT = DECAOCT ## Converte um número decimal em octal
DELTA = DELTA ## Testa se dois valores são iguais DELTA = DELTA ## Testa se dois valores são iguais
ERF = FUNERRO ## Retorna a função de erro ERF = FUNERRO ## Retorna a função de erro
ERFC = FUNERROCOMPL ## Retorna a função de erro complementar ERFC = FUNERROCOMPL ## Retorna a função de erro complementar
GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
IMABS = IMABS ## Retorna o valor absoluto (módulo) de um número complexo 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 IMAGINARY = IMAGINÁRIO ## Retorna o coeficiente imaginário de um número complexo
IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos
IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo
IMCOS = IMCOS ## Retorna o cosseno 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 IMDIV = IMDIV ## Retorna o quociente de dois números complexos
IMEXP = IMEXP ## Retorna o exponencial de um número complexo IMEXP = IMEXP ## Retorna o exponencial de um número complexo
IMLN = IMLN ## Retorna o logaritmo natural 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 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 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 IMPOWER = IMPOT ## Retorna um número complexo elevado a uma potência inteira
IMPRODUCT = IMPROD ## Retorna o produto de números complexos IMPRODUCT = IMPROD ## Retorna o produto de números complexos
IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo
IMSIN = IMSENO ## Retorna o seno 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 IMSQRT = IMRAIZ ## Retorna a raiz quadrada de um número complexo
IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos
IMSUM = IMSOMA ## Retorna a soma de números complexos IMSUM = IMSOMA ## Retorna a soma de números complexos
OCT2BIN = OCTABIN ## Converte um número octal em binário OCT2BIN = OCTABIN ## Converte um número octal em binário
OCT2DEC = OCTADEC ## Converte um número octal em decimal OCT2DEC = OCTADEC ## Converte um número octal em decimal
OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
## ##
## Financial functions Funções financeiras ## 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 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 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 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 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 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 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 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 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 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 COUPPCD = CUPDATAANT ## Retorna a data de cupom anterior à data de quitação
CUMIPMT = PGTOJURACUM ## Retorna os juros acumulados pagos entre dois períodos 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 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 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ê 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 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 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 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 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 EFFECT = EFETIVA ## Retorna a taxa de juros anual efetiva
FV = VF ## Retorna o valor futuro de um investimento 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 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 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 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 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 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 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 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 NOMINAL = NOMINAL ## Retorna a taxa de juros nominal anual
NPER = NPER ## Retorna o número de períodos de um investimento 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 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 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 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 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 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 PMT = PGTO ## Retorna o pagamento periódico de uma anuidade
PPMT = PPGTO ## Retorna o pagamento de capital para determinado período de investimento 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 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 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 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 PV = VP ## Retorna o valor presente de um investimento
RATE = TAXA ## Retorna a taxa de juros por período de uma anuidade 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 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 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 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 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 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 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 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 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 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 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 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 YIELDMAT = LUCROVENC ## Retorna o lucro anual de um título que paga juros no vencimento
## ##
## Information functions Funções de informação ## 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 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 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 INFO = INFORMAÇÃO ## Retorna informações sobre o ambiente operacional atual
ISBLANK = ÉCÉL.VAZIA ## Retorna VERDADEIRO se o valor for vazio 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 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 ISERROR = ÉERROS ## Retorna VERDADEIRO se o valor for um valor de erro
ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par
ISLOGICAL = ÉLÓGICO ## Retorna VERDADEIRO se o valor for um valor lógico 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 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 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 ISNUMBER = ÉNÚM ## Retorna VERDADEIRO se o valor for um número
ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar
ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência
ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto
N = N ## Retorna um valor convertido em um número N = N ## Retorna um valor convertido em um número
NA = NÃO.DISP ## Retorna o valor de erro #N/D 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 TYPE = TIPO ## Retorna um número indicando o tipo de dados de um valor
## ##
## Logical functions Funções lógicas ## Logical functions Funções lógicas
## ##
AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS
FALSE = FALSO ## Retorna o valor lógico FALSO FALSE = FALSO ## Retorna o valor lógico FALSO
IF = SE ## Especifica um teste lógico a ser executado 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 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 NOT = NÃO ## Inverte o valor lógico do argumento
OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO
TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO
## ##
## Lookup and reference functions Funções de pesquisa e referência ## 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 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 AREAS = ÁREAS ## Retorna o número de áreas em uma referência
CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores
COLUMN = COL ## Retorna o número da coluna de uma referência COLUMN = COL ## Retorna o número da coluna de uma referência
COLUMNS = COLS ## Retorna o número de colunas em 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 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 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 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 INDIRECT = INDIRETO ## Retorna uma referência indicada por um valor de texto
LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz
MATCH = CORRESP ## Procura valores em uma referência 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 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 ROW = LIN ## Retorna o número da linha de uma referência
ROWS = LINS ## Retorna o número de linhas em 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).) 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 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 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 ## Math and trigonometry functions Funções matemáticas e trigonométricas
## ##
ABS = ABS ## Retorna o valor absoluto de um número ABS = ABS ## Retorna o valor absoluto de um número
ACOS = ACOS ## Retorna o arco cosseno 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 ACOSH = ACOSH ## Retorna o cosseno hiperbólico inverso de um número
ASIN = ASEN ## Retorna o arco seno 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 ASINH = ASENH ## Retorna o seno hiperbólico inverso de um número
ATAN = ATAN ## Retorna o arco tangente 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 ATAN2 = ATAN2 ## Retorna o arco tangente das coordenadas x e y especificadas
ATANH = ATANH ## Retorna a tangente hiperbólica inversa de um número 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 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 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 COS = COS ## Retorna o cosseno de um número
COSH = COSH ## Retorna o cosseno hiperbólico de um número COSH = COSH ## Retorna o cosseno hiperbólico de um número
DEGREES = GRAUS ## Converte radianos em graus DEGREES = GRAUS ## Converte radianos em graus
EVEN = PAR ## Arredonda um número para cima até o inteiro par mais próximo 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 EXP = EXP ## Retorna e elevado à potência de um número especificado
FACT = FATORIAL ## Retorna o fatorial de um número FACT = FATORIAL ## Retorna o fatorial de um número
FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número
FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero
GCD = MDC ## Retorna o máximo divisor comum GCD = MDC ## Retorna o máximo divisor comum
INT = INT ## Arredonda um número para baixo até o número inteiro mais próximo 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 LCM = MMC ## Retorna o mínimo múltiplo comum
LN = LN ## Retorna o logaritmo natural de um número LN = LN ## Retorna o logaritmo natural de um número
LOG = LOG ## Retorna o logaritmo de um número de uma base especificada 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 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 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 MINVERSE = MATRIZ.INVERSO ## Retorna a matriz inversa de uma matriz
MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes
MOD = RESTO ## Retorna o resto da divisão MOD = RESTO ## Retorna o resto da divisão
MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado
MULTINOMIAL = MULTINOMIAL ## Retorna o multinomial de um conjunto de números 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 ODD = ÍMPAR ## Arredonda um número para cima até o inteiro ímpar mais próximo
PI = PI ## Retorna o valor de Pi PI = PI ## Retorna o valor de Pi
POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência
PRODUCT = MULT ## Multiplica seus argumentos PRODUCT = MULT ## Multiplica seus argumentos
QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão
RADIANS = RADIANOS ## Converte graus em radianos RADIANS = RADIANOS ## Converte graus em radianos
RAND = ALEATÓRIO ## Retorna um número aleatório entre 0 e 1 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 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 ROMAN = ROMANO ## Converte um algarismo arábico em romano, como texto
ROUND = ARRED ## Arredonda um número até uma quantidade especificada de dígitos 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 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 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 SERIESSUM = SOMASEQÜÊNCIA ## Retorna a soma de uma série polinomial baseada na fórmula
SIGN = SINAL ## Retorna o sinal de um número SIGN = SINAL ## Retorna o sinal de um número
SIN = SEN ## Retorna o seno de um ângulo dado SIN = SEN ## Retorna o seno de um ângulo dado
SINH = SENH ## Retorna o seno hiperbólico de um número SINH = SENH ## Retorna o seno hiperbólico de um número
SQRT = RAIZ ## Retorna uma raiz quadrada positiva SQRT = RAIZ ## Retorna uma raiz quadrada positiva
SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi) SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi)
SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados
SUM = SOMA ## Soma seus argumentos SUM = SOMA ## Soma seus argumentos
SUMIF = SOMASE ## Adiciona as células especificadas por um determinado critério 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 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 SUMPRODUCT = SOMARPRODUTO ## Retorna a soma dos produtos de componentes correspondentes de matrizes
SUMSQ = SOMAQUAD ## Retorna a soma dos quadrados dos argumentos 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 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 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 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 TAN = TAN ## Retorna a tangente de um número
TANH = TANH ## Retorna a tangente hiperbólica de um número TANH = TANH ## Retorna a tangente hiperbólica de um número
TRUNC = TRUNCAR ## Trunca um número para um inteiro TRUNC = TRUNCAR ## Trunca um número para um inteiro
## ##
## Statistical functions Funções estatísticas ## 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 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 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 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 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. 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 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 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 BINOMDIST = DISTRBINOM ## Retorna a probabilidade de distribuição binomial do termo individual
CHIDIST = DIST.QUI ## Retorna a probabilidade unicaudal da distribuição qui-quadrada 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 CHIINV = INV.QUI ## Retorna o inverso da probabilidade uni-caudal da distribuição qui-quadrada
CHITEST = TESTE.QUI ## Retorna o teste para independência 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 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 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 COUNT = CONT.NÚM ## Calcula quantos números há na lista de argumentos
COUNTA = CONT.VALORES ## Calcula quantos valores 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 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 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 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 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 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 DEVSQ = DESVQ ## Retorna a soma dos quadrados dos desvios
EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial
FDIST = DISTF ## Retorna a distribuição de probabilidade F FDIST = DISTF ## Retorna a distribuição de probabilidade F
FINV = INVF ## Retorna o inverso da distribuição de probabilidades F FINV = INVF ## Retorna o inverso da distribuição de probabilidades F
FISHER = FISHER ## Retorna a transformação Fisher FISHER = FISHER ## Retorna a transformação Fisher
FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher
FORECAST = PREVISÃO ## Retorna um valor ao longo de uma linha reta 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 FREQUENCY = FREQÜÊNCIA ## Retorna uma distribuição de freqüência como uma matriz vertical
FTEST = TESTEF ## Retorna o resultado de um teste F FTEST = TESTEF ## Retorna o resultado de um teste F
GAMMADIST = DISTGAMA ## Retorna a distribuição gama GAMMADIST = DISTGAMA ## Retorna a distribuição gama
GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama
GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x) GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x)
GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica
GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial
HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica
HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica
INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear
KURT = CURT ## Retorna a curtose de um conjunto de dados KURT = CURT ## Retorna a curtose de um conjunto de dados
LARGE = MAIOR ## Retorna o maior valor k-ésimo 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 LINEST = PROJ.LIN ## Retorna os parâmetros de uma tendência linear
LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial
LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal
LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa
MAX = MÁXIMO ## Retorna o valor máximo em uma lista de argumentos 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 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 MEDIAN = MED ## Retorna a mediana dos números indicados
MIN = MÍNIMO ## Retorna o valor mínimo em uma lista de argumentos 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 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 MODE = MODO ## Retorna o valor mais comum em um conjunto de dados
NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa
NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal
NORMINV = INV.NORM ## Retorna o inverso da 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 NORMSDIST = DIST.NORMP ## Retorna a distribuição cumulativa normal padrão
NORMSINV = INV.NORMP ## Retorna o inverso da 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 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 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 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 PERMUT = PERMUT ## Retorna o número de permutações de um determinado número de objetos
POISSON = POISSON ## Retorna a distribuição Poisson POISSON = POISSON ## Retorna a distribuição Poisson
PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites
QUARTILE = QUARTIL ## Retorna o quartil do conjunto de dados 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 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 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 SKEW = DISTORÇÃO ## Retorna a distorção de uma distribuição
SLOPE = INCLINAÇÃO ## Retorna a inclinação da linha de regressão linear 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 SMALL = MENOR ## Retorna o menor valor k-ésimo do conjunto de dados
STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado
STDEV = DESVPAD ## Estima o desvio padrão com base em uma amostra 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 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 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 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 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 TDIST = DISTT ## Retorna a distribuição t de Student
TINV = INVT ## Retorna o inverso da 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 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 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 TTEST = TESTET ## Retorna a probabilidade associada ao teste t de Student
VAR = VAR ## Estima a variância com base em uma amostra 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 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 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 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 WEIBULL = WEIBULL ## Retorna a distribuição Weibull
ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z
## ##
## Text functions Funções de texto ## 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) 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) 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 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 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 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 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) 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 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) 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) 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 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) 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 LEFT = ESQUERDA ## Retorna os caracteres mais à esquerda de um valor de texto
LEFTB = ESQUERDAB ## 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 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 LENB = NÚM.CARACTB ## Retorna o número de caracteres em uma seqüência de texto
LOWER = MINÚSCULA ## Converte texto para minúsculas 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 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 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 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 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 REPLACE = MUDAR ## Muda os caracteres dentro do texto
REPLACEB = MUDARB ## 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 REPT = REPT ## Repete o texto um determinado número de vezes
RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto
RIGHTB = DIREITAB ## 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) 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) 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 SUBSTITUTE = SUBSTITUIR ## Substitui um novo texto por um texto antigo em uma seqüência de texto
T = T ## Converte os argumentos em texto T = T ## Converte os argumentos em texto
TEXT = TEXTO ## Formata um número e o converte em texto TEXT = TEXTO ## Formata um número e o converte em texto
TRIM = ARRUMAR ## Remove espaços do texto TRIM = ARRUMAR ## Remove espaços do texto
UPPER = MAIÚSCULA ## Converte o texto em maiúsculas UPPER = MAIÚSCULA ## Converte o texto em maiúsculas
VALUE = VALOR ## Converte um argumento de texto em um número VALUE = VALOR ## Converte um argumento de texto em um número

View File

@@ -1,408 +1,408 @@
## ##
## Add-in and Automation functions Funções de Suplemento e Automatização ## Add-in and Automation functions Funções de Suplemento e Automatização
## ##
GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica
## ##
## Cube functions Funções de cubo ## 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. 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. 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. 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. 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. 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. CUBESETCOUNT = CONTARCONJUNTOCUBO ## Devolve o número de itens num conjunto.
CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo. CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo.
## ##
## Database functions Funções de base de dados ## Database functions Funções de base de dados
## ##
DAVERAGE = BDMÉDIA ## Devolve a média das entradas da base de dados seleccionadas 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 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 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 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 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 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 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 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 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 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 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 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 and time functions Funções de data e hora
## ##
DATE = DATA ## Devolve o número de série de uma determinada data 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 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 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 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 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 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 HOUR = HORA ## Converte um número de série numa hora
MINUTE = MINUTO ## Converte um número de série num minuto MINUTE = MINUTO ## Converte um número de série num minuto
MONTH = MÊS ## Converte um número de série num mês 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 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 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 SECOND = SEGUNDO ## Converte um número de série num segundo
TIME = TEMPO ## Devolve o número de série de um determinado tempo 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 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 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 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 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 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 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 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 ## Engineering functions Funções de engenharia
## ##
BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x) BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x)
BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x) BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x)
BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x) BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x)
BESSELY = BESSELY ## Devolve a função de Bessel Yn(x) BESSELY = BESSELY ## Devolve a função de Bessel Yn(x)
BIN2DEC = BINADEC ## Converte um número binário em decimal BIN2DEC = BINADEC ## Converte um número binário em decimal
BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal
BIN2OCT = BINAOCT ## Converte um número binário em octal BIN2OCT = BINAOCT ## Converte um número binário em octal
COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo
CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro
DEC2BIN = DECABIN ## Converte um número decimal em binário DEC2BIN = DECABIN ## Converte um número decimal em binário
DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
DEC2OCT = DECAOCT ## Converte um número decimal em octal DEC2OCT = DECAOCT ## Converte um número decimal em octal
DELTA = DELTA ## Testa se dois valores são iguais DELTA = DELTA ## Testa se dois valores são iguais
ERF = FUNCERRO ## Devolve a função de erro ERF = FUNCERRO ## Devolve a função de erro
ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar
GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
IMABS = IMABS ## Devolve o valor absoluto (módulo) de um número complexo 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 IMAGINARY = IMAGINÁRIO ## Devolve o coeficiente imaginário de um número complexo
IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos
IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo
IMCOS = IMCOS ## Devolve o co-seno 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 IMDIV = IMDIV ## Devolve o quociente de dois números complexos
IMEXP = IMEXP ## Devolve o exponencial de um número complexo IMEXP = IMEXP ## Devolve o exponencial de um número complexo
IMLN = IMLN ## Devolve o logaritmo natural 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 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 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 IMPOWER = IMPOT ## Devolve um número complexo elevado a uma potência inteira
IMPRODUCT = IMPROD ## Devolve o produto de números complexos IMPRODUCT = IMPROD ## Devolve o produto de números complexos
IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo
IMSIN = IMSENO ## Devolve o seno 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 IMSQRT = IMRAIZ ## Devolve a raiz quadrada de um número complexo
IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos
IMSUM = IMSOMA ## Devolve a soma de números complexos IMSUM = IMSOMA ## Devolve a soma de números complexos
OCT2BIN = OCTABIN ## Converte um número octal em binário OCT2BIN = OCTABIN ## Converte um número octal em binário
OCT2DEC = OCTADEC ## Converte um número octal em decimal OCT2DEC = OCTADEC ## Converte um número octal em decimal
OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
## ##
## Financial functions Funções financeiras ## Financial functions Funções financeiras
## ##
ACCRINT = JUROSACUM ## Devolve os juros acumulados de um título que paga juros periódicos 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 EFFECT = EFECTIVA ## Devolve a taxa de juros anual efectiva
FV = VF ## Devolve o valor futuro de um investimento 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 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 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 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 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 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 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 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 NOMINAL = NOMINAL ## Devolve a taxa de juros nominal anual
NPER = NPER ## Devolve o número de períodos de um investimento 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 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 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 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 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 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 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 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 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 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 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 PV = VA ## Devolve o valor actual de um investimento
RATE = TAXA ## Devolve a taxa de juros por período de uma anuidade 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 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 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 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 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 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 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 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 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 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 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 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 YIELDMAT = LUCROVENC ## Devolve o lucro anual de um título que paga juros na data de vencimento
## ##
## Information functions Funções de informação ## 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 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 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 INFO = INFORMAÇÃO ## Devolve informações sobre o ambiente de funcionamento actual
ISBLANK = É.CÉL.VAZIA ## Devolve VERDADEIRO se o valor estiver em branco 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 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 ISERROR = É.ERRO ## Devolve VERDADEIRO se o valor for um valor de erro
ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par
ISLOGICAL = É.LÓGICO ## Devolve VERDADEIRO se o valor for lógico 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 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 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 ISNUMBER = É.NÚM ## Devolve VERDADEIRO se o valor for um número
ISODD = ÉÍMPAR ## Devolve VERDADEIRO se o número for ímpar ISODD = ÉÍMPAR ## Devolve VERDADEIRO se o número for ímpar
ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência
ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto
N = N ## Devolve um valor convertido num número N = N ## Devolve um valor convertido num número
NA = NÃO.DISP ## Devolve o valor de erro #N/D 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 TYPE = TIPO ## Devolve um número que indica o tipo de dados de um valor
## ##
## Logical functions Funções lógicas ## Logical functions Funções lógicas
## ##
AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO
FALSE = FALSO ## Devolve o valor lógico FALSO FALSE = FALSO ## Devolve o valor lógico FALSO
IF = SE ## Especifica um teste lógico a ser executado 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 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 NOT = NÃO ## Inverte a lógica do respectivo argumento
OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO
TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO
## ##
## Lookup and reference functions Funções de pesquisa e referência ## 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 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 AREAS = ÁREAS ## Devolve o número de áreas numa referência
CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores
COLUMN = COL ## Devolve o número da coluna de uma referência COLUMN = COL ## Devolve o número da coluna de uma referência
COLUMNS = COLS ## Devolve o número de colunas numa 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 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 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 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 INDIRECT = INDIRECTO ## Devolve uma referência indicada por um valor de texto
LOOKUP = PROC ## Procura valores num vector ou numa matriz LOOKUP = PROC ## Procura valores num vector ou numa matriz
MATCH = CORRESP ## Procura valores numa referência 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 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 ROW = LIN ## Devolve o número da linha de uma referência
ROWS = LINS ## Devolve o número de linhas numa 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).) 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 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 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 ## Math and trigonometry functions Funções matemáticas e trigonométricas
## ##
ABS = ABS ## Devolve o valor absoluto de um número ABS = ABS ## Devolve o valor absoluto de um número
ACOS = ACOS ## Devolve o arco de co-seno 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 ACOSH = ACOSH ## Devolve o co-seno hiperbólico inverso de um número
ASIN = ASEN ## Devolve o arco de seno 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 ASINH = ASENH ## Devolve o seno hiperbólico inverso de um número
ATAN = ATAN ## Devolve o arco de tangente 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 ATAN2 = ATAN2 ## Devolve o arco de tangente das coordenadas x e y
ATANH = ATANH ## Devolve a tangente hiperbólica inversa de um número 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 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 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 COS = COS ## Devolve o co-seno de um número
COSH = COSH ## Devolve o co-seno hiperbólico de um número COSH = COSH ## Devolve o co-seno hiperbólico de um número
DEGREES = GRAUS ## Converte radianos em graus DEGREES = GRAUS ## Converte radianos em graus
EVEN = PAR ## Arredonda um número por excesso para o número inteiro mais próximo 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 EXP = EXP ## Devolve e elevado à potência de um determinado número
FACT = FACTORIAL ## Devolve o factorial de um número FACT = FACTORIAL ## Devolve o factorial de um número
FACTDOUBLE = FACTDUPLO ## Devolve o factorial duplo 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 FLOOR = ARRED.DEFEITO ## Arredonda um número por defeito até zero
GCD = MDC ## Devolve o maior divisor comum GCD = MDC ## Devolve o maior divisor comum
INT = INT ## Arredonda um número por defeito para o número inteiro mais próximo 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 LCM = MMC ## Devolve o mínimo múltiplo comum
LN = LN ## Devolve o logaritmo natural de um número LN = LN ## Devolve o logaritmo natural de um número
LOG = LOG ## Devolve o logaritmo de um número com uma base especificada 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 LOG10 = LOG10 ## Devolve o logaritmo de base 10 de um número
MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz
MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz
MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes
MOD = RESTO ## Devolve o resto da divisão MOD = RESTO ## Devolve o resto da divisão
MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido
MULTINOMIAL = POLINOMIAL ## Devolve o polinomial de um conjunto de números 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 ODD = ÍMPAR ## Arredonda por excesso um número para o número inteiro ímpar mais próximo
PI = PI ## Devolve o valor de pi PI = PI ## Devolve o valor de pi
POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência
PRODUCT = PRODUTO ## Multiplica os respectivos argumentos PRODUCT = PRODUTO ## Multiplica os respectivos argumentos
QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão
RADIANS = RADIANOS ## Converte graus em radianos RADIANS = RADIANOS ## Converte graus em radianos
RAND = ALEATÓRIO ## Devolve um número aleatório entre 0 e 1 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 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 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 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 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 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 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 SIGN = SINAL ## Devolve o sinal de um número
SIN = SEN ## Devolve o seno de um determinado ângulo SIN = SEN ## Devolve o seno de um determinado ângulo
SINH = SENH ## Devolve o seno hiperbólico de um número SINH = SENH ## Devolve o seno hiperbólico de um número
SQRT = RAIZQ ## Devolve uma raiz quadrada positiva SQRT = RAIZQ ## Devolve uma raiz quadrada positiva
SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi) SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi)
SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados
SUM = SOMA ## Adiciona os respectivos argumentos SUM = SOMA ## Adiciona os respectivos argumentos
SUMIF = SOMA.SE ## Adiciona as células especificadas por um determinado critério 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 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 SUMPRODUCT = SOMARPRODUTO ## Devolve a soma dos produtos de componentes de matrizes correspondentes
SUMSQ = SOMARQUAD ## Devolve a soma dos quadrados dos argumentos 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 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 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 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 TAN = TAN ## Devolve a tangente de um número
TANH = TANH ## Devolve a tangente hiperbólica 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 TRUNC = TRUNCAR ## Trunca um número para um número inteiro
## ##
## Statistical functions Funções estatísticas ## 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 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 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 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 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 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 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 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 BINOMDIST = DISTRBINOM ## Devolve a probabilidade de distribuição binomial de termo individual
CHIDIST = DIST.CHI ## Devolve a probabilidade unicaudal da distribuição qui-quadrada 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 CHIINV = INV.CHI ## Devolve o inverso da probabilidade unicaudal da distribuição qui-quadrada
CHITEST = TESTE.CHI ## Devolve o teste para independência 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 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 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 COUNT = CONTAR ## Conta os números que existem na lista de argumentos
COUNTA = CONTAR.VAL ## Conta os valores 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 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 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 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 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 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 DEVSQ = DESVQ ## Devolve a soma dos quadrados dos desvios
EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial
FDIST = DISTF ## Devolve a distribuição da probabilidade F FDIST = DISTF ## Devolve a distribuição da probabilidade F
FINV = INVF ## Devolve o inverso da distribuição da probabilidade F FINV = INVF ## Devolve o inverso da distribuição da probabilidade F
FISHER = FISHER ## Devolve a transformação Fisher FISHER = FISHER ## Devolve a transformação Fisher
FISHERINV = FISHERINV ## Devolve o inverso da 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 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 FREQUENCY = FREQUÊNCIA ## Devolve uma distribuição de frequência como uma matriz vertical
FTEST = TESTEF ## Devolve o resultado de um teste F FTEST = TESTEF ## Devolve o resultado de um teste F
GAMMADIST = DISTGAMA ## Devolve a distribuição gama GAMMADIST = DISTGAMA ## Devolve a distribuição gama
GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa
GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x) GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x)
GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica
GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial
HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica
HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica
INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear
KURT = CURT ## Devolve a curtose de um conjunto de dados KURT = CURT ## Devolve a curtose de um conjunto de dados
LARGE = MAIOR ## Devolve o maior valor k-ésimo 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 LINEST = PROJ.LIN ## Devolve os parâmetros de uma tendência linear
LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial
LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica
LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa
MAX = MÁXIMO ## Devolve o valor máximo numa lista de argumentos 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 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 MEDIAN = MED ## Devolve a mediana dos números indicados
MIN = MÍNIMO ## Devolve o valor mínimo numa lista de argumentos 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 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 MODE = MODA ## Devolve o valor mais comum num conjunto de dados
NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa
NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal
NORMINV = INV.NORM ## Devolve o inverso da 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 NORMSDIST = DIST.NORMP ## Devolve a distribuição cumulativa normal padrão
NORMSINV = INV.NORMP ## Devolve o inverso da 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 PEARSON = PEARSON ## Devolve o coeficiente de correlação momento/produto de Pearson
PERCENTILE = PERCENTIL ## Devolve o k-ésimo percentil de valores num intervalo 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 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 PERMUT = PERMUTAR ## Devolve o número de permutações de um determinado número de objectos
POISSON = POISSON ## Devolve a distribuição de Poisson POISSON = POISSON ## Devolve a distribuição de Poisson
PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites
QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados
RANK = ORDEM ## Devolve a ordem de um número numa lista numérica 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 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 SKEW = DISTORÇÃO ## Devolve a distorção de uma distribuição
SLOPE = DECLIVE ## Devolve o declive da linha de regressão linear 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 SMALL = MENOR ## Devolve o menor valor de k-ésimo de um conjunto de dados
STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado
STDEV = DESVPAD ## Calcula o desvio-padrão com base numa amostra 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 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 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 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 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 TDIST = DISTT ## Devolve a distribuição t de Student
TINV = INVT ## Devolve o inverso da 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 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 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 TTEST = TESTET ## Devolve a probabilidade associada ao teste t de Student
VAR = VAR ## Calcula a variância com base numa amostra 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 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 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 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 WEIBULL = WEIBULL ## Devolve a distribuição Weibull
ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z
## ##
## Text functions Funções de texto ## 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) 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) 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 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 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 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 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) 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 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) 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) 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 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) 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 LEFT = ESQUERDA ## Devolve os caracteres mais à esquerda de um valor de texto
LEFTB = ESQUERDAB ## 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 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 LENB = NÚM.CARACTB ## Devolve o número de caracteres de uma cadeia de texto
LOWER = MINÚSCULAS ## Converte o texto em minúsculas 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 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 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 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 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 REPLACE = SUBSTITUIR ## Substitui caracteres no texto
REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto
REPT = REPETIR ## Repete texto um determinado número de vezes REPT = REPETIR ## Repete texto um determinado número de vezes
RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto
RIGHTB = DIREITAB ## 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) 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) 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 SUBSTITUTE = SUBST ## Substitui texto novo por texto antigo numa cadeia de texto
T = T ## Converte os respectivos argumentos em texto T = T ## Converte os respectivos argumentos em texto
TEXT = TEXTO ## Formata um número e converte-o em texto TEXT = TEXTO ## Formata um número e converte-o em texto
TRIM = COMPACTAR ## Remove espaços do texto TRIM = COMPACTAR ## Remove espaços do texto
UPPER = MAIÚSCULAS ## Converte texto em maiúsculas UPPER = MAIÚSCULAS ## Converte texto em maiúsculas
VALUE = VALOR ## Converte um argumento de texto num número VALUE = VALOR ## Converte um argumento de texto num número

View File

@@ -1,408 +1,408 @@
## ##
## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner ## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner
## ##
GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport
## ##
## Cube functions Kubfunktioner ## 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. 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. 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. 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. 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. 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. CUBESETCOUNT = KUBINSTÄLLNINGANTAL ## Returnerar antalet objekt i en uppsättning.
CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde från en kub. CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde från en kub.
## ##
## Database functions Databasfunktioner ## Database functions Databasfunktioner
## ##
DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna
DCOUNT = DANTAL ## Räknar antalet celler som innehåller tal i en databas DCOUNT = DANTAL ## Räknar antalet celler som innehåller tal i en databas
DCOUNTA = DANTALV ## Räknar ifyllda celler 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 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 DMAX = DMAX ## Returnerar det största värdet från databasposterna
DMIN = DMIN ## Returnerar det minsta 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 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 DSTDEV = DSTDAV ## Uppskattar standardavvikelsen baserat på ett urval av databasposterna
DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrån hela populationen av valda databasposter DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrån hela populationen av valda databasposter
DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret
DVAR = DVARIANS ## Uppskattar variansen baserat på ett urval av databasposterna DVAR = DVARIANS ## Uppskattar variansen baserat på ett urval av databasposterna
DVARP = DVARIANSP ## Beräknar variansen utifrån hela populationen av valda databasposter DVARP = DVARIANSP ## Beräknar variansen utifrån hela populationen av valda databasposter
## ##
## Date and time functions Tid- och datumfunktioner ## Date and time functions Tid- och datumfunktioner
## ##
DATE = DATUM ## Returnerar ett serienummer för ett visst datum DATE = DATUM ## Returnerar ett serienummer för ett visst datum
DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer
DAY = DAG ## Konverterar ett serienummer till dag i månaden 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 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 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 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 HOUR = TIMME ## Konverterar ett serienummer till en timme
MINUTE = MINUT ## Konverterar ett serienummer till en minut MINUTE = MINUT ## Konverterar ett serienummer till en minut
MONTH = MÅNAD ## Konverterar ett serienummer till en månad MONTH = MÅNAD ## Konverterar ett serienummer till en månad
NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan två datum NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan två datum
NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid
SECOND = SEKUND ## Konverterar ett serienummer till en sekund SECOND = SEKUND ## Konverterar ett serienummer till en sekund
TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid
TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer
TODAY = IDAG ## Returnerar serienumret för dagens datum TODAY = IDAG ## Returnerar serienumret för dagens datum
WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan
WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer
WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare
YEAR = ÅR ## Konverterar ett serienummer till ett år 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 YEARFRAC = ÅRDEL ## Returnerar en del av ett år som representerar antalet hela dagar mellan start- och slutdatum
## ##
## Engineering functions Tekniska funktioner ## Engineering functions Tekniska funktioner
## ##
BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x) BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x)
BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x) BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x)
BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x) BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x)
BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x) BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x)
BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt
BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt
BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt
COMPLEX = KOMPLEX ## Omvandlar reella och imaginära koefficienter till ett komplext tal 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 CONVERT = KONVERTERA ## Omvandlar ett tal från ett måttsystem till ett annat
DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt
DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt
DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt
DELTA = DELTA ## Testar om två värden är lika DELTA = DELTA ## Testar om två värden är lika
ERF = FELF ## Returnerar felfunktionen ERF = FELF ## Returnerar felfunktionen
ERFC = FELFK ## Returnerar den komplementära felfunktionen ERFC = FELFK ## Returnerar den komplementära felfunktionen
GESTEP = SLSTEG ## Testar om ett tal är större än ett tröskelvärde 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 HEX2BIN = HEX.TILL.BIN ## Omvandlar ett hexadecimalt tal till binärt
HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt
HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt
IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal
IMAGINARY = IMAGINÄR ## Returnerar den imaginära koefficienten 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 IMARGUMENT = IMARGUMENT ## Returnerar det komplexa talets argument, en vinkel uttryckt i radianer
IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat
IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal
IMDIV = IMDIV ## Returnerar kvoten för två komplexa tal IMDIV = IMDIV ## Returnerar kvoten för två komplexa tal
IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal
IMLN = IMLN ## Returnerar den naturliga logaritmen 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 IMLOG10 = IMLOG10 ## Returnerar 10-logaritmen för ett komplext tal
IMLOG2 = IMLOG2 ## Returnerar 2-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 IMPOWER = IMUPPHÖJT ## Returnerar ett komplext tal upphöjt till en exponent
IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal
IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal
IMSIN = IMSIN ## Returnerar sinus för ett komplext tal IMSIN = IMSIN ## Returnerar sinus för ett komplext tal
IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal
IMSUB = IMDIFF ## Returnerar differensen mellan två komplexa tal IMSUB = IMDIFF ## Returnerar differensen mellan två komplexa tal
IMSUM = IMSUM ## Returnerar summan av komplexa tal IMSUM = IMSUM ## Returnerar summan av komplexa tal
OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt
OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt
OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt
## ##
## Financial functions Finansiella funktioner ## Financial functions Finansiella funktioner
## ##
ACCRINT = UPPLRÄNTA ## Returnerar den upplupna räntan för värdepapper med periodisk ränta 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 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 AMORDEGRC = AMORDEGRC ## Returnerar avskrivningen för varje redovisningsperiod med hjälp av en avskrivningskoefficient
AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod
COUPDAYBS = KUPDAGBB ## Returnerar antal dagar från början av kupongperioden till likviddagen COUPDAYBS = KUPDAGBB ## Returnerar antal dagar från början av kupongperioden till likviddagen
COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehåller betalningsdatumet COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehåller betalningsdatumet
COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar från betalningsdatumet till nästa kupongdatum COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar från betalningsdatumet till nästa kupongdatum
COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen
COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen
COUPPCD = KUPFKD ## Returnerar föregående kupongdatum före likviddagen COUPPCD = KUPFKD ## Returnerar föregående kupongdatum före likviddagen
CUMIPMT = KUMRÄNTA ## Returnerar den ackumulerade räntan som betalats mellan två perioder 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 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 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 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 DISC = DISK ## Returnerar diskonteringsräntan för ett värdepapper
DOLLARDE = DECTAL ## Omvandlar ett pris uttryckt som ett bråk till ett decimaltal 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 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 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 EFFECT = EFFRÄNTA ## Returnerar den årliga effektiva räntesatsen
FV = SLUTVÄRDE ## Returnerar det framtida värdet på en investering 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 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 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 IPMT = RBETALNING ## Returnerar räntedelen av en betalning för en given period
IRR = IR ## Returnerar internräntan för en serie betalningar IRR = IR ## Returnerar internräntan för en serie betalningar
ISPMT = RALÅN ## Beräknar räntan som har betalats under en specifik betalningsperiod 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 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 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 NOMINAL = NOMRÄNTA ## Returnerar den årliga nominella räntesatsen
NPER = PERIODER ## Returnerar antalet perioder för en investering 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 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 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 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 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 ODDLYIELD = UDDASAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda sista period
PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet
PPMT = AMORT ## Returnerar amorteringsdelen av en annuitetsbetalning för en given period 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 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 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 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 PV = PV ## Returnerar nuvärdet av en serie lika stora periodiska betalningar
RATE = RÄNTA ## Returnerar räntesatsen per period i en annuitet 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 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 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 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 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 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 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) 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 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 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 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 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 YIELDMAT = NOMAVKFÖRF ## Returnerar den årliga avkastningen för ett värdepapper som ger ränta på förfallodagen
## ##
## Information functions Informationsfunktioner ## Information functions Informationsfunktioner
## ##
CELL = CELL ## Returnerar information om formatering, plats och innehåll i en cell 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 ERROR.TYPE = FEL.TYP ## Returnerar ett tal som motsvarar ett felvärde
INFO = INFO ## Returnerar information om operativsystemet INFO = INFO ## Returnerar information om operativsystemet
ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt
ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS! ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS!
ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde
ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt
ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde
ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS! ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS!
ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text
ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal
ISODD = ÄRUDDA ## Returnerar SANT om talet är udda ISODD = ÄRUDDA ## Returnerar SANT om talet är udda
ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens
ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text
N = N ## Returnerar ett värde omvandlat till ett tal N = N ## Returnerar ett värde omvandlat till ett tal
NA = SAKNAS ## Returnerar felvärdet #SAKNAS! NA = SAKNAS ## Returnerar felvärdet #SAKNAS!
TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp
## ##
## Logical functions Logiska funktioner ## Logical functions Logiska funktioner
## ##
AND = OCH ## Returnerar SANT om alla argument är sanna AND = OCH ## Returnerar SANT om alla argument är sanna
FALSE = FALSKT ## Returnerar det logiska värdet FALSKT FALSE = FALSKT ## Returnerar det logiska värdet FALSKT
IF = OM ## Anger vilket logiskt test som ska utföras 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 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 NOT = ICKE ## Inverterar logiken för argumenten
OR = ELLER ## Returnerar SANT om något argument är SANT OR = ELLER ## Returnerar SANT om något argument är SANT
TRUE = SANT ## Returnerar det logiska värdet SANT TRUE = SANT ## Returnerar det logiska värdet SANT
## ##
## Lookup and reference functions Sök- och referensfunktioner ## Lookup and reference functions Sök- och referensfunktioner
## ##
ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad
AREAS = OMRÅDEN ## Returnerar antalet områden i en referens AREAS = OMRÅDEN ## Returnerar antalet områden i en referens
CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden
COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens
COLUMNS = KOLUMNER ## Returnerar antalet kolumner i 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 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 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 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 INDIRECT = INDIREKT ## Returnerar en referens som anges av ett textvärde
LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris
MATCH = PASSA ## Letar upp värden i en referens 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 OFFSET = FÖRSKJUTNING ## Returnerar en referens förskjuten i förhållande till en given referens
ROW = RAD ## Returnerar radnumret för en referens ROW = RAD ## Returnerar radnumret för en referens
ROWS = RADER ## Returnerar antalet rader i 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).) 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 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 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 ## Math and trigonometry functions Matematiska och trigonometriska funktioner
## ##
ABS = ABS ## Returnerar absolutvärdet av ett tal ABS = ABS ## Returnerar absolutvärdet av ett tal
ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal
ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal
ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal
ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal
ATAN = ARCTAN ## Returnerar arcus tangens 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 ATAN2 = ARCTAN2 ## Returnerar arcus tangens för en x- och en y- koordinat
ATANH = ARCTANH ## Returnerar hyperbolisk arcus tangens för ett tal 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 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 COMBIN = KOMBIN ## Returnerar antalet kombinationer för ett givet antal objekt
COS = COS ## Returnerar cosinus för ett tal COS = COS ## Returnerar cosinus för ett tal
COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal
DEGREES = GRADER ## Omvandlar radianer till grader DEGREES = GRADER ## Omvandlar radianer till grader
EVEN = JÄMN ## Avrundar ett tal uppåt till närmaste heltal EVEN = JÄMN ## Avrundar ett tal uppåt till närmaste heltal
EXP = EXP ## Returnerar e upphöjt till ett givet tal EXP = EXP ## Returnerar e upphöjt till ett givet tal
FACT = FAKULTET ## Returnerar fakulteten för ett tal FACT = FAKULTET ## Returnerar fakulteten för ett tal
FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal
FLOOR = RUNDA.NED ## Avrundar ett tal nedåt mot noll FLOOR = RUNDA.NED ## Avrundar ett tal nedåt mot noll
GCD = SGD ## Returnerar den största gemensamma nämnaren GCD = SGD ## Returnerar den största gemensamma nämnaren
INT = HELTAL ## Avrundar ett tal nedåt till närmaste heltal INT = HELTAL ## Avrundar ett tal nedåt till närmaste heltal
LCM = MGM ## Returnerar den minsta gemensamma multipeln LCM = MGM ## Returnerar den minsta gemensamma multipeln
LN = LN ## Returnerar den naturliga logaritmen för ett tal LN = LN ## Returnerar den naturliga logaritmen för ett tal
LOG = LOG ## Returnerar logaritmen för ett tal för en given bas LOG = LOG ## Returnerar logaritmen för ett tal för en given bas
LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal
MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris
MINVERSE = MINVERT ## Returnerar matrisinversen av en matris MINVERSE = MINVERT ## Returnerar matrisinversen av en matris
MMULT = MMULT ## Returnerar matrisprodukten av två matriser MMULT = MMULT ## Returnerar matrisprodukten av två matriser
MOD = REST ## Returnerar resten vid en division MOD = REST ## Returnerar resten vid en division
MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel
MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal
ODD = UDDA ## Avrundar ett tal uppåt till närmaste udda heltal ODD = UDDA ## Avrundar ett tal uppåt till närmaste udda heltal
PI = PI ## Returnerar värdet pi PI = PI ## Returnerar värdet pi
POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent
PRODUCT = PRODUKT ## Multiplicerar argumenten PRODUCT = PRODUKT ## Multiplicerar argumenten
QUOTIENT = KVOT ## Returnerar heltalsdelen av en division QUOTIENT = KVOT ## Returnerar heltalsdelen av en division
RADIANS = RADIANER ## Omvandlar grader till radianer RADIANS = RADIANER ## Omvandlar grader till radianer
RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1 RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1
RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger
ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text
ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror
ROUNDDOWN = AVRUNDA.NEDÅT ## Avrundar ett tal nedåt mot noll ROUNDDOWN = AVRUNDA.NEDÅT ## Avrundar ett tal nedåt mot noll
ROUNDUP = AVRUNDA.UPPÅT ## Avrundar ett tal uppåt, från noll ROUNDUP = AVRUNDA.UPPÅT ## Avrundar ett tal uppåt, från noll
SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat på formeln SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat på formeln
SIGN = TECKEN ## Returnerar tecknet för ett tal SIGN = TECKEN ## Returnerar tecknet för ett tal
SIN = SIN ## Returnerar sinus för en given vinkel SIN = SIN ## Returnerar sinus för en given vinkel
SINH = SINH ## Returnerar hyperbolisk sinus för ett tal SINH = SINH ## Returnerar hyperbolisk sinus för ett tal
SQRT = ROT ## Returnerar den positiva kvadratroten SQRT = ROT ## Returnerar den positiva kvadratroten
SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi) SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi)
SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas
SUM = SUMMA ## Summerar argumenten SUM = SUMMA ## Summerar argumenten
SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor
SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett område som uppfyller flera kriterier SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett område som uppfyller flera kriterier
SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter
SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater
SUMX2MY2 = SUMMAX2MY2 ## Returnerar summan av differensen mellan kvadraterna för motsvarande värden i två matriser 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 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 SUMXMY2 = SUMMAXMY2 ## Returnerar summan av kvadraten av skillnaden mellan motsvarande värden i två matriser
TAN = TAN ## Returnerar tangens för ett tal TAN = TAN ## Returnerar tangens för ett tal
TANH = TANH ## Returnerar hyperbolisk tangens för ett tal TANH = TANH ## Returnerar hyperbolisk tangens för ett tal
TRUNC = AVKORTA ## Avkortar ett tal till ett heltal TRUNC = AVKORTA ## Avkortar ett tal till ett heltal
## ##
## Statistical functions Statistiska funktioner ## Statistical functions Statistiska funktioner
## ##
AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse från deras medelvärde AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse från deras medelvärde
AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten
AVERAGEA = AVERAGEA ## Returnerar medelvärdet av argumenten, inklusive tal, text och logiska värden 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 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. 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 BETADIST = BETAFÖRD ## Returnerar den kumulativa betafördelningsfunktionen
BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning
BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen
CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen
CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen
CHITEST = CHI2TEST ## Returnerar oberoendetesten CHITEST = CHI2TEST ## Returnerar oberoendetesten
CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde
CORREL = KORREL ## Returnerar korrelationskoefficienten mellan två datamängder CORREL = KORREL ## Returnerar korrelationskoefficienten mellan två datamängder
COUNT = ANTAL ## Räknar hur många tal som finns bland argumenten 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 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 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. 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. 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 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 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 DEVSQ = KVADAVV ## Returnerar summan av kvadrater på avvikelser
EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen
FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen
FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen
FISHER = FISHER ## Returnerar Fisher-transformationen FISHER = FISHER ## Returnerar Fisher-transformationen
FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen
FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje
FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris
FTEST = FTEST ## Returnerar resultatet av en F-test FTEST = FTEST ## Returnerar resultatet av en F-test
GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen
GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen
GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x) GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x)
GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet
GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend
HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet
HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen
INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje
KURT = TOPPIGHET ## Returnerar toppigheten av en mängd data 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 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 LINEST = REGR ## Returnerar parametrar till en linjär trendlinje
LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend
LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen
LOGNORMDIST = LOGNORMFÖRD ## Returnerar den kumulativa 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 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 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 MEDIAN = MEDIAN ## Returnerar medianen för angivna tal
MIN = MIN ## Returnerar det minsta värdet i en lista med argument 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 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 MODE = TYPVÄRDE ## Returnerar det vanligaste värdet i en datamängd
NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen
NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen
NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen
NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen
NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen
PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt
PERCENTILE = PERCENTIL ## Returnerar den n:te percentilen av värden i ett område 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 PERCENTRANK = PROCENTRANG ## Returnerar procentrangen för ett värde i en datamängd
PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt
POISSON = POISSON ## Returnerar Poisson-fördelningen POISSON = POISSON ## Returnerar Poisson-fördelningen
PROB = SANNOLIKHET ## Returnerar sannolikheten att värden i ett område ligger mellan två gränser 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 QUARTILE = KVARTIL ## Returnerar kvartilen av en mängd data
RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal
RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient
SKEW = SNEDHET ## Returnerar snedheten för en fördelning SKEW = SNEDHET ## Returnerar snedheten för en fördelning
SLOPE = LUTNING ## Returnerar lutningen på en linjär regressionslinje SLOPE = LUTNING ## Returnerar lutningen på en linjär regressionslinje
SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data
STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde
STDEV = STDAV ## Uppskattar standardavvikelsen baserat på ett urval STDEV = STDAV ## Uppskattar standardavvikelsen baserat på ett urval
STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat på ett urval, inklusive tal, text och logiska värden STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat på ett urval, inklusive tal, text och logiska värden
STDEVP = STDAVP ## Beräknar standardavvikelsen baserat på hela populationen 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 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 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 TDIST = TFÖRD ## Returnerar Students t-fördelning
TINV = TINV ## Returnerar inversen till Students t-fördelning TINV = TINV ## Returnerar inversen till Students t-fördelning
TREND = TREND ## Returnerar värden längs en linjär trend TREND = TREND ## Returnerar värden längs en linjär trend
TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd
TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test
VAR = VARIANS ## Uppskattar variansen baserat på ett urval VAR = VARIANS ## Uppskattar variansen baserat på ett urval
VARA = VARA ## Uppskattar variansen baserat på ett urval, inklusive tal, text och logiska värden VARA = VARA ## Uppskattar variansen baserat på ett urval, inklusive tal, text och logiska värden
VARP = VARIANSP ## Beräknar variansen baserat på hela populationen 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 VARPA = VARPA ## Beräknar variansen baserat på hela populationen, inklusive tal, text och logiska värden
WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen
ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test
## ##
## Text functions Textfunktioner ## 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) 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) BAHTTEXT = BAHTTEXT ## Omvandlar ett tal till text med valutaformatet ß (baht)
CHAR = TECKENKOD ## Returnerar tecknet som anges av kod CHAR = TECKENKOD ## Returnerar tecknet som anges av kod
CLEAN = STÄDA ## Tar bort alla icke utskrivbara tecken i en text 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 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 CONCATENATE = SAMMANFOGA ## Sammanfogar flera textdelar till en textsträng
DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat
EXACT = EXAKT ## Kontrollerar om två textvärden är identiska EXACT = EXAKT ## Kontrollerar om två textvärden är identiska
FIND = HITTA ## Hittar en text i en annan (skiljer på gemener och versaler) 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) 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 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) 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 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 LEFTB = VÄNSTERB ## Returnerar tecken längst till vänster i en sträng
LEN = LÄNGD ## Returnerar antalet tecken i en textsträng LEN = LÄNGD ## Returnerar antalet tecken i en textsträng
LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng
LOWER = GEMENER ## Omvandlar text till gemener 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 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 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 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 PROPER = INITIAL ## Ändrar första bokstaven i varje ord i ett textvärde till versal
REPLACE = ERSÄTT ## Ersätter tecken i text REPLACE = ERSÄTT ## Ersätter tecken i text
REPLACEB = ERSÄTTB ## Ersätter tecken i text REPLACEB = ERSÄTTB ## Ersätter tecken i text
REPT = REP ## Upprepar en text ett bestämt antal gånger 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 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 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) 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) 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 SUBSTITUTE = BYT.UT ## Ersätter gammal text med ny text i en textsträng
T = T ## Omvandlar argumenten till text T = T ## Omvandlar argumenten till text
TEXT = TEXT ## Formaterar ett tal och omvandlar det till text TEXT = TEXT ## Formaterar ett tal och omvandlar det till text
TRIM = RENSA ## Tar bort blanksteg från text TRIM = RENSA ## Tar bort blanksteg från text
UPPER = VERSALER ## Omvandlar text till versaler UPPER = VERSALER ## Omvandlar text till versaler
VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal