Excel column letter to numbers

Earlier, we learnt how to convert the column number to the letter. But how do we convert column letter to number in excel? In this article, we learn to convert excel column to number.
0038
So we have a function named COLUMN that returns the column number of supplied reference. We will use the COLUMN function with INDIRECT function to get the column number from a given column letter.
Generic Formula to convert letters to numbers in excel

Col_letter: it is the reference of the column letter of which you want to get column number.
Var2:

Let’s see an example to make things clear.
Example: Create an excel column letter to number converter
Here we have some column letters in B2:B5. We want to get corresponding column number (1, 2, 3, etc.) from that given letter (A, B, C, etc.).
0039
Apply the above generic formula here to get column number of a given letter.

Copy it down. You will have the column number of the given column letter in B2:B5.
0040
How does it work?
Well, it is very simple. The idea is to get the first cell’s reference from the given column number. And then use COLUMN function to get the column number of a given column letter.
Here, INDIRECT(B2&»1″) translates to INDIRECT(“A1″). This then gives us the cell reference of A1.
Eventually, we get COLUMN(A1), which then returns the column number of a given column letter.

So yeah, this is how to convert a column letter into a column index number. This is quite easy. Let me know if you have any doubt regarding this function or any other function in advanced excel. The comments section is all yours.

 
Download file:

 
Related Articles:

How to Convert Excel Column Number To Letter

Popular Articles:

The VLOOKUP Function in Excel

COUNTIF in Excel 2016

How to Use SUMIF Function in Excel

Return to Excel Formulas List

Download Example Workbook

Download the example workbook

This tutorial demonstrates how to convert a column letter to number in Excel.

Convert Column Letter to Number Main Function

Converting Column Letter to Number

To get the number of a column letter in Excel, we will use the COLUMN and INDIRECT Functions.

=COLUMN(INDIRECT(B3&1))

LETTER TO NUMBER

INDIRECT Function

The INDIRECT Function converts a string of text corresponding to a cell reference, into the actual cell reference.

=INDIRECT("A1")

Indirect

COLUMN Function

The cell reference is then passed to the COLUMN Function, which returns the number of the column.

=COLUMN(Cell Reference)

To illustrate, let’s see some examples below.

=COLUMN(A1) has a result of 1.  This is because the cell reference “A1” is in column number 1.

=COLUMN(B1) has a result of 2.  This is because the cell reference “B1” is in column number 2.

=COLUMN(H1) has a result of 8.  This is because the cell reference “H1” is in column number 8.

REF 02 EX 01

REF 02 EX 02

Convert Column Letter to Number in Google Sheets

The combination of COLUMN and INDIRECT Functions works exactly the same in Google Sheets as in Excel:

Convert Column Letter to Number Go

My Comments

ARich gives a good solution and shows the method I used for a while but Sancarn is right, its not optimal. It’s a little slower, will cause errors if the wrong input is given, and is not very robust. Sancarn is on the right track, but lacks a little error checking: for example, getColIndex(«_») and getColIndex(«AE»), will both return 31. Other non-letter characters (ex: «*») sometimes return various negative values.

Working Function

Here is a function I wrote that will convert a column letter into a number. If the input is not a column on the worksheet, it will return -1 (unless AllowOverflow is set to TRUE).

Function ColLetter2Num(ColumnLetter As String, Optional AllowOverflow As Boolean) As Double
'Converts a column letter to a number (ex: C to 3, A to 1, etc). Returns -1 if its invalid.
' @ColumnLetter - the letter(s) to convert to a number.
' @AllowOverflow - if TRUE, can return a number greater than the max columns.
    On Error GoTo invalidCol
    If Len(ColumnLetter) = 0 Then GoTo invalidCol
    Dim thisChar As String
    For i = 1 To Len(ColumnLetter) 'for each character in input
        thisChar = Mid(ColumnLetter, i, 1) 'get next character
        If Asc(UCase(thisChar)) >= 65 And Asc(UCase(thisChar)) <= 90 Then 'if the character is a letter
            ColLetter2Num = ColLetter2Num + (26 ^ (Len(ColumnLetter) - i)) * (Asc(UCase(thisChar)) - 64) 'add its value to the return
        Else
            GoTo invalidCol 'if the character is not a letter, return an error
        End If
        If AllowOverflow = False And (ColLetter2Num = 0 Or ColLetter2Num > Columns.Count) Then
        'if the value is not inside the bounds of the sheet, return an error and stop
