+ Reply to Thread
Results 1 to 12 of 12

Extracting all programs from a table with multiple criteria

  1. #1
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Extracting all programs from a table with multiple criteria

    Hi,

    I would like to accomplish two things in my sample workbook from a reference table (desired results are identified in workbook):

    Firstly, I would like to take only the program name if the student has "completed" under his or her registration status in the given year. However, I want to make sure that it is taking the program name from the proper year and in proper order if the student completed more than one program by copying the formula over to the right or even a brand new formula can work.

    Secondly, I want to show what program did the student return in if he did at all return after completing a program. If the student did not return in that year, I still want to be able to show which program the student returned after all annual completions no matter what year that student returned into the new program. Note that registration status can be anything for the program returned in.

    Thank you for your help!
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extracting all programs from a table with multiple criteria

    Please try
    J2 to L2

    =IFERROR(INDEX($Q:$Q,AGGREGATE(15,6,ROW($O$5:$O$13)/($O$5:$O$13=$A2)/($R$5:$R$13="Completed"),COLUMNS($J2:J2))),"")

    M2
    =IFERROR(INDEX($Q:$Q,AGGREGATE(15,6,ROW($O$5:$O$13)/($O$5:$O$13=$A2)/($R$5:$R$13="In Progress"),1)),"")

  3. #3
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Re: Extracting all programs from a table with multiple criteria

    That is a pretty complex formula, thanks for the quick response .

    However, it is not working with the data set I am using, as I think the AGGREGATE(15,6) part of the formula because 1) reference table is used in another sheet and 2) the reference table is over 5000 rows.

    Note that I tried to copy the reference table to another sheet and adjusted the formula accordingly but I was given blanks only.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extracting all programs from a table with multiple criteria

    You need to reference right columns,

    Please see attached,
    I change reference to Sheet1! that cover 9999 rows


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


    M2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Re: Extracting all programs from a table with multiple criteria

    Hi there,

    Great that worked. However, it is taking programs completed for any year, as there is no condition for Column B (Year). Is there way to add an additional condition?

    For the program returned, the status can be any status, "In Progress", "Withdrawn by Self", etc...

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extracting all programs from a table with multiple criteria

    J2 to L2 add year compare to B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    M2 take any that not Complete
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Re: Extracting all programs from a table with multiple criteria

    Thank you! Worked like a charm.

  8. #8
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Re: Extracting all programs from a table with multiple criteria

    Hi there,

    I realize that applying the desired solution for M2 does not take the correct program in most cases. In a nutshell, it is the program that comes after the last program completed regardless of what year the program returned into is. I figure the program start date after the last program end date will have to be used in the formula. Please see attachment with desired results in M2 through M5, which is the programs returned into.
    Attached Files Attached Files

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extracting all programs from a table with multiple criteria

    Please try at M2

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


    But B2 is 2015-2016 and
    Row 8 18390 2016-2017 Enhanced
    row 14 18390 2015-2016 Local

    Why choose Local which is the same year as B2?
    My formula pick enhance because year is after B2.

  10. #10
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Re: Extracting all programs from a table with multiple criteria

    Hi there,

    Thank you for the quick reply. I designate "Local" as the desired result because that is the program returned into after the last program completed in the year 2015-2016 (cell B2). It is basically the program they returned into right after they complete regardless of the year the next program is or in a lot of cases it is the same year. In this case of ID# 18390, the program after the last completed program in 2015-2016 happened to be "Local". In other words, ID's can complete a program and return in a program in the same year. As in the case of ID 18390, there were 3 programs completed in that year. If this ID only completed two programs and program "General" had a different status than "complete", then "General" would be the program returned into.

    Does this answer your question ?

    Shall I post a new thread you think?

  11. #11
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extracting all programs from a table with multiple criteria

    Please try N2 this will pick earliest start date column S that more than latest date from Column D to I

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

  12. #12
    Registered User
    Join Date
    10-09-2018
    Location
    Montreal, Canada
    MS-Off Ver
    2016
    Posts
    87

    Re: Extracting all programs from a table with multiple criteria

    Hi,

    I just wanted to say the result you provided worked perfectly. Thank you once again!

    If you have the time can you explain the AGGREGATE formula and how it applied in this scanerio?

    No worries if you can't .

+ 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. [SOLVED] I need help extracting a value with multiple criteria
    By JGREEN17 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-08-2018, 03:24 PM
  2. Function to Count number of Programs with Sub-Programs
    By UHD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-14-2017, 11:37 AM
  3. Replies: 23
    Last Post: 09-19-2014, 09:48 AM
  4. Extracting certain criteria from a table on excel
    By andybrown300 in forum Excel General
    Replies: 1
    Last Post: 05-02-2014, 03:06 PM
  5. [SOLVED] Extracting certain rows based on multiple criteria
    By Nurik in forum Excel General
    Replies: 6
    Last Post: 10-30-2013, 02:05 PM
  6. extracting rows of data from a table that are met by criteria in two separate columns
    By markhocek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2013, 03:20 AM
  7. Extracting multiple records according to a criteria
    By cathrandall in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-27-2008, 08:11 PM

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