+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Is it possible to return an array using hlookup?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-13-2010
    Location
    Nevada, United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Is it possible to return an array using hlookup?

    Hi

    I am trying to display the best performer for a certain date. This is what the table looks like:


    sales: 1/2/10 1/3/10 1/4/10
    dave 1 2 3
    tim 9 9 9
    jack 1 2 3


    input: date

    output: tim


    I want my formula to look up on a certain date, who the best sales person is.

    What I've used to return the best sales person @ 1/2 is:

    =Offset(
    sales,
    Match( Max ( 1, 9 , 1),
    [1,9,1],
    0
    )

    However, I would like to use Hlookup to go through the dates and put in the ARRAYS for the corresponding dates where " 1, 9, 1" are supposed to be.

    So if I put in 1/2 it would return the array " 2 9 2" and not the values "2 9 2" so this way I don't have to manually change the formula each time I do a search in my data table.


    attached file:Excel Hlookup Help.xlsx
    Last edited by adanglst; 07-15-2010 at 07:29 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Is it possible to return an array using hlookup?

    a workbook would be easier to look at!
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-13-2010
    Location
    Nevada, United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Is it possible to return an array using hlookup?

    Quote Originally Posted by martindwilson View Post
    a workbook would be easier to look at!
    Hi,

    Hmm I attached a sample data set with an explanation of what I'm trying to do. I hope this helps!


    Excel Hlookup Help.xlsx

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Is it possible to return an array using hlookup?

    try
    =INDEX(A10:A15,MATCH(MAX(OFFSET(A10:A15,,MATCH(B3,B9:E9))),OFFSET(A10:A15,,MATCH(B3,B9:E9)),0))

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Is it possible to return an array using hlookup?

    Just to avoid OFFSET, I'd use:
    =INDEX($A$10:$A$15,MATCH(MAX(INDEX($B$10:$E$15,,MATCH(B3,$B$9:$E$9,0))),INDEX($B$10:$E$15,,MATCH(B3,$B$9:$E$9,0)),0))
    You could shorten it with a helper cell storing the MATCH(B3,$B$9:$E$9,0) part.
    Everyone who confuses correlation and causation ends up dead.

  6. #6
    Registered User
    Join Date
    07-13-2010
    Location
    Nevada, United States
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Is it possible to return an array using hlookup?

    thank you works perfectly!

    i used index instead of offset

    this was so much easier with index

    will never use hlookup again lol

+ 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