+ Reply to Thread
Results 1 to 7 of 7

Thread: Offset??

  1. #1
    Valued Forum Contributor
    Join Date
    04-25-2006
    Posts
    215

    Offset??

    I need to lookup a date in a row header and when the date is found, search down the column and find the largest numeric value and return the value one cell above.

    Not sure where to start with this one.

    Thanks for any help.

    -ep

  2. #2
    Forum Guru Carim's Avatar
    Join Date
    04-07-2006
    Posts
    3,999
    Hi,

    As a first step ... formula should return max ...
    =MAX(INDIRECT(ADDRESS(1,MATCH("yourdate",A1:M1,0))):INDIRECT(ADDRESS(10,MATCH("yourdate",A1:M1,0))))


    HTH
    Carim

  3. #3
    Forum Guru
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Offset would work, the obvious assumption is that the date is unique

    if the dates in the header are in a2:h2, the date is in b1, and the data in a3:h1001

    its a bit horrid and theremay be a better way but

    =OFFSET(A2,MATCH(MAX(OFFSET(A3,0,MATCH(B1,A2:H2,0)-1,1000,1)),OFFSET(A3,0,MATCH(B1,A2:H2,0)-1,1000,1),0)-1,MATCH(B1,A2:H2,0)-1)


    Regards

    Dav

  4. #4
    Valued Forum Contributor
    Join Date
    04-25-2006
    Posts
    215
    Both formulas are returning an error. Am I doing something wrong? I've set the ranges to be identical to the posted formulas.

    -ep

  5. #5
    Forum Guru
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    It works for me, see attached

    Regards

    Dav
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    04-25-2006
    Posts
    215
    Thanks Dav.

    I was able to get it working, but I didn't realize that I probably need to use LARGE instead of MAX as I will need to find the second largest value, the third largest value, etc..

    Thanks again.

  7. #7
    Valued Forum Contributor
    Join Date
    04-25-2006
    Posts
    215
    =OFFSET(B2,MATCH(LARGE(OFFSET(B3,0,MATCH(B1,B2:AF2,0)-1,1000,1),1),OFFSET(B2,0,MATCH(B1,B2:AF2,0)-1,1000,1),0)-2,MATCH(B1,B2:AF2,0)-1)

    Thanks for the help.

+ 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.2.0