Find last column number and convert to letter in Excel

You are currently viewing Find last column number and convert to letter in Excel

In Excel, to find the last column number in the range and then convert the number to column letter, you can use the MIN, COLUMN and COLUMNS functions and nest the formula in the SUBSTITUTE and ADDRESS functions.

I have the following range B1:20 as shown below:

Dataset

Now in G1, I want to construct a formula that finds the last column number in the range B1:20 and then converts the number to the column letter.

To accomplish the task, I use a formula based on the MIN, COLUMN and COLUMNS functions to find the last column number in the range, like so:

=MIN(COLUMN(B1:D20))+COLUMNS(B1:D20)-1

The formula returns the number 4. To convert the number to the column letter, I use a formula based on the SUBSTITUTE and ADDRESS functions, like so:

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

The formula returns the letter D. To combine both the formulas into one formula, I replace G1 in the second formula with the first formula, like so:

=SUBSTITUTE(ADDRESS(1,MIN(COLUMN(B1:D20))+COLUMNS(B1:D20)-1,4),"1","")

Finding last column number and converting to letter

You have successfully found the last column number in the range and then converted the number to the column letter! I hope this post helped you.

Download Practice Workbook

Kunal

Hey, I am Kunal Aggarwal, the founder and author of Kunal Excel Tip based in New Delhi, India. I have completed my postgraduation from NIIT Limited, New Delhi in Excel course in 2019. Since then, I have been using and learning Microsoft Excel and started writing posts on the spreadsheet software here since March 2024.

Leave a Reply