To convert an Excel column letter to its number, put the letter in A1 and enter =COLUMN(INDIRECT(UPPER(A1)&"1")) in another cell. For example, if A1 contains AA, the formula returns 27; Excel numbers columns from A = 1 through XFD = 16,384.
Quick column-letter conversions
Excel’s column labels are an ordered numbering system, not arbitrary names. The first 26 columns use one letter, A through Z. After Z, the labels continue with two letters, beginning at AA. The same pattern extends to three letters and, in current Excel, as far as XFD.
Here are useful letter-to-number pairs for checking a result:
- A = 1, B = 2, and Z = 26.
- AA = 27, AB = 28, and AZ = 52.
- BA = 53, ZZ = 702, and AAA = 703.
- XFD = 16,384, the last column in current Excel worksheets.
The conversion counts columns from the far left of a worksheet. It does not depend on which cells contain data, whether a column is hidden, or where a table begins. For instance, column D remains column number 4 even if its cells are empty or hidden.
Why Excel column letters work like base 26
The labels resemble a base-26 number system, but with an important difference: there is no zero digit. In ordinary base 10, a place can contain 0; Excel’s letter sequence starts at 1, so A represents 1 and Z represents 26. After Z, the next label is AA rather than A0.
To calculate a multi-letter label manually, start at the left and multiply the running total by 26 before adding the value of the next letter. Give A a value of 1, B a value of 2, and continue through Z = 26. For AB, calculate 1 × 26 + 2 = 28? That would be incorrect because the first position must also be included as a place value. The right calculation is A × 26 + B = 1 × 26 + 2 = 28, so AB is 28, not 27.
For AA, the same calculation gives 1 × 26 + 1 = 27. For XFD, calculate (24 × 26 + 6) × 26 + 4 = 16,384. This place-value rule explains why the letters move from Z to AA and why every additional letter represents a much larger range of column numbers.
Convert a letter with a worksheet formula
The COLUMN function returns a column number when it receives a cell reference. INDIRECT turns text into a reference, which lets the formula build a reference from a column label and a row number. The row number itself does not affect the result: the reference to AA1 is in column 27.
With the column label in A1, enter =COLUMN(INDIRECT(UPPER(A1)&"1")). If A1 contains AA, the result is 27. If A1 contains XFD, the result is 16,384. UPPER allows lowercase input such as aa; Excel references are not case-sensitive, but converting the text makes the intended format explicit.
With column labels in A2:A5 containing A, Z, AA, and XFD respectively, copy the same formula down beside the list. The results will be 1, 26, 27, and 16,384. The formula is convenient when you need a quick conversion or have a modest list of labels.
There is a trade-off: INDIRECT is a volatile function, meaning Excel recalculates it when the workbook recalculates. A few such formulas are generally straightforward, but a workbook with many thousands of INDIRECT formulas may recalculate more often than necessary. The formula also expects a valid Excel column label; it is not a general-purpose text validator.
Convert a column number back to letters
The reverse conversion can help when a report, script, or calculation supplies a number but a person needs the familiar Excel label. ADDRESS creates a cell address from a row and column number. SUBSTITUTE removes the row number from that address, leaving the column letters.
With a valid column number in A1, enter =SUBSTITUTE(ADDRESS(1,A1,4),"1",""). If A1 contains 27, the result is AA. If A1 contains 16,384, the result is XFD. The 4 argument asks ADDRESS for a relative-style address without dollar signs, and SUBSTITUTE removes the row number 1.
This method is useful for display and labeling, but A1 must contain a whole number from 1 through 16,384 in current Excel. Zero, a negative number, a fraction, or a number beyond the worksheet limit cannot identify a valid column. If inputs come from users or an external system, validate the number before relying on the result.
Convert letters manually or in a script
For one or two conversions, a small reference list may be quicker than writing a formula. For a label with several letters, use the place-value method: take the value of the first letter, then multiply the total by 26 and add the next letter’s value. For example, BC becomes 2 × 26 + 3 = 55. This calculation is also a useful way to check that a formula result is plausible.
If you are converting many labels outside the worksheet, use a method that treats each letter as a digit from 1 to 26 and applies the same multiply-and-add rule. Do not treat the label as a standard base-26 number with digits 0 to 25: that convention produces different results because Excel’s alphabet has no zero. Also distinguish an Excel column label such as AA from a row-and-column address such as AA10; the latter includes both a column and a row.
Worksheet limits and version differences
In Excel for Microsoft 365 on Windows, a worksheet has 16,384 columns, ending at XFD. The numbering rule is consistent across current desktop Excel and Excel for the web, so the conversion formula and examples above apply there as well. Excel for Mac uses the same worksheet column labels and numbering, though menu locations and keyboard shortcuts can differ for tasks unrelated to this conversion.
Older Excel releases have different worksheet limits. Excel 2007 and later use XFD as the final column; Excel 97–2003 worksheets ended at IV, column 256. A label such as XFD therefore cannot identify a column in an older-format worksheet with the older limit. If you exchange files with older software, check the workbook format and the recipient’s Excel version rather than assuming every worksheet supports the modern maximum.
The COLUMN function is not limited to this conversion. When supplied with a reference, it returns that reference’s position in the worksheet. The formula shown here uses INDIRECT because the input is text, not a live cell reference. If you already have a cell reference and want its position, COLUMN can work directly with that reference instead of constructing one from letters.
Common errors and how to avoid them
A correct-looking label can still produce an error if it contains spaces, punctuation, or characters that are not part of a column name. For example, a leading or trailing space in A1 may prevent INDIRECT from interpreting the constructed text as a valid reference. If labels are imported from another source, clean or inspect the input before conversion. Avoid silently deleting characters unless you know they are accidental; changing a label can turn an invalid value into a different, misleading column.
- #REF! usually means the constructed reference is not valid. Check for extra spaces, an invalid label, or a column beyond XFD.
- A result of 1 for A and 27 for AA is expected. Column numbers start at A = 1, not A = 0.
- Lowercase letters such as aa are ordinarily accepted, and UPPER in the example formula makes the case handling clear.
- A numeric-looking input such as 27 is not a column label. Use the reverse conversion when you need to turn that number into AA.
- A row number in the constructed reference is only there to make a cell reference. Changing the appended 1 to another valid row does not change the column number returned.
For a worksheet that must handle unknown input reliably, add a separate check that confirms the entry is text, contains only letters, and names a column within the workbook’s supported range. The basic formula is designed to convert a valid label, not to report every possible input problem with a custom message.
When column-number conversion is useful
Column numbers are useful in formulas and data-processing tasks that need a position rather than a label. For example, a report may store a column name as text, while a calculation needs to know how far that column is from the start of the worksheet. Converting labels to numbers also makes it easier to sort column names in their actual worksheet order: alphabetical text sorting can place labels in an order that does not match numeric column order.
The reverse conversion is handy when a calculation identifies a position and the output needs to show a readable Excel label. It can also help when documenting a wide worksheet, building a column reference for a later step, or checking the boundary of a sheet. Keep the distinction between a column number and a relative position in mind: column 27 is AA on the worksheet, but it may be the first column of a selected range that starts at AA.
Frequently Asked Questions
What number is column AA in Excel?
AA is column 27. A is 1 through Z is 26, so AA is the first column after Z.
How do I convert an Excel column letter to a number?
Put the label in A1 and use =COLUMN(INDIRECT(UPPER(A1)&"1")). For AA in A1, the result is 27.
What is the number of column XFD?
XFD is column 16,384, the final column in current Excel worksheets.
Can Excel convert a column number back to a letter?
Yes. With a valid column number in A1, use =SUBSTITUTE(ADDRESS(1,A1,4),"1",""). If A1 is 27, it returns AA.
Why does Excel show #REF! for a column label?
The text may not form a valid cell reference. Check for spaces or non-letter characters and make sure the label does not exceed the worksheet’s column limit.
Does column A start at zero?
No. Excel counts columns starting at 1: A = 1, B = 2, and Z = 26. This one-based sequence is why AA is 27.
Related
- Excel: Copy Subtotal Rows Only Without Detail Rows
- How to Hyperlink to Another Cell in Excel
- How to Group Rows in Excel and Hide Them
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Sumifs with date range?Learn how SUMIFS handles dates, boundaries, months, extra criteria, and common errors, with clear Excel examples to help…
- Excel Cell Value From List: Find or Select a MatchTo return a value from a list when you know a matching item, use XLOOKUP; with product IDs…
- How to Copy Formulas in Excel on a MacBook Without ErrorsTo copy a formula in Excel on a MacBook, select the cell containing it, press Command+C, select the…
- Excel Filter by Color and Value: How It WorksYes. In Excel for Microsoft 365 on Windows, open a column’s filter menu and choose a color under…
- How to Find a Weighted Average in Excel with SUMPRODUCTTo find a weighted average in Excel, multiply each value by its weight, add those products, then divide…
- Excel XIRR With Dates: Formula, Examples, and FixesTo calculate a return from cash flows that happen on specific, uneven dates, use Excel’s XIRR function: with…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.