invalidCol:
            ColLetter2Num = -1 'error
            Exit Function 'stop checking
        End If
    Next i
End Function
Examples
 Sub test()
        Debug.Print ColLetter2Num("A") 'returns 1
        Debug.Print ColLetter2Num("IV") 'returns 256        (max columns for excel 2003 and prior))
        Debug.Print ColLetter2Num("XFD") 'returns -1        (invalid because IV is the last column for .xls workbooks)
        Debug.Print ColLetter2Num("XFD", True) 'returns 16384 (does not return -1 because AllowOverflow = TRUE)
        Debug.Print ColLetter2Num("A_", True) 'returns -1   (invalid because "_" is not a column)
        Debug.Print ColLetter2Num("132", True) 'returns -1  (invalid because "1" is not a column)
        
        If ColLetter2Num("A") <> -1 Then
            Debug.Print "The input is a valid column on the sheet."
        Else
            Debug.Print "The input is NOT a valid column on the sheet."
        End If
    End Sub

Summary

To convert a column letter to an regular number (e.g. 1, 10, 26, etc.) you can use a formula based on the INDIRECT and COLUMN functions.

In the example shown, the formula in C5 is:

=COLUMN(INDIRECT(B5&"1"))

Generic formula

=COLUMN(INDIRECT(letter&"1"))

Explanation 

The first step is to construct a standard «A1» style reference using the column letter, by adding a «1» with concatenation:

B5&"1"

This results in a text string like «A1» which is passed into the INDIRECT function.

Next, the INDIRECT function transforms the text into a proper Excel reference and hands the result off to the COLUMN function.

Finally, the COLUMN function evaluates the reference and returns the column number for the reference.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi — I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.

Related Information

There are hundreds and hundreds of Excel sites out there. I’ve been to many and most are an exercise in frustration. Found yours today and wanted to let you know that it might be the simplest and easiest site that will get me where I want to go.

Get Training

Quick, clean, and to the point training

Learn Excel with high quality video training. Our videos are quick, clean, and to the point, so you can learn Excel in less time, and easily review key topics when needed. Each video comes with its own practice worksheet.

View Paid Training & Bundles

Help us improve Exceljet

Содержание

  1. Convert numbers stored as text to numbers
  2. 1. Select a column
  3. 2. Click this button
  4. 3. Click Apply
  5. 4. Set the format
  6. Other ways to convert:
  7. 1. Insert a new column
  8. 2. Use the VALUE function
  9. 3. Rest your cursor here
  10. 4. Click and drag down
  11. Convert Column Letter to Number – Excel & Google Sheets
  12. Converting Column Letter to Number
  13. INDIRECT Function
  14. COLUMN Function
  15. Convert Column Letter to Number in Google Sheets
  16. How to number columns in Excel and convert column letter to number
  17. How to return column number in Excel
  18. How to convert column letter to number (non-volatile formula)
  19. Change column letter to number using a custom function
  20. Return column number of a specific cell
  21. Get column letter of the current cell
  22. How to show column numbers in Excel
  23. How to number columns in Excel
  24. Converting column letter to number [duplicate]
  25. 5 Answers 5

Convert numbers stored as text to numbers

Numbers that are stored as text can cause unexpected results, like an uncalculated formula showing instead of a result. Most of the time, Excel will recognize this and you’ll see an alert next to the cell where numbers are being stored as text. If you see the alert, select the cells, and then click to choose a convert option.

