+ Reply to Thread
Results 1 to 2 of 2

HLOOKUP finding rows above lookup value.

  1. #1
    Registered User
    Join Date
    12-14-2017
    Location
    Pattaya,Thailand
    MS-Off Ver
    2010
    Posts
    13

    HLOOKUP finding rows above lookup value.

    Hello Excel Forum. I have a user form I want to let users find and edit items from the workbook.

    There is a text field(codeEntry.text) where the users can type or select a product code. Then I need some information to be shown after they clicked on Select Button(cmdSelect1).
    Here is the problem. There are 2 ranges of information I couldn't get from normal HLOOKUP method.
    The data in the text field that I use a lookup value is in row 4 but the data I want to look for are in row 2 and 3. And there is nothing I can do about the layout of the workbook. My boss does not allow any changes.

    The worksheet name is "PPAIs", same as workbook itself.

    Here's a pic.
    Crop1.png

    The text box used to enter a search value is "codeEntry".
    The text box where a value from row 2 will be shown is "showUnit".
    The text box where a value from row 3 will be shown is "showPrice".
    The select button is "cmdSelect1". And the values should be shown after clicked.

    What can I use to get a value from these upper rows?

    Thank you in advance. Any help is appreciated.

    By the way, this is user form.
    Crop2.png

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: HLOOKUP finding rows above lookup value.

    Rather than use HLOOKUP, have a look at using INDEX/MATCH to return the values as it will allow you to look either side of the reference value.

    It works like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And would look something like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The above formula will search in row 3 for the value in cell A1 and return the value from the corresponding column in row 2.

    Hopefully that helps a little.

    If not, attach your workbook and we'll help from there.

    BSB

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HLOOKUP Finding Second Results
    By gassiusmax in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-04-2015, 09:56 AM
  2. Finding/Directing HLOOKUP
    By nilshay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-16-2013, 06:11 AM
  3. [SOLVED] Formula for finding data in one spreadsheet to paste in another, but not hlookup??
    By Tihocan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-16-2013, 05:22 AM
  4. Excel 2010 Finding multiple values for HLookup or VLookup
    By Helmut Kirchner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2013, 12:30 PM
  5. Hlookup, finding max, and returning a name
    By jimmycantler in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-08-2012, 10:46 AM
  6. Finding values between entries in Hlookup
    By Bob Pritchard in forum Excel General
    Replies: 4
    Last Post: 01-11-2012, 01:47 PM
  7. How to use a lookup, hlookup
    By kryt0n in forum Excel General
    Replies: 5
    Last Post: 06-14-2010, 11:13 AM

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