Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Alphabetic Column Designation.

Alphabetic Column Designation

Written by Allen Wyatt (last updated July 8, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003


You can easily determine the numeric column of cell by using the COLUMN function. All you need to do is put a formula like this in a cell, and the result is a value where A=1, B=2, etc.:

=COLUMN()

What if you want an alphabetic value, rather than a numeric value? This can be done in any of several different ways. For instance, the following formula will work very nicely for the first 26 columns, A through Z:

=CHAR(COLUMN()+64)

This works because the letters A through Z use character codes 65 through 90. When COLUMN returns a value for columns A through Z (1 through 26), this can be added to 64 to get the letters of those columns, 65 through 90.

Of course, this solution won't work if you want to know the letter designations of columns beyond Z. (Excel can use columns up through IV.) This formula will work for single- and double-character columns:

=IF(COLUMN()<27,CHAR(COLUMN()+64),CHAR((COLUMN()/26)+64)&
CHAR(MOD(COLUMN(),26)+64))

As you can tell, when you get into multiple characters for a column, the formula gets long rather quickly. You can make the formula shorter by using a function other than COLUMN, however. Consider this formula, which relies primarily upon the ADDRESS function:

=LEFT(ADDRESS(1,COLUMN(),4),(COLUMN()>26)+1)

The ADDRESS function returns the address of a specific cell. In this case, it returns the address for the cell in the first row of the current column. Thus, if the formula is in cell BF27, it returns BF1. The formula uses the LEFT function to return the correct number of left-most characters in the address, minus the number 1 for the row.

An even shorter version of the formula relies upon the SUBSTITUTE function instead of the LEFT function:

=SUBSTITUTE(ADDRESS(ROW(),COLUMN(),4),ROW(),"")

This version uses the ROW function to put the address together, and then strips the ROW value out of the result of the ADDRESS function.

Of course, you can also use a macro-based solution, if you want to. The follow macro will work with any column in your worksheet:

Function AlphaCol() As String
    Dim J As Integer
    Dim K As Integer
    Dim iDiv As Integer
    Dim sTemp As String

    Application.Volatile
    J = Selection.Column
    iDiv = 26 ^ 2
    sTemp = ""
    While J > 0
        K = Int(J / iDiv)
        If K > 0 Then sTemp = sTemp & Chr(K + 64)
        J = J - (K * iDiv)
        iDiv = iDiv / 26
    Wend
    AlphaCol = sTemp
End Function

The macro is a user-defined function, which means that you can use it in your worksheets by simply adding this to any cell:

=AlphaCol()

A text string is returned, consisting of the column designation.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3254) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Alphabetic Column Designation.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

How Excel Treats Disk Files

Workbooks are loaded from disk files, but workbooks aren't the only type of files that Excel can load. This tip provides ...

Discover More

Generating a List of Unique Words

Need to grab a list of unique words appearing in a document? You can tap the power of VBA's Words collection to perform ...

Discover More

Determining If a Value is Out of Limits

Need to figure out if a value is outside of some arbitrary limit related to a different value? There are a number of ways ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Deriving a Secant and Cosecant

Two rather common trigonometric functions are secants and cosecants. Excel doesn't provide functions to calculate these, ...

Discover More

Figuring Out the Low-Score Winner

Need to figure out the lowest score in a range of scores? Here's the formulas to get the information you need.

Discover More

Starting Out Formulas

When you enter a formula from the keyboard, Excel only knows it is a formula if you start it with an equal sign. You can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven minus 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.