Check out Format numbers to learn more about formatting numbers and text in Excel.

If the alert button is not available, do the following:

1. Select a column

Select a column with this problem. If you don’t want to convert the whole column, you can select one or more cells instead. Just be sure the cells you select are in the same column, otherwise this process won’t work. (See «Other ways to convert» below if you have this problem in more than one column.)

2. Click this button

The Text to Columns button is typically used for splitting a column, but it can also be used to convert a single column of text to numbers. On the Data tab, click Text to Columns.

3. Click Apply

The rest of the Text to Columns wizard steps are best for splitting a column. Since you’re just converting text in a column, you can click Finish right away, and Excel will convert the cells.

4. Set the format

Press CTRL + 1 (or + 1 on the Mac). Then select any format.

Note: If you still see formulas that are not showing as numeric results, then you may have Show Formulas turned on. Go to the Formulas tab and make sure Show Formulas is turned off.

Other ways to convert:

You can use the VALUE function to return just the numeric value of the text.

1. Insert a new column

Insert a new column next to the cells with text. In this example, column E contains the text stored as numbers. Column F is the new column.

2. Use the VALUE function

In one of the cells of the new column, type =VALUE() and inside the parentheses, type a cell reference that contains text stored as numbers. In this example it’s cell E23.

3. Rest your cursor here

Now you’ll fill the cell’s formula down, into the other cells. If you’ve never done this before, here’s how to do it: Rest your cursor on the lower-right corner of the cell until it changes to a plus sign.

4. Click and drag down

Click and drag down to fill the formula to the other cells. After that’s done, you can use this new column, or you can copy and paste these new values to the original column. Here’s how to do that: Select the cells with the new formula. Press CTRL + C. Click the first cell of the original column. Then on the Home tab, click the arrow below Paste, and then click Paste Special > Values.

If the steps above didn’t work, you can use this method, which can be used if you’re trying to convert more than one column of text.

Select a blank cell that doesn’t have this problem, type the number 1 into it, and then press Enter.

Press CTRL + C to copy the cell.

Select the cells that have numbers stored as text.

On the Home tab, click Paste > Paste Special.

Click Multiply, and then click OK. Excel multiplies each cell by 1, and in doing so, converts the text to numbers.

Press CTRL + 1 (or + 1 on the Mac). Then select any format.

Источник

Convert Column Letter to Number – Excel & Google Sheets

Download the example workbook

This tutorial demonstrates how to convert a column letter to number in Excel.

Converting Column Letter to Number

To get the number of a column letter in Excel, we will use the COLUMN and INDIRECT Functions.

INDIRECT Function

The INDIRECT Function converts a string of text corresponding to a cell reference, into the actual cell reference.

COLUMN Function

The cell reference is then passed to the COLUMN Function, which returns the number of the column.

To illustrate, let’s see some examples below.

=COLUMN(A1) has a result of 1. This is because the cell reference “A1” is in column number 1.

=COLUMN(B1) has a result of 2. This is because the cell reference “B1” is in column number 2.

=COLUMN(H1) has a result of 8. This is because the cell reference “H1” is in column number 8.

Convert Column Letter to Number in Google Sheets

The combination of COLUMN and INDIRECT Functions works exactly the same in Google Sheets as in Excel:

Источник

How to number columns in Excel and convert column letter to number

by Svetlana Cheusheva, updated on March 9, 2023

The tutorial talks about how to return a column number in Excel using formulas and how to number columns automatically.

Last week, we discussed the most effective formulas to change column number to alphabet. If you have an opposite task to perform, below are the best techniques to convert a column name to number.

How to return column number in Excel

To convert a column letter to column number in Excel, you can use this generic formula:

For example, to get the number of column F, the formula is:

And here’s how you can identify column numbers by letters input in predefined cells (A2 through A7 in our case):

