+ Reply to Thread
Results 1 to 4 of 4

Reverse Column function

  1. #1
    Registered User
    Join Date
    12-02-2009
    Location
    Ocean Grove, Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Reverse Column function

    The Column function returns a number corresponding to the letter header of the column. Is there a function to provide the opposite function, that is, given a number, it returns a letter that can then be used in a formula as a cell address?

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Reverse Column function

    I would use CODE and CHAR

    =CODE("A")
    =CHAR(65)

    or starting from column A.

    =CHAR(COLUMN(A1)+64) can be dragged to the right
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Reverse Column function

    or use indirect with address
    =INDIRECT(ADDRESS(1,1)) which =a1
    =INDIRECT(ADDRESS(2,6)) which =f2
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Reverse Column function

    CHAR has obvious limitations - a safer method is ADDRESS as outlined already, the below

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

    would return the column letter where column number is specified in A1

    However I would make the point that RARELY do you need the letter to create range references given you can use INDEX which will utilise the number.

    Consider:

    A1: 10

    Both

    =INDIRECT(SUBSTITUTE(ADDRESS(1,A1,4),"1","")&"5")

    and

    =INDEX($5:$5,A1)

    will return contents of J5 only the latter is non volatile and is far 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