+ Reply to Thread
Results 1 to 6 of 6

HLOOKUP Value not available error

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    aberdeen
    MS-Off Ver
    Excel 2003
    Posts
    4

    HLOOKUP Value not available error

    Hi all,

    I seem to be having trouble with using the HLOOKUP function and i cant understand what im doing wrong.

    I simply want to look up max value (number) in a table row and return the header of that column (a text string).

    My formula is =HLOOKUP(MAX(A2:H2),A1:H1,1,FALSE)

    It just returns #N/A

    Am i being really stupid, i have even just tried the HLOOKUP with out the MAX function in it... =HLOOKUP(B2,A1:H1,1,FALSE)
    It still returns the #N/A

    If i change the formula so that im looking for the Column title and asking it to return a value it works, is it something to do with searching for a number and returning a string?

    Thanks

    Ross

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: HLOOKUP Value not available error

    you need to be able to find the value you're looking up in the range you specify.

    Is max(A2:H2) found within A1:H1?

    CC

  3. #3
    Registered User
    Join Date
    08-05-2009
    Location
    aberdeen
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: HLOOKUP Value not available error

    I basically have a list of values.. say city populations in the cell range A2:H2
    I then want to return the name of the city with the largest population.

    cheers

    r

  4. #4
    Registered User
    Join Date
    08-05-2009
    Location
    aberdeen
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: HLOOKUP Value not available error

    oops i meant to say the range is actually A1:H2 sorry typo

    Ross

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

    Re: HLOOKUP Value not available error

    It sounds as though perhaps you want

    =INDEX(A1:H1,MATCH(MAX(A2:H2),A2:H2,0))

  6. #6
    Registered User
    Join Date
    08-05-2009
    Location
    aberdeen
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: HLOOKUP Value not available error

    ah perfect that works a treat.

    Thanks for that :D

    Ross

+ 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