+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Getting The Array Element of a Formula from a Different Cell

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Getting The Array Element of a Formula from a Different Cell

    Hi

    I have a simple formula searching for the smallest number in 5 cell:

    =SMALL(A1:A5,1)

    What I would like to do is have this formula reference to another 2 cells which will provide the start row and end row number of the array (i.e. the 1 and the 5). That way i could change it to A7:A1000 or A3:A75 for example. If I make B1 and B2 the start row and end row cells, how could i rewrite the above formula to do this.

    Doug
    Last edited by boohah; 05-13-2009 at 03:28 AM.

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

    Re: Getting The Array Element of a Formula from a Different Cell

    Use INDEX

    =SMALL(INDEX(A:A,B1):INDEX(A:A,B2),1)

    (the above would be preferable to INDIRECT and or OFFSET which may also be suggested given both are Volatile)

    EDIT: I should add that the above approach INDEX:INDEX gives the impression of Volatility but is not in fact Volatile.

  3. #3
    Registered User
    Join Date
    01-23-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Getting The Array Element of a Formula from a Different Cell

    Hi Donkey

    I actually tried exactly that method before i posted my question as you had shown me the same technique weeks ago. The reason why I didnt run with that idea is that I have a second column with corresponding values and I need the result of that formula in order to calculate the corresponding value in a second column. Lets say that I use your formula in cell B3:

    =SMALL(INDEX(A:A,B1):INDEX(A:A,B2),1)

    Lets also say that I wanted to find the corresponding value in column C. I would then use the following formula:

    =INDEX(C:C,MATCH(B3,INDEX(A:A,B1):INDEX(A:A,B2),0)+1)

    Unfortunately when I do this I get errors:

    "This function has multiple argument lists. Please select one of them."

    Any Ideas?

    Doug

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

    Re: Getting The Array Element of a Formula from a Different Cell

    Your last formula works fine for me (XL2007) ... though without seeing your setup you may need to adjust the C range along similar lines ?

  5. #5
    Registered User
    Join Date
    01-23-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: Getting The Array Element of a Formula from a Different Cell

    Hi Donkey

    You are right mate, it would have worked. The +1 at the end of the last formula is only correct when sampling from row 1 to row 5. It needs to change as the range changes and that is what is screwing it up. As always I appreciate your help when I am ready to tear my hair out. Thanks mate.

    Doug

+ 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