+ Reply to Thread
Results 1 to 11 of 11

Returning Alphabet Instead of Number

  1. #1
    Registered User
    Join Date
    11-10-2007
    Posts
    35

    Returning Alphabet Instead of Number

    Hello one and all, I understand that the column function returns the number position of the column instead of the alphabet as described in the Excel Help Documentation.

    =COLUMN(C10) gives 3

    However, the interesting question now is how do I return the alphabet "C" instead of "3".

    Any help would be greatly appreciated.

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Try this

    Please Login or Register  to view this content.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    The previous post will only work to Column Z of course.

    If you extend beyond that use the Address function in conjunction with Substitite:

    =SUBSTITUTE(ADDRESS(1,COLUMN(AA1),2),"$1","")

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    why would you do that?if you know its column c just use c
    Last edited by martindwilson; 01-10-2009 at 06:31 AM.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    I think more pertinent question is why you need the letter returned in the first instance ? Column letters are rarely (if ever) required for anything.

    This Q arises most commonly in VBA circles as the Macro Recorder tends to imply that Range should be qualified via: Range("A1:D1") style whereas in fact in VBA R1C1 notation is the way to go - eg Range(Cells(1,1),Cells(1,4)) does the same thing and offers greater flexibility to the programmer.

    Let us know.

  6. #6
    Registered User
    Join Date
    11-10-2007
    Posts
    35

    Thumbs up

    martindwilson: Your assumption is based on simple excel work, however, I'm going one step further by employing =concatenate , =match , =column functions into my works.
    Also, one of the things that I'm doing involves dragging through the row of cells in order to have the alphabets changed. To just use C is no longer automation because I have to manually input it across the row that results in tediousness.

    Shijesh Kumar: thanks! you are a genius. I'm sticking to the code that you have provided.

    DonkeyOte: many thanks too though I have not tried the code.
    Last edited by shrooms; 01-10-2009 at 06:45 AM.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    As I said you rarely (ever) need the letter -- please post up the formula in which you are utilising said letter value as I suspect it can/should be reworked... it sounds as though it may be ADDRESS that you really need to use ... say you're trying to return the address of where a match is found...

    so let's assume:

    header criteria in cells -- B1:AA1
    row criteria in cells A2:A100

    you want to find intersect of header criteria & row criteria and return the cell reference as opposed to the value within said cell:

    =ADDRESS(MATCH(row criteria,A2:A100,0)+1,MATCH(hdr criteria,B1:AA1,0)+1)

    would return Address of resulting intersect point in terms of $F$10 etc...you can toggle optional Abs_Num parameter of Address to remove $ etc..)

  8. #8
    Registered User
    Join Date
    11-10-2007
    Posts
    35
    DonkeyOte: Thanks for the assistance provided. However, Shijesh Kumar has already provided the solution that I'm looking for. I believe your solution would produce the same answer too. As for the further ramifications, I had like to solve it on my own presuming I don't get stuck.
    Last edited by shrooms; 01-10-2009 at 07:07 AM.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    The solution you are using is flawed in that it will not work beyond column Z.

    Try using Shijesh Kumar's formula with: COLUMN(AA1)

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    i think you really need to pay attention to donkeyote, ther are tried and tested ways of incrementing rows colums in all sorts of directions!

  11. #11
    Registered User
    Join Date
    11-10-2007
    Posts
    35
    Oh. thats right. The address function is indeed a more powerful tool than the char function. Thanks DonkeyOte. I'll use yours instead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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