Enter the above formula in B2, drag it down to the other cells in the column, and you will get this result:

How this formula works:

First, you construct a text string representing a cell reference. For this, you concatenate a letter and number 1. Then, you hand off the string to the INDIRECT function to convert it into an actual Excel reference. Finally, you pass the reference to the COLUMN function to get the column number.

How to convert column letter to number (non-volatile formula)

Being a volatile function, INDIRECT can significantly slow down your Excel if used broadly in a workbook. To avoid this, you can identify the column number using a slightly more complex non-volatile alternative:

This works perfectly in dynamic array Excel (365 and 2021). In older version, you need to enter it as an array formula (Ctrl + Shift + Enter) to get it to work.

=MATCH(A2&»1″, ADDRESS(1, COLUMN($1:$1), 4), 0)

Or you can use this non-array formula in all Excel versions:

=MATCH(A2&»1″, INDEX(ADDRESS(1, INDEX(COLUMN($1:$1), ), 4), ), 0)

How this formula works:

First off, you concatenate the letter in A2 and the row number «1» to construct a standard «A1» style reference. In this example, we have letter «A» in A2, so the resulting string is «A1».

Next, you get an array of strings representing all cell addresses in the first row, from «A1» to «XFD1». For this, you use the COLUMN($1:$1) function, which generates a sequence of column numbers, and pass that array to the column_num argument of the ADDRESS function:

Given that row_num (1st argument) is set to 1 and abs_num (3rd argument) is set to 4 (meaning you want a relative reference), the ADDRESS function delivers this array:

Finally, you build a MATCH formula that searches for the concatenated string in the above array and returns the position of the found value, which corresponds to the column number you are looking for:

Change column letter to number using a custom function

«Simplicity is the ultimate sophistication,» stated the great artist and scientist Leonardo da Vinci. To get a column number from a letter in an easy way, you can create your own custom function.

Fully in line with the above principle, the function’s code is as simple as it can possibly be:

Insert the code in your VBA editor as explained here, and your new function named ColumnNumber is ready for use.

The function requires just one argument, col_letter, which is the column letter to be converted into a number:

Your real formula can be as follows:

If you compare the results returned by our custom function and Excel’s native ones, you will make sure they are exactly the same:

Return column number of a specific cell

To get a column number of a particular cell, simply use the COLUMN function:

For instance, to identify the column number of cell B3, the formula is:

Obviously, the result is 2.

Get column letter of the current cell

To find out a column number of the current cell, use the COLUMN() function with an empty argument, so it refers to the cell where the formula is:

=COLUMN()

How to show column numbers in Excel

By default, Excel uses the A1 reference style and labels column headings with letters and rows with numbers. To get columns labeled with numbers, change the default reference style from A1 to R1C1. Here’s how:

  1. In your Excel, click File >Options.
  2. In the Excel Options dialog box, select Formulas in the left pane.
  3. Under Working with formulas, check the R1C1 reference style box, and click OK.

The column labels will immediately change from letters to numbers:

Please note that selecting this option will not only change column labels — cell addresses will also change from A1 to R1C1 references, where R means «row» and C means «column». For example, R1C1 refers to the cell in row 1 column 1, which corresponds to the A1 reference. R2C3 refers to the cell in row 2 column 3, which corresponds to the C2 reference.

In existing formulas, cell references will update automatically, while in new formulas you will have to use the R1C1 reference style.

Tip. To revert back to A1 style, uncheck the R1C1 reference style check box in Excel Options.

How to number columns in Excel

If you are not used to the R1C1 reference style and want to keep A1 references in your formulas, then you can insert numbers in the first row of our worksheet, so you have both — column letters and numbers. This can be easily done with the help of the Auto Fill feature.

Here are the detailed steps:

  1. In A1, type number 1.
  2. In B1, type number 2.
  3. Select cells A1 and B1.
  4. Hover the cursor over a small square in the lower right corner of cell B1, which is called the Fill handle. As you do this, the cursor will change to a thick black cross.
  5. Drag the fill handle to the right up to the column you need.

