+ Reply to Thread
Results 1 to 4 of 4

Return specific value if two conditions are met

  1. #1
    Registered User
    Join Date
    03-11-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    1

    Return specific value if two conditions are met

    I'm creating an attendance tracker based and I want to populate the cells in the Calendar tab with data from the Log tab.

    Basically, in each cell, I want to return the code that matches both the date and the employee's name, if an entry for that employee on that date exists at all.

    Sorry if I didn't explain very well - I've been fighting with Excel for 2 days and am not clear-minded at all when it comes to functions right now.
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return specific value if two conditions are met

    Try:

    =IFERROR(INDEX(Log!$C$2:$C$4,MATCH(1,INDEX((Log!$A$2:$A$4=B$1)*(Log!$B$2:$B$4=$A2),0),0)),"")

    copied down and across.. adjust ranges to suit.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-10-2011
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Return specific value if two conditions are met

    Hey NBVC do you know why =IF(LOOKUP($A2,Log!$B$2:$B$4,Log!$A$2:$A$4)=B$1,"Yes","No") wouldn't work for this? It seems to error out to 0 for 9/3/2011 but works for the others...
    When helped,use the icon right of the post #.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Return specific value if two conditions are met

    Two things.

    Lookup requires the lookup array to be listed in ascending alphabetic or numeric order to work properly and Lookup looks for the last time any of the lookup range cell values is equal to or smaller than the lookup value. So after sorting, it will look only for the last Jane Doe, not both.

+ 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