public static function PHPExcel_Calculation_LookupRef::CELL_ADDRESS in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php \PHPExcel_Calculation_LookupRef::CELL_ADDRESS()
* CELL_ADDRESS * * Creates a cell address as text, given specified row and column numbers. * * Excel Function: * =ADDRESS(row, column, [relativity], [referenceStyle], [sheetText]) * *
Parameters
row Row number to use in the cell reference: * @param column Column number to use in the cell reference * @param relativity Flag indicating the type of reference to return * 1 or omitted Absolute * 2 Absolute row; relative column * 3 Relative row; absolute column * 4 Relative * @param referenceStyle A logical value that specifies the A1 or R1C1 reference style. * TRUE or omitted CELL_ADDRESS returns an A1-style reference * FALSE CELL_ADDRESS returns an R1C1-style reference * @param sheetText Optional Name of worksheet to use * @return string
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Calculation/ LookupRef.php, line 70
Class
- PHPExcel_Calculation_LookupRef
- PHPExcel_Calculation_LookupRef
Code
public static function CELL_ADDRESS($row, $column, $relativity = 1, $referenceStyle = True, $sheetText = '') {
$row = PHPExcel_Calculation_Functions::flattenSingleValue($row);
$column = PHPExcel_Calculation_Functions::flattenSingleValue($column);
$relativity = PHPExcel_Calculation_Functions::flattenSingleValue($relativity);
$sheetText = PHPExcel_Calculation_Functions::flattenSingleValue($sheetText);
if ($row < 1 || $column < 1) {
return PHPExcel_Calculation_Functions::VALUE();
}
if ($sheetText > '') {
if (strpos($sheetText, ' ') !== False) {
$sheetText = "'" . $sheetText . "'";
}
$sheetText .= '!';
}
if (!is_bool($referenceStyle) || $referenceStyle) {
$rowRelative = $columnRelative = '$';
$column = PHPExcel_Cell::stringFromColumnIndex($column - 1);
if ($relativity == 2 || $relativity == 4) {
$columnRelative = '';
}
if ($relativity == 3 || $relativity == 4) {
$rowRelative = '';
}
return $sheetText . $columnRelative . $column . $rowRelative . $row;
}
else {
if ($relativity == 2 || $relativity == 4) {
$column = '[' . $column . ']';
}
if ($relativity == 3 || $relativity == 4) {
$row = '[' . $row . ']';
}
return $sheetText . 'R' . $row . 'C' . $column;
}
}