As a result, you will retain the column labels as letters, and underneath the letters you will have the column numbers.

Tip. To keep the columns numbers in view while scrolling to the below areas of the worksheet, you can freeze top row.

That’s how to return column numbers in Excel. I thank you for reading and look forward to seeing you on our blog next week!

Источник

Converting column letter to number [duplicate]

I found code to convert number to column letter.

How can I convert from column letter to number?

5 Answers 5

You can reference columns by their letter like this:

So to get the column number, just modify the above code like this:

The above line returns an integer (1 in this case).

So if you were using the variable mycolumn to store and reference column numbers, you could set the value this way:

And then you could reference your variable this way:

or to reference a cell ( A1 ):

or to reference a range of cells ( A1:A10 )you could use:

The answer given may be simple but it is massively sub-optimal, because it requires getting a Range and querying a property. An optimal solution would be as follows:

To see the numerical equivalent of a letter-designated column:

My Comments

ARich gives a good solution and shows the method I used for a while but Sancarn is right, its not optimal. It’s a little slower, will cause errors if the wrong input is given, and is not very robust. Sancarn is on the right track, but lacks a little error checking: for example, getColIndex(«_») and getColIndex(«AE»), will both return 31. Other non-letter characters (ex: «*») sometimes return various negative values.

Working Function

Here is a function I wrote that will convert a column letter into a number. If the input is not a column on the worksheet, it will return -1 (unless AllowOverflow is set to TRUE).

Источник

This post will guide you how to convert column letter to number in Excel. How do I convert letter to number with a formula in Excel. How to convert column letter to number with VBA macro in Excel. How to use a User Defined Function to convert letter to number in Excel.

  • Convert Column Letter to Number with a Formula
  • Convert Column Letter to Number with VBA Macro
  • Convert Column Letter to Number with User Defined Function
  • Convert Number to Column Letter
  • Video: Convert Column Letter to Number

Table of Contents

  • Convert Column Letter to Number with a Formula
  • Convert Column Letter to Number with VBA Macro
  • Convert Column Letter to Number with User Defined Function
  • Convert Number to Column Letter
    • Related Functions

Convert Column Letter to Number with a Formula


If you want to convert a column letter to a regular number, and you can use a formula based on the COLUMN function and the INDIRECT function to achieve the result.

For example, you need to convert a column letter in Cell B1 to number

Just like this:

=COLUMN(INDIRECT(B1&1))

Type this formula into a blank cell such as: C1, and press Enter key, and then drag the AutoFill Handle over to other cells to apply this formula.

convert column letter to number1

The INDIRECT function will convert the text into a proper Excel reference and then pass the result to Column function to get the column number for the reference.

Convert Column Letter to Number with VBA Macro


You can also use an Excel VBA Macro to achieve the result of converting column letter into its corresponding numeric value. Just do the following steps:

#1 open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.

Get the position of the nth using excel vba1

#2 then the “Visual Basic Editor” window will appear.

#3 click “Insert” ->”Module” to create a new module.

convert column number to letter3

#4 paste the below VBA code into the code window. Then clicking “Save” button.

convert column letter to number2

Sub ConvertColumnLetterToNumber()
    Dim myRng As Range
    Dim cNum As Double
    Set myRng = Application.Selection
    Set myRng = Application.InputBox("select one range that contain column letters", "ConvertColumnLetterToNumber", myRng.Address, Type:=8)

    For Each myCell In myRng
            cNum = Range(myCell & 1).Column
            myCell.Resize(1).Offset(0, 1) = cNum
    Next
End Sub

#5 back to the current worksheet, then run the above excel macro. Click Run button.

convert column letter to number3

#6 select one range that contain column letters, such as B1:B4

convert column letter to number4

#7 let’s see the result:

convert column letter to number5

Convert Column Letter to Number with User Defined Function


