+ Reply to Thread
Results 1 to 7 of 7

Column Letter Lookup

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    69

    Column Letter Lookup

    Hi there I am trying to find out what column a cell belongs to and return the letter of that column.

    So on sheet 2 it has a list of animals and beside that I want a formula that will match that animal to the animal in the list on sheet 1. So for example the formula next to "Polar Bear" should return the letter "C" as "Polar Bear" is in column C. I have been playing around with this formula and it will work to translate the column number into a column letter. But I don't know how to marry this to a lookup as this formula only takes a specific cell reference.

    SUBSTITUTE(ADDRESS(1,COLUMN('Sheet 1'!A1),4),"1","")

    Thanks so much for your help in advance!

    columnletterlookup.xlsx

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Column Letter Lookup

    Assume you use A3 to enter the animal's name, then you can use this formula if you have less than 27 names on row 1:

    =CHAR(64+MATCH(A3,$1:$1,0))

    Hope this helps.

    Pete

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Column Letter Lookup

    Try this array formula**:

    =SUBSTITUTE(ADDRESS(1,MAX(IF(Sheet1!A$1:E$1=A2,COLUMN(Sheet1!$A$1:$E$1))),4),1,"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Column Letter Lookup

    The array formula will work for any column letter while Pete's suggestion will only work for columns A thru Z.

  5. #5
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Column Letter Lookup

    =substitute(address(1,match(a3,1:1,),4),1,)

  6. #6
    Registered User
    Join Date
    10-10-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Column Letter Lookup

    Thanks everyone so much for your help, this solves it. Tony you are right on the money. I actually needed to use your formula because the example I attached is a simplified version of my document so I do need more than A-Z. I should have specified this initially. But thanks everyone for your responses once again!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Column Letter Lookup

    Take a look at TM's suggestion. It should also work and is a bit simpler.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1