+ Reply to Thread
Results 1 to 5 of 5

Using INDEX and MATCH to find last used cells with defined names

  1. #1
    Registered User
    Join Date
    06-30-2009
    Location
    Southern California, Earth
    MS-Off Ver
    Excel 2010
    Posts
    72

    Wink Using INDEX and MATCH to find last used cells with defined names

    I have validation lists that pull data from defined names, then I also have a data table that has data on these items. When I drill down with the validation lists, I wanted to populate additional fields with data from this other worksheet. Specifically I wanted to dynamically grab the last two used cells from the data table (slope & intercept).

    I am running into trouble trying to get the correct formula to do so:
    Please Login or Register  to view this content.
    This does not appear to work and I have been playing around with variations in hope to figure it out with no luck. Slope would be offset -1 from the last used column in the data range, and intercept will be the last used column.

    See attached for sample workbook. Thanks in advance.
    Attached Files Attached Files
    Last edited by hoffey; 03-03-2010 at 04:34 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using INDEX and MATCH to find last used cells with defined names

    Do you mean?

    =OFFSET(Items,MATCH(C2,Items,0)-1,11,1,1) for Slppe

    and =OFFSET(Items,MATCH(C2,Items,0)-1,12,1,1) for Intercept
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-30-2009
    Location
    Southern California, Earth
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Using INDEX and MATCH to find last used cells with defined names

    Quote Originally Posted by NBVC View Post
    Do you mean?

    =OFFSET(Items,MATCH(C2,Items,0)-1,11,1,1) for Slppe

    and =OFFSET(Items,MATCH(C2,Items,0)-1,12,1,1) for Intercept
    That did it, thank you. Now I will just set 11 and 12 to defined names so I can easily change all the formulas once new months are added.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using INDEX and MATCH to find last used cells with defined names

    You probably can just do this instead:

    =OFFSET(Items,MATCH(C2,Items,0)-1,COUNTA(Data!$1:$1)-3,1,1)

    and

    =OFFSET(Items,MATCH(C2,Items,0)-1,COUNTA(Data!$1:$1)-2,1,1)

    this offsets a total number of columns equal to the number of columns in row 1 minus 3 and minus 2, respectively.

  5. #5
    Registered User
    Join Date
    06-30-2009
    Location
    Southern California, Earth
    MS-Off Ver
    Excel 2010
    Posts
    72

    Re: Using INDEX and MATCH to find last used cells with defined names

    Thanks again, that worked great.
    Last edited by hoffey; 03-04-2010 at 11:59 AM.

+ 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