+ Reply to Thread
Results 1 to 7 of 7

How Can I Use a Column Number (not Letter) in an Excel Formula?

  1. #1
    Registered User
    Join Date
    07-03-2013
    Location
    Monterey, CA
    MS-Off Ver
    Excel 2013
    Posts
    13

    How Can I Use a Column Number (not Letter) in an Excel Formula?

    I want to reference a range that is in column 25 and spans rows 100 to 200. I don't want to switch the mode to R1C1, I just need a way to describe this range in a formula. Seems easy but without creating a UDF to convert column Y to 25 I assume there is an easier way. Mark

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How Can I Use a Column Number (not Letter) in an Excel Formula?

    Not sure exactly what you're looking to do....but
    here's one way:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    07-03-2013
    Location
    Monterey, CA
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: How Can I Use a Column Number (not Letter) in an Excel Formula?

    Forgot to mention that I need to include the tabname, as ranges will vary according to the worksheet name, row and column. Mark

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How Can I Use a Column Number (not Letter) in an Excel Formula?

    On Sheet1
    A1: a tab name to reference......Sheet2
    A2: a column number.................25
    A3: a start row........................100
    A4: an end row........................200

    This formula returns a reference to the range components above
    Please Login or Register  to view this content.
    In that example the formula references: 'Sheet2'!$Y$100:$Y$200

    Is that something you can work with?

  5. #5
    Registered User
    Join Date
    07-03-2013
    Location
    Monterey, CA
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: How Can I Use a Column Number (not Letter) in an Excel Formula?

    Ron, thank you so much for your help, but I get a VALUE# error when I try that.

  6. #6
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: How Can I Use a Column Number (not Letter) in an Excel Formula?

    How about, with the column # in cell A1:

    =INDIRECT("R100C"&A1&":R200C"&A1,FALSE)

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How Can I Use a Column Number (not Letter) in an Excel Formula?

    Yes, you do..
    You're referencing a range via INDIRECT. Were you expecting the cell to display all 101 values?
    If you change A3 to also equal 100, the formula will reference a single cell and you'll get a value instead of and error.
    That formula is not an end unto itself. A structure like that would be typically be referenced by other formulas to return a single value.
    For example, this formula would return the cell value of the 3rd cell in the referenced range:
    =INDEX(INDIRECT("'"&A1&"'!"&ADDRESS(A3,A2)&":"&ADDRESS(A4,A2)),3)

    Does that help?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula required to Auto Increment number based on letter in another column
    By deneh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-01-2015, 05:36 PM
  2. [SOLVED] Convert a dynamic column number into letter within a vba formula
    By XLVBA in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-18-2015, 04:08 PM
  3. a formula to get a cell column letter based on a number
    By luv2glyd in forum Excel General
    Replies: 2
    Last Post: 06-03-2011, 02:52 PM
  4. how to output column letter (not number) with a formula
    By luv2glyd in forum Excel General
    Replies: 3
    Last Post: 12-23-2009, 08:43 PM
  5. formula converting number to column letter >26
    By KR in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2006, 12:35 PM
  6. Replies: 2
    Last Post: 05-09-2005, 04:06 PM
  7. Replies: 1
    Last Post: 03-10-2005, 04:54 AM

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