+ Reply to Thread
Results 1 to 2 of 2

HLOOKUP not working? (at least, not the way I thought it would)

  1. #1
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147

    HLOOKUP not working? (at least, not the way I thought it would)

    I typically use the "False" statement in any lookup so I get exact matches, but today I came across a problem where I need the closest match. I thought setting the HLOOKUP to "TRUE" would give me closest match, but nope...

    Here is my array:

    Row1: 0 45 27 1
    Row2: 2 3 4 5

    My hlookup formula is uses the value "28" as my look-up value, and scans the above array to return the value in row 2. Since I had it set to "TRUE" I expected it to return the value of 4 since in Row1 the number 27 is closest to 28.

    Nope, I get 5... in fact it consistently seems to return only the last column.

    So is there some formula out there that would return the value of 4 in the above example, i.e. be smart enough to find the number in row1 that was closest to 28?

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    With any of the lookups that are not being exact, you need to have the lookup array ordered properly and it doesn't necessarily do the closest but rather the first larger or the first smaller (i.e. 26 would return you to 1 not 27)

    Your array would have to be changed to...

    0,1,27,45
    2,5,4,3

    Then you would get the appropriate response...

    Hope that helps...

+ 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