+ Reply to Thread
Results 1 to 2 of 2

match 3 criteria in 1 table , find a matching row then return value from that row

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    Philadelphia United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    match 3 criteria in 1 table , find a matching row then return value from that row

    Hi
    I have a spreadsheet looks like below
    A B C D E
    Date Register Shift In Charge Amount
    1 04/05/12 Kitchen-1 1 Keyona $300
    2 04/05/12 Kitchen-2 2 Shable $250
    3 04/06/12 Kitchen-1 1 Mark -$100
    4 04/06/12 Kitchen-1 2 Shable $500
    5 04/06/12 Kitchen-1 3 Keyona $300


    I'm using a userform and from a userform user will pick 3 criteria (Date - using a calendar named "cal1", Register - using a combo box named "cmb1"
    and Shift 1,2, or 3 using a combo box named ("cmb2")
    when user picks these 3 criteria I want a matching row and return value on column E on my Label - which I named lbl1)
    I'm not sure if you can do this using excel worksheetfunction also please tell me where to put that code into

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: match 3 criteria in 1 table , find a matching row then return value from that row

    Hi,

    I'd be inclined to create a helper column to the left of your data which concatenates the date, register and shift values into a single string value. This can then be used in a VLOOKUP function. So your code would look something like (untested in the absence of your workbook) -

    Please Login or Register  to view this content.
    I'd put the code above in a code Module and call it either by a button on the userform or in response to the second combobox Enter event - assuming that's the last of the three items to be selected.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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