Consulting

Results 1 to 6 of 6

Thread: Hlookup returns wrong field

  1. #1

    Hlookup returns wrong field

    Hello Guys,

    This spreedsheet is driving me nuts. Here is my problem:

    Row eleven starting at G uses this formula:
    =HLOOKUP(I10,$G$3:$AB$4,2)

    Pretty much what the formula says, or atleast hope it says is "Look at cell I10, if the figure in I10 matches a cell in the array G3 through AB4 then put down the figure that is below the matching one.

    Row 12 is a simple if two cells match then True, if not False.

    Anyways, as you can see from the picture I have the same formula in row 11, cells G11 and H11 match but I11 does not. It has the same word as I3 but is pulling the information as if it was matching to the cell in G3.

    Help!!!!


  2. #2
    here is the file.

    I am stumped.

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It needs to be ordered if range_lookup is TRUE. You could try

    =HLOOKUP(G10,$G$3:$AB$4,2,FALSE)

    which assumes you will always match.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    If Data is not ascending, use "False" to get exact match
    =HLOOKUP(G10,$G$3:$AB$4,2,FALSE)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    That's it guy. Hugs and kisses!

  6. #6
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,058
    Location
    Now there's some encouragement to learn VBA....
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •