+ Reply to Thread
Results 1 to 8 of 8

Index Match with 3 Criteria

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    69

    Index Match with 3 Criteria

    Hi there,

    I have a holiday calendar for work where I want the days of the week of the calendar to show whether the employee will be here or not. I have attached a document to give you some idea of what's going on, so on the 'leave dates' sheet is where you go to enter periods when people will be away, and then on the 'calendar' sheet it should display the corresponding text of whether the employee will be away or not for certain dates. So the formula in the day cells needs to check 3 criteria:

    1) do a match on the employee name
    2) check whether the given calendar date is greater than or equal to the start date of the leave
    3) check whether the given calendar date is less than or equal to the finish date of the leave

    As you can see I have tried an index match array formula and it's just not working for me:

    Please Login or Register  to view this content.
    It's important the formula brings back the status column value (column D). Thanks so much for your help in advance it is much appreciated!


    example-index-match.xlsx

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Index Match with 3 Criteria

    Put in B3:

    =IFERROR(INDEX('leave dates'!$D$2:$D$4,MATCH(1,('leave dates'!$A$2:$A$4=$A3)*(B$1>='leave dates'!$B$2:$B$4)*(B$1<='leave dates'!$C$2:$C$4),0)),"")

    and then press CTRL-SHIFT-ENTER, and then copied cross and down
    Attached Files Attached Files

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Index Match with 3 Criteria

    Try this array formula** entered in B3:

    =IFERROR(INDEX('leave dates'!$D$2:$D$4,MATCH($A3,IF(B$1>='leave dates'!$B$2:$B$4,IF(B$1<='leave dates'!$C$2:$C$4,'leave dates'!$A$2:$A$4)),0)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down to B12 then across to S3:S12.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    10-10-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Index Match with 3 Criteria

    this worked awesome, thanks so much!

  5. #5
    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
    44,463

    Re: Index Match with 3 Criteria

    Solution with "simple", non-array formula:

    B3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Attached Files Attached Files
    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


  6. #6
    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
    44,463

    Re: Index Match with 3 Criteria

    Please note that NONE of the solutions will work for multiple holiday periods for one individual.

    Also not that the Array Formula solutions have fixed ranges so will need to be adjusted if more holiday entries are added to the list.

    It would probably be advisable to define Dynamic Named Ranges for the holiday list or set up as a Table.


    Regards, TMS
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Index Match with 3 Criteria

    Quote Originally Posted by martinpgibson View Post
    this worked awesome, thanks so much!
    Can't tell who you're replying to but...

    You're welcome. We appreciate the feedback!

  8. #8
    Registered User
    Join Date
    10-10-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Index Match with 3 Criteria

    Thanks Tony and TMS!

+ 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. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  2. [SOLVED] MATCH 3 criteria in a table with INDEX & MATCH
    By SteelMaster in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-17-2014, 04:04 PM
  3. Index Match using two criteria to return on of criteria values
    By RogueLeader in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2014, 09:50 AM
  4. Index and Match with Two Criteria, and date Match Type is Less Than
    By ExcelQuestion in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-11-2013, 08:57 AM
  5. Index Match based on 2 Criteria only returning 1 match
    By stsanders22 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2012, 11:26 PM

Tags for this Thread

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