{"record":{"id":"5def97c9f219a4ea","repo":"PHPOffice/PhpSpreadsheet","slug":"only-single-cell-references-may-be-passed-to-this","errorCode":null,"errorMessage":"Only single cell references may be passed to this method.","messagePattern":"Only single cell references may be passed to this method\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/PhpSpreadsheet/CellReferenceHelper.php","lineNumber":56,"sourceCode":"        $this->beforeRow = (int) $beforeRow;\n    }\n\n    public function beforeCellAddress(): string\n    {\n        return $this->beforeCellAddress;\n    }\n\n    public function refreshRequired(string $beforeCellAddress, int $numberOfColumns, int $numberOfRows): bool\n    {\n        return $this->beforeCellAddress !== $beforeCellAddress\n            || $this->numberOfColumns !== $numberOfColumns\n            || $this->numberOfRows !== $numberOfRows;\n    }\n\n    public function updateCellReference(string $cellReference = 'A1', bool $includeAbsoluteReferences = false, bool $onlyAbsoluteReferences = false, ?bool $topLeft = null): string\n    {\n        if (Coordinate::coordinateIsRange($cellReference)) {\n            throw new Exception('Only single cell references may be passed to this method.');\n        }\n\n        // Get coordinate of $cellReference\n        [$newColumn, $newRow] = Coordinate::coordinateFromString($cellReference);\n        $newColumnIndex = Coordinate::columnIndexFromString(str_replace('$', '', $newColumn));\n        $newRowIndex = (int) str_replace('$', '', $newRow);\n\n        $absoluteColumn = $newColumn[0] === '$' ? '$' : '';\n        $absoluteRow = $newRow[0] === '$' ? '$' : '';\n        // Verify which parts should be updated\n        if ($onlyAbsoluteReferences === true) {\n            $updateColumn = (($absoluteColumn === '$') && $newColumnIndex >= $this->beforeColumn);\n            $updateRow = (($absoluteRow === '$') && $newRowIndex >= $this->beforeRow);\n        } elseif ($includeAbsoluteReferences === false) {\n            $updateColumn = (($absoluteColumn !== '$') && $newColumnIndex >= $this->beforeColumn);\n            $updateRow = (($absoluteRow !== '$') && $newRowIndex >= $this->beforeRow);\n        } else {\n            $newColumnIndex = $this->computeNewColumnIndex($newColumnIndex, $topLeft);","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/PHPOffice/PhpSpreadsheet/blob/65b080eef4d9fd11a5796135ab145883e5c3d6a6/src/PhpSpreadsheet/CellReferenceHelper.php#L38-L74","documentation":"Error \"Only single cell references may be passed to this method.\" thrown in PHPOffice/PhpSpreadsheet.","triggerScenarios":"Thrown at src/PhpSpreadsheet/CellReferenceHelper.php:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"65b080eef4d9fd11a5796135ab145883e5c3d6a6","analyzedAt":"2026-08-17T05:40:41.646Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}