Excel does not have a built in formula to convert column letter to a numeric number, but you can write down a User Defined Function to achieve the result. Just do the following steps:

#1 repeat the above step 1-3

#2 paste the below VBA code into the code window. Then clicking “Save” button.

convert column letter to number6

Function ConvertLetterToNum(ColumnLetter As String) As Double
    Dim cNum As Double
        
    'Get Column Number from Alphabet
    cNum = Range(ColumnLetter & "1").Column
    
    'Return Column Number
    ConvertLetterToNum = cNum
End Function

#3 back to the current worksheet, then type the following formula in a blank cell. press Enter key.

=ConvertLetterToNum(B1)

#4 select the cell C1, and  drag the AutoFill Handle over to other cells to apply this formula.

convert column letter to number7


If you want to convert column number to an Excel Column letter, you can use another formula based on the SUBSTITUTE function and the ADDRESS function. Just like this:

=SUBSTITUTE(ADDRESS(1,C1,4),"1","")

Type this formula into Cell D1, and press Enter key. And then drag the AutoFill handle over to other cells to apply this formula.

Let’s see the last result:

convert column letter to number8

Video: Convert Column Letter to Number


  • Excel Substitute function
    The Excel SUBSTITUTE function replaces a new text string for an old text string in a text string.The syntax of the SUBSTITUTE function is as below:= SUBSTITUTE  (text, old_text, new_text,[instance_num])….
  • Excel ADDRESS function
    The Excel ADDRESS function returns a reference as a text string to a single cell.The syntax of the ADDRESS function is as below:=ADDRESS (row_num, column_num, [abs_num], [a1], [sheet_text])….
  • Excel INDIRECT function
    The Excel INDIRECT function returns the cell reference based on a text string, such as: type the text string “A2” in B1 cell, it just a text string, so you can use INDIRECT function to convert text string as cell reference….
  • Excel COLUMN function
    The Excel COLUMN function returns the first column number of the given cell reference.The syntax of the COLUMN function is as below:=COLUMN ([reference])….

This tutorial explains how to convert column number to column letter, and convert column letter to column number in Excel.

Column number refers to the column expressed in integer, while column letter refers to column expressed in alphabet.

For example, for Cell D1, column number is 4, while column letter is D.

Excel convert column number to column letter

To convert column number to column letter, make use of Address Function, which combines column number and row number and convert to a Cell address with column letter (such as A1).

Syntax of  Excel Address Function

ADDRESS( row, column, [abs_num], [a1], [sheet_text] )

Example

Assume that you have a column number 4, you want to convert to letter D.

Formula Value Explanation
Step 1 =ADDRESS(1,4,4) D1 Put a dummy row number 1 in address, return relative reference
Step 2 =SUBSTITUTE(ADDRESS(1,4,4),1,””) D Replace 1 as nothing

Excel convert column letter to column number

To convert column number to column letter, make use of Indirect Function, which turns a Text into Reference.

Assume that you have a column letter D, you want to convert to number 4.

=COLUMN(INDIRECT("D1"))

VBA custom Function – convert column letter to column number

This Function takes an argument ColNm (colNm means column name, e.g. A,B,C) and return column number.

VBA code

Public Function wColNum(ColNm)
    wColNum = Range(ColNm & 1).Column
End Function

Explanation of VBA code

Take colNm = A as example

– use dummy row number 1 to create a Range(A1)

– return column number of Range(A1)

Example

Formula Result
=wColNum(“D”) 4
=wColNum(“AA”) 27

VBA custom Function – convert column number to column letter

This Function takes an argument ColNum (colNum means column number, e.g. 1,2,3) and return column name (A,B,C)

VBA code

Public Function wColNm(ColNum)
    wColNm = Split(Cells(1, ColNum).Address, "$")(1)
End Function

Explanation of VBA code

Take ColNum = 1 as example

– use dummy row number 1 to create a dummy Cells(1,1)

