+ Reply to Thread
Results 1 to 17 of 17

Extract values based on three (3) criteria

  1. #1
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Extract values based on three (3) criteria

    Looking for a formula to extract values when three (3) conditions are selected/met. For example, If you select Sky in B2, East in A2 and All[2001,2002,2003] in C2, formula should extract all values associated with Sky. If I select All[Blue,Average Sales,Gas milage,Sky] in B2 and All[2001,2002,2003] in C2, formula should extract values for each option. See


    Example:
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Extract values based on three (3) criteria

    I have used E1 to H2 to define search parameters for Variables and year using formula as below


    =IF(ISNUMBER(SEARCH("Blue",$B$2)),"Blue","")

    I have used the following to extract the data;

    =IFERROR(INDEX(Sales!$H$2:$H$100,MATCH(1,(Sales!$B$2:$B$100=B$5)*(Sales!$A$2:$A$100=$E$2),0)),"")

    Entered with Ctrl + Shift +Enter

    Change RED to select required data and Green for year.

    Change the selection and you will see the results updated.

    ALL formulae are set up in the attached sheet.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Extract values based on three (3) criteria

    JohnTopley: formula needs adjustment. I do not want the whole table to show each parameter. Let say I select Average Sales, All[2001,2002,2003] and Blue, I want the formula to only show average sales table with all three years

    Please Login or Register  to view this content.
    Thanks

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Extract values based on three (3) criteria

    Much more complicated as you will a complex formula for each permutation: understand your requirement.

    I do not use them put perhaps a pivot table is a better solution if you want this degree of flexibility.

  5. #5
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Extract values based on three (3) criteria

    Hi

    Will there be more years? Sample 2001 to 2015? If yes? My advice look into VBA or pivot table?
    To help you by my post? it would be nice to click on to say "Thank you".
    If you are happy with a solution to your problem?
    Click Thread Tools above your first post,
    select "Mark your thread as Solved".

  6. #6
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Extract values based on three (3) criteria

    micope21: No. just 3 years

    Thanks

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Extract values based on three (3) criteria

    Compromise solution?
    Attached Files Attached Files

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

    Re: Extract values based on three (3) criteria

    Hi bjnockle nice to see u again, pls find the file attach, hope the best.....
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Extract values based on three (3) criteria

    azuma my friend, thanks for looking at the attached. Not able to open/download the file. Can you reattach it? I am getting an error message. File format or extension is not valid.

    Thanks.

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Extract values based on three (3) criteria

    @bjnockle

    It would be nice if you also respond on the offered solution in #7.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  11. #11
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Extract values based on three (3) criteria

    Outstanding solution JohnTopley. I can work with this. Would like to view azumi's solution for comparison before marking the problem solved. Thanks

  12. #12
    Valued Forum Contributor
    Join Date
    05-11-2013
    Location
    Wales
    MS-Off Ver
    Excel 2010
    Posts
    586

    Re: Extract values based on three (3) criteria

    Hi bjnockle,
    John Topley suggested a pivot table in #4.
    Please see attached Pivot Table option.
    After you add more information to the sales sheet you will need to refresh the pivot tables.
    Regards
    peterrc
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Extract values based on three (3) criteria

    peterrc: not zeroing in on Pivot Table.

    Thanks.

  14. #14
    Valued Forum Contributor
    Join Date
    03-20-2011
    Location
    UK
    MS-Off Ver
    Excel 2007/10/16
    Posts
    840

    Re: Extract values based on three (3) criteria

    Hi

    There no easy way!!

    If you use John Topley formula sheet as Dummy? You can hide the Dummy Sheet?

    New Sheet 2
    Column A is using if formula.

    Column B cell B7
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This is array formula. Press same time Ctrl+Shift+Enter till you see both end like this {}. DO NOT PRESS ENTER? Otherwise it won't work. Then copy down to 3 row and a cross

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

    See highlight red change from A6 (See above red) to A11? Do same next one to A16 and A21?

    Hope this solved for you?

    See the file
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Extract values based on three (3) criteria

    Very neat solution!

  16. #16
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Extract values based on three (3) criteria

    wow solution! works like a charm! You are a genius! thanks a million

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

    Re: Extract values based on three (3) criteria

    Hi bjnockle

    my mistake, im upload it again
    Attached Files Attached Files

+ 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. Extract values based on two (2) criteria
    By bjnockle in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 07-19-2015, 04:14 AM
  2. [SOLVED] Extract values based on two (2) criteria
    By bjnockle in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-18-2015, 05:10 AM
  3. [SOLVED] Extract Unique Text Values based on Multiple Criteria
    By Kattenhove in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-26-2014, 07:59 AM
  4. [SOLVED] Extract duplicated values based on an extra criteria
    By Eduard in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-21-2013, 05:50 AM
  5. Replies: 1
    Last Post: 02-14-2013, 02:32 PM
  6. [SOLVED] Extract unique values out of list based on an extra criteria
    By sven1975 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 05:02 AM
  7. Extract Unique Values from an Array based on Criteria
    By ronleex324 in forum Excel General
    Replies: 1
    Last Post: 10-04-2011, 06:37 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