PHPOffice/PhpSpreadsheet · error · PhpOffice\PhpSpreadsheet\Exception

Column string index can not be {beyond XFD|empty}

Error message

Column string index can not be {beyond XFD|empty}

What it means

Error "Column string index can not be {beyond XFD|empty}" thrown in PHPOffice/PhpSpreadsheet.

Source

Thrown at src/PhpSpreadsheet/Cell/Coordinate.php:448

                $indexCache[$columnAddress] = $columnLookup[$columnAddress[0]] * 26
                    + $columnLookup[$columnAddress[1]];

                return $indexCache[$columnAddress];
            }
            if (!isset($columnAddress[3])) {
                $temp = $columnLookup[$columnAddress[0]] * 676
                    + $columnLookup[$columnAddress[1]] * 26
                    + $columnLookup[$columnAddress[2]];

                if ($temp <= AddressRange::MAX_COLUMN_INT) {
                    $indexCache[$columnAddress] = $temp;

                    return $temp;
                }
            }
        }

        throw new Exception(
            'Column string index can not be ' . ((isset($columnAddress[0])) ? ('beyond ' . AddressRange::MAX_COLUMN) : 'empty')
        );
    }

    private const LOOKUP_CACHE = ' ABCDEFGHIJKLMNOPQRSTUVWXYZ';

    /**
     * String from column index.
     *
     * @param int|numeric-string $columnIndex Column index (A = 1)
     */
    public static function stringFromColumnIndex(int|string $columnIndex, bool $tolerateZero = false): string
    {
        /** @var string[] */
        static $indexCache = [];
        $columnIndex2 = (int) $columnIndex;
        if ($columnIndex2 === 0 && $tolerateZero) {
            return '';

View on GitHub (pinned to 65b080eef4)

When it happens

Trigger: Thrown at src/PhpSpreadsheet/Cell/Coordinate.php:448 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of PHPOffice/PhpSpreadsheet@65b080eef4 (2026-08-17). Data as JSON: /api/errors/24814f11a8fea91b. Report an issue: GitHub.