Column AA is number 27, and Excel's last column, XFD, is number 16,384
Excel column letters run from A to Z (columns 1 to 26), then continue as AA, AB and so on with two letters, and from AAA with three. So A is column 1, Z is 26, AA is 27, ZZ is 702 and AAA is 703. Microsoft gives the size of an Excel worksheet as 1,048,576 rows by 16,384 columns, which makes XFD, the last column, number 16,384.
The converter above keeps the column-letter box and the column-number box in step: type in either one and the other follows. It also reads cell addresses such as AA10 or $AA$10 and R1C1 addresses such as R10C27, and shows the row and the other notation next to the result. The sheet-heading strip shows the columns around your choice and, if you add a table range, the position you would give VLOOKUP. Further down you get formulas, VBA and Python filled in for the column you picked, and a box that converts a whole list in one go.
When you need to switch between column letters and numbers
- Giving VLOOKUP or INDEX a column number: the third argument of VLOOKUP, col_index_num, counts from the first column of the range you pass in, not from column A. Microsoft's own example: for B2:D11, B counts as 1 and C as 2. If your range starts at column C, column F is number 4, not 6, so you need the sheet's column number and the position inside the range, and they are different numbers.
- Writing a macro in VBA: Cells(row, column) takes the column as a number. To point at AA10 you write Cells(10, 27). When a macro gives you a column number, you often have to turn it back into the letter a person would recognise.
- Opening a workbook whose headings show numbers: with the R1C1 reference style on, Excel labels the columns 1, 2, 3 and writes addresses such as R10C27. If a colleague says "column 27", or you are sent a sheet full of addresses like that, you need to read them as column AA.
- Reading or writing Excel files from code: openpyxl counts columns from 1, but pandas iloc and JavaScript arrays count from 0. The same column AA is 27 in one and 26 in the other, and if you do not match them you end up reading the column next to the one you wanted.
- Saving as the old .xls format: Excel 97–2003 files stop at column IV, number 256. Microsoft's Compatibility Checker warns that data beyond 65,536 rows by 256 columns will not be saved, so check how far right your data goes before saving a wide sheet as .xls.
How to use it
- Type a column letter in the left box or a column number in the right box. Lowercase aa and full-width AA are read as AA. The box you typed in is the source, and the other one follows it.
- You can paste a cell address as it is. AA10 and $AA$10 are read as column AA, row 10; R10C27 is read as row 10, column 27. The result line shows the same cell in the other notation.
- The "Sheet headings" strip shows your column and the ones beside it, the way Excel's grid does. The top line is the usual heading (A1 style), the bottom line the number you see in R1C1 style. Click a heading, or select the strip and press ← →, to move one column; PageUp and PageDown move 26.
- Enter a range such as B:F or B2:F100 in "Table range" and the strip shades it, then shows which position your column has inside that range, with a ready-made VLOOKUP formula.
- Under "Formulas and code", pick the Excel · Google Sheets, VBA or Python tab to get lines filled in for the current column. The button beside each line copies it.
- For a list, paste it into "Many at once". One per line or a row copied from Excel (tab-separated) both work: each item is converted in the same place and order. Anything that cannot be converted stays as ? and the line is named. "Copy as two columns" joins the original and the converted value with a tab, so they paste straight into two Excel columns.
How it is calculated: base 26 with no zero
- Letter values: A = 1, B = 2, …, Z = 26. Ordinary base 26 would use 0 to 25, but column letters have no symbol for 0.
- Letters to number: starting from the left, repeat "running total × 26 + value of the next letter". For XFD, X = 24, F = 6 and D = 4, so (24 × 26 + 6) × 26 + 4 = 16,384. Written out by place value, that is 24 × 676 + 6 × 26 + 4 × 1 = 16,224 + 156 + 4.
- Number to letters: subtract 1 from the number and divide by 26. The remainder gives the right-most letter (remainder 0 = A, 25 = Z). Repeat with the quotient until it reaches 0. For 703: 702 ÷ 26 = 27 remainder 0 → A; 27 − 1 = 26 ÷ 26 = 1 remainder 0 → A; 1 − 1 = 0, remainder 0 → A, and the quotient is now 0. The answer is AAA.
- Why subtract 1: with no zero, Z (26) stays a single letter instead of rolling over to something like "10". The next column then adds a place and becomes AA (1 × 26 + 1 = 27). If you divide without subtracting 1, 26 splits into a leading A plus a zero digit that has no letter.
- How many columns per letter count: there are 26 one-letter columns and 26 × 26 = 676 two-letter columns (27 to 702). Three letters could give 26³ = 17,576 columns, but Excel stops at XFD, so only the 15,682 columns from 703 to 16,384 exist. The "Where it sits on the sheet" scale above shows these three bands on a log scale.
Column letter and number reference tables
| Column | Number | Column | Number | Column | Number | Column | Number |
|---|---|---|---|---|---|---|---|
| A | 1 | H | 8 | O | 15 | V | 22 |
| B | 2 | I | 9 | P | 16 | W | 23 |
| C | 3 | J | 10 | Q | 17 | X | 24 |
| D | 4 | K | 11 | R | 18 | Y | 25 |
| E | 5 | L | 12 | S | 19 | Z | 26 |
| F | 6 | M | 13 | T | 20 | ||
| G | 7 | N | 14 | U | 21 |
| Column | Number | Column | Number | Column | Number | Column | Number |
|---|---|---|---|---|---|---|---|
| AA | 27 | HA | 209 | OA | 391 | VA | 573 |
| BA | 53 | IA | 235 | PA | 417 | WA | 599 |
| CA | 79 | JA | 261 | QA | 443 | XA | 625 |
| DA | 105 | KA | 287 | RA | 469 | YA | 651 |
| EA | 131 | LA | 313 | SA | 495 | ZA | 677 |
| FA | 157 | MA | 339 | TA | 521 | ||
| GA | 183 | NA | 365 | UA | 547 |
| Column | Number | What it is |
|---|---|---|
| Z | 26 | Last one-letter column |
| AZ | 52 | Last column that starts with A |
| CV | 100 | Column 100 |
| IV | 256 | Last column in Excel 97–2003 (.xls) |
| IW | 257 | First column that .xls does not have |
| ZZ | 702 | Last two-letter column |
| AAA | 703 | First three-letter column |
| ALL | 1,000 | Column 1,000 |
| NTP | 10,000 | Column 10,000 |
| XFD | 16,384 | Last column in Excel 2007 and later formats |
Column headings showing numbers: the R1C1 reference style
If Excel shows 1, 2, 3 instead of A, B, C above the columns, and formulas look like =R2C3, the R1C1 reference style is switched on. It numbers both rows and columns, with R followed by the row number and C followed by the column number. Microsoft's formula overview says the style is useful for computing row and column positions in macros, and that when you record a macro, some commands are recorded in R1C1 style.
- Turning it off in Excel for Windows: go to File > Options > Formulas and, under "Working with formulas", clear the "R1C1 reference style" check box.
- Turning it off in Excel for Mac: on the Excel menu choose Preferences, then under "Formulas and Lists" choose Calculation, and clear "Use R1C1 reference style".
- It only changes how addresses are shown: switching it on or off does not change any value or the cell a formula points to, only how headings and addresses are written.
| A1 style | R1C1 style | Meaning |
|---|---|---|
| $AA$10 | R10C27 | Cell in row 10, column 27 (AA), absolute |
| $B$2 | R2C2 | Cell in row 2, column 2, absolute |
| $C:$C | C3 | The whole of column 3 |
| (relative to this cell) | R[-2]C | The cell two rows up in the same column (relative) |
| (relative to this cell) | R[2]C[2] | The cell two rows down and two columns right (relative) |
A relative reference with brackets, such as R[-2]C, depends on the cell that holds the formula, so it cannot be turned into an A1 address without knowing that cell. This converter only handles fixed addresses with plain numbers, like R10C27.
Formulas for Excel, Google Sheets, VBA and Python
| What you want | Formula or code | Result |
|---|---|---|
| Column letter → number | =COLUMN(AA1) | 27 |
| Letter typed in cell A2 → number | =COLUMN(INDIRECT(A2&"1")) | 27 |
| Number → column letter | =SUBSTITUTE(ADDRESS(1,27,4),"1","") | AA |
| Row and column → A1 address | =ADDRESS(10,27,4) | AA10 |
| Row and column → R1C1 address | =ADDRESS(10,27,1,FALSE) | R10C27 |
| VBA: letter → number | Range("AA1").Column | 27 |
| VBA: number → letter | Split(Cells(1, 27).Address, "$")(1) | AA |
| Python (openpyxl): letter → number | column_index_from_string("AA") | 27 |
| Python (openpyxl): number → letter | get_column_letter(27) | AA |
- COLUMN returns the column number of the cell you give it. The row number is irrelevant, so =COLUMN(AA100) is also 27. With empty parentheses, =COLUMN() gives the column of the cell holding the formula.
- ADDRESS takes 4 as its third argument to mean relative row and column, so it builds "AA1" without any $ signs. Setting the fourth argument to FALSE builds an R1C1 address instead. Google Sheets' ADDRESS uses the same argument order and the same values (4 = relative row and column, FALSE = R1C1).
- The SUBSTITUTE formula is correct only because the row is fixed at 1. With another row, such as =SUBSTITUTE(ADDRESS(21,27,4),"1",""), "AA21" loses its 1 and becomes "AA2", so always leave the row argument as 1.
- In VBA, Range.Address returns an absolute reference such as "$AA$1" unless you say otherwise, so the second piece after splitting on $ is the column letter. Call Address(ReferenceStyle:=xlR1C1) to get R1C1 notation.
- openpyxl counts from 1 in both functions. If you need a zero-based position, for example for pandas iloc, subtract 1: column AA becomes 26.
Counting the column inside a table range (VLOOKUP and INDEX)
The third argument of VLOOKUP is the position counted from the left-most column of the range. In Microsoft's example, if the range is B2:D11, B counts as 1 and C as 2. So the position is "number of the column you want − number of the range's first column + 1", and in Excel you can calculate it with =COLUMN(F1)-COLUMN(C1)+1. The column number you give INDEX is counted the same way.
| Table range | Column wanted | Working | Position |
|---|---|---|---|
| C:F | F | 6 − 3 + 1 | 4 |
| B2:D11 | C | 3 − 2 + 1 | 2 |
| Y:AD | AA | 27 − 25 + 1 | 3 |
| A:Z | Z | 26 − 1 + 1 | 26 |
| H:AK | AF | 32 − 8 + 1 | 25 |
Only when the range starts in column A is the position the same as the sheet's column number. If you insert or delete a column inside the range, a position you typed into VLOOKUP does not change by itself, so it is safer to calculate it with a COLUMN formula.
Last column by program and file format
| Program or format | Last column | Columns | Rows |
|---|---|---|---|
| Excel 2007 and later (.xlsx, .xlsm, .xlsb) | XFD | 16,384 | 1,048,576 |
| Excel 97–2003 (.xls) | IV | 256 | 65,536 |
| Google Sheets | No column limit in Google's help | — | — |
Microsoft's compatibility page says that Excel 97–2003 is 65,536 rows by 256 columns and that data outside those limits is not saved. Google's Drive help gives the size limit for a spreadsheet as 20 million cells (or 100MB) and does not list a limit on columns. The converter works up to XFD (column 16,384), the Excel limit.
Basis: Microsoft's "Excel specifications and limits" and compatibility pages and Google's Drive storage help, checked on 21 October 2026. How letters map to numbers is plain arithmetic and does not change.
Common mistakes
- Assuming BA comes after Z: thinking "9, then 10" makes BA feel natural, but the column after Z is AA. BA is column 53.
- Passing the sheet's column number to VLOOKUP: with the range C:F, entering 6 for column F asks for the sixth column of a four-column range, and Microsoft says you get #REF! when the number is larger than the range is wide. With a wider range you may instead pick up the wrong column. The right value is 4.
- Mixing in zero-based indexes: a 26 coming from code may really be AA, which is column 27. The result lines show the zero-based value as well, so you can see which one you have.
- Changing the row in the SUBSTITUTE formula: if the first argument of ADDRESS is not 1, any 1 in the row number is stripped too, and you are left with the wrong letters.
- Typing letter O or I as digit 0 or 1: column names do use O and I (IO is column 249). Typing the digit 0 or 1 instead gives a different column, or an address like "I0" that means row 0 and produces an error.
Limitations
- Only columns A to XFD (1 to 16,384) and rows 1 to 1,048,576 of an Excel worksheet are converted. For letters beyond that, such as XFE, the tool only tells you which number they would be and does not use it as a result.
- Relative R1C1 references like R[-2]C, defined names and references to another sheet such as 'Sheet1'!A1 are not read. The table range box uses only the columns and ignores row numbers.
- "Many at once" converts the column part of each item. A cell address like AA10 becomes column number 27, and R10C27 becomes column letter AA; the row is dropped.
- The formulas on screen are written for Excel and Google Sheets with commas between arguments. If your copy of Excel uses semicolons there, replace the commas with ;.
- Your input is worked out in your browser only and is not sent anywhere. "Copy link" puts the current values into the address.
Sources
- 01Microsoft Support — Excel specifications and limitsTotal rows and columns on a worksheet: 1,048,576 rows by 16,384 columns — checked 2026-10-21
- 02Microsoft Support — Worksheet compatibility issuesExcel 97-2003 is 65,536 rows by 256 columns; data beyond that is not saved
- 03Microsoft Support — Overview of formulas in ExcelR1C1 reference style: File > Options > Formulas > Working with formulas, R[-2]C and R[2]C[2] examples, macro recording
- 04Microsoft Support — My column headings are labeled with numbers instead of letters in Excel for MacClear the R1C1 reference style selection in Excel preferences
- 05Microsoft Support — COLUMN functionReturns the column number of a reference
- 06Microsoft Support — ADDRESS functionabs_num 4 = relative, a1 argument FALSE = R1C1 style (=ADDRESS(2,3,1,FALSE,…) gives R2C3)
- 07Microsoft Support — SUBSTITUTE functionReplaces text in a string
- 08Microsoft Support — INDIRECT functionTurns a reference written as text into a real reference
- 09Microsoft Support — VLOOKUP functioncol_index_num counts from the left-most column of the range; #REF! if it exceeds the number of columns
- 10Microsoft Learn — Range.Address property (Excel VBA)RowAbsolute and ColumnAbsolute default to True ($A$1); ReferenceStyle xlR1C1
- 11Microsoft Learn — Range.Column property (Excel VBA)Returns the number of the first column of the first area in the range
- 12Google Docs Editors Help — ADDRESSabsolute_relative_mode 4 = relative row and column, use_a1_notation FALSE = R1C1
- 13Google Drive Help — Files you can store in Google DriveGoogle Sheets: up to 20 million cells or 100MB; no column limit is listed
- 14openpyxl — openpyxl.utils.cellget_column_letter and column_index_from_string (counting from 1)
Frequently asked questions
What number is column AA in Excel?
Column AA is number 27. A to Z are columns 1 to 26, and the column after Z is the first two-letter one, AA, so 26 + 1 = 27. AZ is column 52, BA is 53 and ZZ is 702.
What is the last column in Excel, and what number is it?
In Excel 2007 and later formats (.xlsx and so on) the last column is XFD, number 16,384. Microsoft lists a worksheet as 1,048,576 rows by 16,384 columns. The older Excel 97–2003 format (.xls) stops at column IV, number 256, and data further right is not saved in an .xls file.
What Excel formula turns a column number into a letter?
Use =SUBSTITUTE(ADDRESS(1,27,4),"1",""). ADDRESS(1,27,4) builds the relative address "AA1" for row 1, and SUBSTITUTE removes the 1, leaving "AA". Keep the row at 1: with row 21 you would get "AA21" and end up with "AA2". Google Sheets' ADDRESS takes the same arguments.
What formula turns a column letter into a number?
Put a reference to a cell in that column inside COLUMN: =COLUMN(AA1) returns 27. The row number does not affect the result. If the letters are typed as text in cell A2, use =COLUMN(INDIRECT(A2&"1")).
My Excel column headings show numbers instead of letters. Why?
The R1C1 reference style is switched on. In Excel for Windows go to File > Options > Formulas and, under "Working with formulas", clear the "R1C1 reference style" check box, and the headings go back to A, B, C. On a Mac, choose Excel > Preferences > Calculation and clear "Use R1C1 reference style". An address that reads R10C27 in this style is cell AA10.
Why does the column after Z come out as AA and not BA?
Column letters have no symbol for zero. A to Z stand for 1 to 26, so instead of writing "10" after 9 as in decimal, the next column adds a place and becomes AA (1 × 26 + 1 = 27). That is why, going from a number to letters, you subtract 1 and divide by 26 at each step.
Is the column number VLOOKUP asks for the same as the number in this converter?
Only if the range starts in column A. VLOOKUP's col_index_num is the position counted from the first column of the range you pass in, while this converter gives the position counted across the whole sheet. In the range C:F, column F is 6 − 3 + 1 = 4. Enter the range in the "Table range" box above and it works the position out for you.
How do I convert in VBA or Python?
In VBA, Range("AA1").Column returns 27 and Split(Cells(1, 27).Address, "$")(1) returns "AA". In Python with openpyxl, column_index_from_string("AA") returns 27 and get_column_letter(27) returns 'AA'. If you need a zero-based position, as with pandas iloc, subtract 1 and use 26.