– return the address Cells(1,1), which is $A$1

– Split $A$1 by $, get the array item (1)

Example

Formula Result
=wColNm(1) A
=wColNm(27) AA

Outbound References

https://support.office.com/en-us/article/address-function-47657e92-81ae-47f8-87cd-62d4f30c774d?ui=en-US&rs=en-US&ad=US&fromAR=1

Excel enables us to convert letters to numbers and numbers to letters. In this tutorial, we will learn how to convert letters to numbers and vice versa using the SUBSTITUTE function, COLUMN function, and VBA.

Figure 1 – Example of how to convert column letter to a number

How to Convert Column Letter to number

  • We will prepare our table as shown in the figure below

Figure 2 – Letter to number

  • We will highlight Cell C4 and insert the formula below in the formula bar

=COLUMN(INDIRECT(B4&"1"))

  • We will press the Enter Key

Figure 3 – Using COLUMN Function to convert letters to a number

  • We will click on Cell C4 and drag down the fill handle tool to copy the formula down the column.

Figure 4 – Column letter to a number

Using VBA to Convert Column Letter to a Column Number

  • Again, we will prepare a table as shown in the figure below

Figure 5 – Setting up data to convert letters to numbers

  • We will press ALT + F11 to open the Microsoft Visual Basic Applications window

Figure 6 – Using VBA to convert column letter

  • Next, we will go to Insert and Select Module
  • In the blank space, we will enter the formula below:

Public Function ToColNum(ColN)

   ToColNum = Range(ColN & 1).Column

End Function

Figure 7 – Convert column letter to number using VBA

  • We will save the code and go back to the worksheet
  • We will enter the formula below in Cell C4

=Tocolnum("A")

Where A is the content of Cell B4

Figure 8 – Return with column letter in excel

  • We will press Enter

Figure 9 – Excel column letter to a number

  • Again, to get the column value for the content of Cell C5, we will enter the formula

=Tocolnum("BA")

Where BA is the content of Cell B5

Figure 10 – Letter to the column number  

  • We will press the Enter key

Figure 11 – Excel column letter to a number

  • We will have this result

Figure 12 – Excel returns with a column number

How to Convert Column Number to Column Letter

  • We will prepare our table as shown in the figure below

Figure 13 – Setting up data for converting column number to letter

  • We will click on Cell C4 and insert the formula below in the formula bar

=SUBSTITUTE(ADDRESS(1,B4,4),"1","")

  • We will press the Enter Key

Figure 14 – Convert column number to letter

  • We will click again on Cell C4. Next, we will use the fill handle tool to drag down the formula into other cells in Column C

Figure 15 – Excel returns with column letter

How to Convert Column Number to Column Letter Using VBA

  • We will create a table as shown below

Figure 16 – Setting up data for converting number to letter in excel

  • We will press ALT + F11 to open the Microsoft Visual Basic Applications window
  • Next, we will go to the Insert tab and Select Module
  • In the blank space, we will enter the formula below

Public Function ToColletter(Collet)

   ToColletter = Split(Cells(1, Collet).Address, "$")(1)

End Function

Figure 17 – Excel Column number to letter using VBA

  • Next, we will go back to the worksheet and enter the formula below in Cell C4

=Tocolnum("1")

Where 1 is the content of Cell B4

Figure 18 – Convert column number to letter using VBA

  • We will press the enter key

Figure 19 – Excel convert column number to letter

  • Again, to convert Cell B5, we will enter the formula below into Cell C5

=ToColletter(23) 

Where 23 is the content of Cell B5

  • We will press the enter key

Figure 20 – Convert letter to a number

  • In the end, we will have this result

Figure 21 – VBA for column number to letter

Instant Connection to an Excel Expert

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Like this post? Please share to your friends:
  • Excel column letter to number one
  • Excel column is number not letter
  • Excel column into row
  • Excel column in numbers not letters
  • Excel column format number