+ Reply to Thread
Results 1 to 4 of 4

Hlookup Issue

  1. #1
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    Hlookup Issue

    I'm trying to get back on my sheet the department name for a user id I have in either sheet1's data or sheet 2's data.

    But everytime I do a Hlookup it goes N/A when it should display "E&T Aero" as department for the number given in the example.

    At the moment it's N/A but if I put in the "TRUE" reference it does the last column of the arrays header.

    Any help or a new technique how to get it to lookup appreciated, Thanks
    Attached Files Attached Files
    Last edited by kieranbop; 11-10-2011 at 07:21 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,415

    Re: Hlookup Issue

    That's not how an HLOOKUP works.

    It looks for the search item in the first row of the defined range. If it finds it, it returns the element in the row specified in the same column as the search item.

    You could use a User Defined Function (UDF), for example:

    Please Login or Register  to view this content.

    Called by, for example, =fDeptLookup(B2,D2)

    where B2 has the search item and D2 has the sheet name.


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    09-08-2011
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    157

    Re: Hlookup Issue

    Thanks very much for that, I had it in the wrong place to start with then realised it had to be in a module
    Last edited by kieranbop; 11-10-2011 at 07:21 AM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,415

    Re: Hlookup Issue

    See attached.

    It's not a standard Excel function ... it's been coded to address your problem.

    Regards

+ 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