In Excel, columns have both letter references and number positions: A is 1, Z is 26, AA is 27, and the final column, XFD, is 16,384. To return a cell’s column number in a worksheet, use Excel’s COLUMN function with that cell as its reference.
What an Excel column number means
A column number is the column’s position counted from the left edge of the worksheet, starting at 1. Excel displays column labels as letters, but many formulas and programming tasks work with the underlying numeric position. The number is a fixed part of the grid: a blank column still has a column number, and adding or deleting data within a worksheet does not renumber the columns.
Column numbers are useful when you need to build formulas that change according to a cell’s position, identify a column in a large worksheet, or translate between a letter-based reference such as AB and a numeric position. They are also the basis for functions and tools that ask for a relative column index. That index may count from the start of a selected range rather than from the worksheet’s first column, so it is important to check what a particular function expects.
How Excel counts columns
Excel’s letters follow a sequence that resembles a base-26 numbering system, but there is no zero digit. After Z, Excel starts a two-letter label at AA. The first letter advances after the second letter cycles through A to Z. When the two-letter labels end at ZZ, the labels continue as AAA.
Here are useful reference points:
- A = 1, B = 2, and C = 3.
- Z = 26, AA = 27, and AB = 28.
- AZ = 52, BA = 53, and ZZ = 702.
- AAA = 703, and XFD = 16,384, the last column in current Excel worksheets.
This explains why a column label is not simply a letter code. For example, the position of AB is 26 × 1 + 2, or 28. For longer labels, each letter’s place matters, and the lack of a zero label is why conversions need care around boundaries such as Z-to-AA.
Get a column number from a cell
The COLUMN function returns the worksheet column number for a cell reference. With the cell to identify in C5, enter =COLUMN(C5); the result is 3 because C is the third worksheet column. The cell can be empty—the function reads its position, not its contents. If the reference is a range, COLUMN returns an array of column numbers in versions and formula contexts that support array results.
If you want the number of the column containing the formula itself, enter the formula in D7 and use =COLUMN(); it returns 4. With no argument, COLUMN refers to the cell in which the formula is entered. This can be handy in formulas copied across a row, because the result changes as the formula moves from one column to another.
On Windows, you can enter a formula by selecting a cell, typing an equals sign and the function, then pressing Enter. Excel for Mac uses the same COLUMN syntax and the same modern worksheet column numbering. Excel for the web also uses the same grid and formula. These formula examples do not require a special ribbon setting.
Convert column letters to a number
If a cell contains a column label as text, COLUMN can convert it after INDIRECT turns the label into a cell reference. Suppose A2 contains the text AB. Enter =COLUMN(INDIRECT(A2&"1")) in B2; the result is 28. The appended 1 makes the text AB1 a valid cell reference, and COLUMN returns the position of its column.
INDIRECT is convenient for a quick conversion, but it has a drawback: it is a volatile function, which means Excel recalculates it more often than many ordinary functions. It also returns an error if the text does not form a valid reference, such as a misspelled label or a label beyond the worksheet’s final column. Use a clean label such as XFD, without a dollar sign or extra spaces, for this particular formula. If the text comes from an uncontrolled source, validate it before relying on the result.
For a one-off conversion, the reference points above may be quicker than a formula. For repeated conversions, placing labels in a column and using the formula next to them makes the results easier to audit and update.
Convert a column number to letters
To convert a numeric position to its Excel letter label, use ADDRESS to create a cell address and SUBSTITUTE to remove its row number. Suppose A2 contains the number 28. Enter =SUBSTITUTE(ADDRESS(1,A2,4),"1","") in B2; the result is AB. In this formula, ADDRESS uses row 1 and column 28, and its third argument, 4, requests a relative-style address without dollar signs. SUBSTITUTE removes the row number from the resulting address.
The number in A2 must be a valid worksheet column number: an integer from 1 through 16,384. A value of 1 produces A, 26 produces Z, and 16,384 produces XFD. Zero, negative values, decimals, and numbers above the worksheet limit are not valid column positions for this purpose. If the input is calculated from other cells, check that it is an integer in range before using the converted label.
Column number versus range position
A common source of confusion is the difference between a worksheet column number and a position inside a selected range. For example, the worksheet column number for D is 4. But D is the third column of the range B:D. A function asking for a column index within B:D would use 3 to refer to D, not 4.
This distinction matters when using functions that take a relative position, such as INDEX. A worksheet reference such as D5 identifies a particular cell by its column letter and row number; a numeric index may instead mean “the third item in this range.” Before substituting a number into a formula, check whether it is meant to identify a whole-sheet column or a position counted from the range’s left edge.
Similarly, a number displayed in a cell is not automatically a column reference. The value 28 in A2 is just data until a formula interprets it as a column position. ADDRESS can turn it into a reference-style label, while COLUMN can return a number from a reference. Keeping the direction of the conversion clear helps prevent off-by-one mistakes.
Worksheet limits and older file formats
Current Excel worksheets have 16,384 columns, from A through XFD, and 1,048,576 rows. These limits apply to modern Excel workbook formats and to current versions of Excel for Windows, Mac, and the web. They are worksheet-grid limits, not a statement about how many columns a particular table or dataset must use.
Older Excel 97–2003 workbook files use the earlier .xls worksheet limit of 256 columns, ending at IV, and 65,536 rows. If a workbook is saved in that older format, its grid capacity is smaller. When working with a legacy file, do not assume that XFD is available; the file format and compatibility behavior matter. Saving a copy in a modern .xlsx format may be appropriate if the workbook needs the larger grid, though compatibility with older software should be considered.
Column numbers also should not be confused with Excel’s column letters in formulas. A reference like $AB$5 uses dollar signs to make its column and row absolute when a formula is copied; it is still a reference to column AB, whose worksheet number is 28. The dollar signs affect how the reference adjusts during copying, not the column’s position.
Common problems and useful checks
- Expecting AA to be 26: Z is 26, so AA is 27. Excel does not use a zero column.
- Counting from a selected range: A worksheet column number starts at A; an index within a range starts at the range’s first column.
- Using the wrong input type: COLUMN expects a cell or range reference. Text such as AB is not itself a reference unless it is converted, for example with INDIRECT.
- Including extra characters: A label with spaces, punctuation, or an invalid row reference may not form a usable address in an INDIRECT conversion.
- Going past the grid: XFD is 16,384. A larger number cannot identify a column in a current Excel worksheet.
If a conversion returns an error, first check the input value and the intended counting method. Confirm that a letter label is spelled correctly, that a numeric position is a whole number within the worksheet limit, and that the formula is interpreting a worksheet column rather than a range-relative index. For a formula copied across cells, also check whether the reference should be relative or fixed; adding dollar signs changes how it moves, not its column number.
Frequently Asked Questions
What number is column AA in Excel?
AA is column 27. Z is column 26, and AA is the first label after Z.
What is the last column number in Excel?
In current Excel worksheets, the last column is XFD, number 16,384. Older .xls workbooks have a smaller limit and end at IV, number 256.
How do I find the number of the column I am in?
Enter =COLUMN() in a cell. It returns the number of the column containing that formula, such as 4 when entered in column D.
How do I turn a column number into a letter?
Use ADDRESS to create a reference from the number and SUBSTITUTE to remove its row number. If A2 contains 28, =SUBSTITUTE(ADDRESS(1,A2,4),"1","") returns AB.
Is a column number the same as a column index?
Not always. A worksheet column number counts from A, while an index inside a range counts from that range’s first column. For example, D is worksheet column 4 but the third column in B:D.
Related
- Excel Data Validation: Copy Rules Quickly and Safely
- Add to a Data Validation List in Excel: Step-by-Step
- Find and Replace in Excel: Select Data First
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Copying Text from Excel to Word: Formatting, Links and TablesTo copy cells from Excel into Word, select the cells, press Ctrl+C in Excel, place the cursor in…
- How to Delete Blank Rows in an Excel Table SafelyTo delete blank rows in an Excel table, first identify rows that are genuinely empty, then remove the…
- Excel File Name Length Limit: What Counts?For Excel for Microsoft 365 on Windows, the practical documented limit is 218 characters for the full path…
- Convert Text to Number in Excel Cells: Quick FixesTo convert text to numbers in Excel, select the affected cells and click the warning icon, then choose…
- Convert Text to Number in Excel Faster: Quick MethodsTo convert text-stored numbers quickly in Excel for Microsoft 365 on Windows, select the cells and use the…
- Excel Sum Filtered List: SUBTOTAL and SUMTo sum only the rows currently visible after filtering in Excel, use =SUBTOTAL(109,B2:B6), assuming the values are in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.