+ Reply to Thread
Results 1 to 5 of 5

vlookup using multiple conditions

  1. #1
    Registered User
    Join Date
    02-24-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    47

    vlookup using multiple conditions

    attached is a very condensed version of a file that I need to lookup multiple criteria. i tried using an index and match, but couldn't get it to work.

    essentially what i need is to enter a formula on tab 'main' c2 that lookups and matches the array table 'payroll'.

    for example, on jan 2, agent Tom worked 8 hours
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: vlookup using multiple conditions

    =SUMPRODUCT((Payroll!$A$2:$A$13=Main!A2)*(Payroll!$B$2:$B$13=Main!B2)*(Payroll!$C$2:$C$13))

    Tom is listed twice for Jan 2. He worked a total of 9 hours.

    Assuming all records are unique and there are no duplicate entries as there are in the example, you could use a few other options:

    =LOOKUP(2,1/((Payroll!$A$2:$A$13=Main!A2)*(Payroll!$B$2:$B$13=Main!B2)),Payroll!$C$2:$C$13)

    OR

    Array Formulas

    =INDEX(Payroll!$C$2:$C$13,MATCH(A2&B2,Payroll!$A$2:$A$13&Payroll!$B$2:$B$13,0))
    =INDEX(Payroll!$C$2:$C$13,MATCH(A2, IF(Payroll!$B$2:$B$13=B2,Payroll!$A$2:$A$13),0))

    * Array formulas are confirmed with Ctrl+Shift+Enter


    They all do similar functions. SUMPRODUCT will add up everything that meets the criteria. INDEX will match to the first record that meets criteria, and LOOKUP will match to the last. Assuming unique entries, everything is the same.
    Last edited by daffodil11; 04-28-2014 at 02:23 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

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

    Re: vlookup using multiple conditions

    Try the below formula in cell C2 on the "Main" worksheet.

    =IFERROR(INDEX(Payroll!A$2:C$13,MATCH(1,(Payroll!A$2:A$13=A2)*(Payroll!B$2:B$13=B2),0),3),"")

    It's an array formula so must be confirmed with Ctrl+Shift+Enter rather than just Enter.

    EDIT: Oops, didn't notice the duplication of names on the same date. That means my formula doesn't work, unless that was an error..

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: vlookup using multiple conditions

    I assume it was an accidental oversight in generating sample data.

  5. #5
    Registered User
    Join Date
    02-24-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: vlookup using multiple conditions

    correct, the duplicate data was an error

+ 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. Multiple conditions for vlookup
    By phasesmu in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-20-2014, 04:49 PM
  2. [SOLVED] Vlookup - Country conditions (Multiple conditions)
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-26-2013, 11:42 AM
  3. Vlookup with multiple conditions
    By aljl11 in forum Excel General
    Replies: 5
    Last Post: 01-22-2011, 11:50 AM
  4. vlookup over multiple conditions
    By Khalique Ahmed in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-25-2010, 09:16 AM
  5. Vlookup with Multiple conditions
    By Amgcasale in forum Excel General
    Replies: 4
    Last Post: 08-18-2009, 01:24 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