getColumnPositionByLetter
function getColumnPositionByLetter(letter: string): number | null;
Indices count from zero, the way a GridRange does; positions count from one, the way getRange(row, column) does. Mixing the two is the usual source of an off-by-one in a spreadsheet script, which is why both pairs exist under separate names.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The column letter, in either case. |
Returns
number | null — the one-based position.
Examples
Converting
getColumnPositionByLetter("A"); // => 1
getColumnPositionByLetter("AA"); // => 27
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.