+ Reply to Thread
Results 1 to 4 of 4

how to define the range of cells for a formula that changes over time

  1. #1
    Registered User
    Join Date
    08-14-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    how to define the range of cells for a formula that changes over time

    This is hard to explain. I want to know if there's a way to write an excel formula where the range within the formula SUM will change over time. I've got an investment index with all the constituents listed in excel. I'm organizing them into price-to-earnings quintiles and analyzing their performance. It's complicated by the fact that every month there are varying # of stocks whose P/E is "#N/A" because their earnings are negative. I've set up formulas to automatically calculate the range of rows I will need to group them by excluding the negative earnings stocks. So my question is how do I get that row # together with a column letter in a formula that uses a range of cells so that every month I don't have to manually adjust it?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to define the range of cells for a formula that changes over time

    If you wanted a formula that would look at the number you placed in A1 and display the value of that row from column B, a couple of ways to do it would be:

    =INDEX(B:B, A1)

    =INDIRECT("B" & A1)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-14-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: how to define the range of cells for a formula that changes over time

    I just found what I was looking for. I searched for keywords "dynamic cell ranges" and came up with the OFFSET function which worked for me. Thank you anyway. i'll take a look at those 2 functions you mentioned regardless.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to define the range of cells for a formula that changes over time

    Ha! I actually debated adding the OFFSET() as a third option and decided against it, considering unnecessarily complex for this. Good job, if you got that working, you'll get the other two even quicker.

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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