+ Reply to Thread
Results 1 to 5 of 5

Excel Index Match Large If

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    NY
    MS-Off Ver
    V10
    Posts
    13

    Excel Index Match Large If

    Hi All,

    Hope that you can help - this has stumped me for a few hours now and I can't seem to find an answer on the web. I'm looking to find the name of a job with the greatest count, based on a few criteria. Please see the attached example sheet I put together.

    In detail, I'm looking to find the job title with the greatest (1st largest, 2nd largest, 3rd largest, etc) count of employees who fall between a certain age range (e.g., 40 - 50 years old) and a certain tenure (e.g., 5 - 15 years of experience), who work in a certain location (e.g., WA or Washington).

    If there are 10 Cooks, 3 Cleaners, and 2 Drivers who are between 40-50 years old, with 5-15 years of experience, who are in WA, I'm looking for a formula(s) that can identify 1: Cooks, 2: Cleaners, 3: Drivers, and so on...

    I thought that I came close, with the following formula, but when I entered in a different age-range, the output was no longer correct:

    =INDEX($B$2:$B$26,MATCH(LARGE(IF(($E$2:$E$26,$J$2)*($D$2:$D$26>=$H$2)*($D$2:$D$26<$H$3)*($C$2:$C$26>=$I$2)*($C$2:$C$26<$I$3),$C$2:$C$26),1),$C$2:$C$26,0))

    Also, I'm sure that "tie's" will become an issue, and if you might know how to solve this issue as well, that'd be great. Looking forward to hearing your thoughts and let me know if you have any questions.

    Example.xlsx

    In the example sheet, input data is in H2:J3 and the output formula is in G5.

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Excel Index Match Large If

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


    and copy down

  3. #3
    Registered User
    Join Date
    06-15-2015
    Location
    NY
    MS-Off Ver
    V10
    Posts
    13

    Re: Excel Index Match Large If

    Jose,

    Thanks for taking a look - the output of your formula seems to work if the output is a unique number in Column A. I'm hoping for the output to show the job title listed in Column B (e.g., the largest count of people with 5-15 years experience and 40-50 years old in WA is Farmers, the 2nd largest is Drivers) and not the unique number. When I changed the references to Column B, the formula isn't working (shows a blank due to the iferror or an error otherwise).

    Another example to help clarify (making up data): There are 15 people who are between the ages of 40-50, have worked between 10-25 years, and are located in WA. What job makes up the largest number/percentage of those 15 people? Maybe there are 8 drivers, 6 cooks, and 1 Cleaner. That's the kind of question I'm hoping to be able to answer with a formula.

    Thanks for the help.
    Last edited by covanpatten2; 01-12-2016 at 04:45 PM.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Excel Index Match Large If

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

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

    Re: Excel Index Match Large If

    Quote Originally Posted by José Augusto View Post
    =INDEX(B2:B26,IFERROR(1/AGGREGATE(15,6,1/(--($D$2:$D$26>=$H$2)*--($D$2:$D$26<=$H$3)*--($C$2:$C$26>=$I$2)*--($C$2:$C$26<=$I$3)*--($E$2:$E$26=$J$2)*A2:$A$26),ROW(A1)),""),1)
    No need for the *--. Just * will do.

    Using ROW(A1) leaves the formula vulnerable to new row insertions.

    ROWS(A$1:A1) is much more robust.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Index, Match, Large and Countif
    By rbirch in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-11-2015, 05:36 PM
  2. Index match with large function
    By morobo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2014, 02:27 PM
  3. Excel 2007 : Index, Match, Large Formula: Multiple Criteria, Multiple Ranges
    By SimpleJack in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2013, 08:54 AM
  4. Using Index & Match with the Large function
    By JXH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2011, 08:39 PM
  5. INDEX, MATCH and LARGE
    By ridebikes in forum Excel General
    Replies: 1
    Last Post: 10-24-2011, 04:03 PM
  6. Index, Match, and Large
    By edwardpestian in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-03-2006, 06:10 PM
  7. Large Index Match Lookup
    By Biff in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 05:05 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