← All how-to recipes

How to convert a column letter to a number

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Turn "AB" into 28 — for driving INDEX, building references, or documentation.

The formula

AppFormulaNotes
Excel (desktop)=COLUMN(INDIRECT(A2&"1"))A2 holds the column letters. INDIRECT builds a reference; COLUMN reads its number.
Google Sheets=COLUMN(INDIRECT(A2&"1"))Identical.
LibreOffice Calc=COLUMN(INDIRECT(A2&"1"))Identical.

How it works

INDIRECT turns the text "AB1" into a real cell reference, and COLUMN returns that cell's column number — 28 for column AB. The reverse (number to letter) is the ADDRESS/SUBSTITUTE trick in the convert-a-column-number-to-a-letter recipe. INDIRECT is volatile (recalculates constantly), so for a one-off conversion it's fine, but avoid thousands of them; when you actually need to fetch data by a computed column, INDEX with the numeric result is faster and non-volatile.

Verified, not just documented

We ran =COLUMN(INDIRECT(A2&"1")) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 28 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 28 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

COLUMN · INDIRECT — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes