+ Reply to Thread
Results 1 to 10 of 10

List all items that match criteria

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    27

    List all items that match criteria

    I need help building a formula that will capture all the items in a list that match a certain criteria. I have a list of materials on a tab and their corresponding SKU. I need to list all the items that match a certain sku (i.e. Everything that is a C, D, or CORE). I've listed an example template where I would like to fill in the yellow highlighted box with all the potential sku's based on what's listed in cell C7. Thanks for all the help!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: List all items that match criteria

    Put this in B11...
    =IFERROR(INDEX(Materials!$D$2:$D$27,SMALL(IF((Materials!$D$2:$D$27={"C","D","CORE"}),ROW(Materials!$A$2:$A$27)-1),ROWS(Materials!$A$1:A1))),"")
    and this in C11....
    =IFERROR(INDEX(Materials!$C$2:$C$27,SMALL(IF((Materials!$D$2:$D$27={"C","D","CORE"}),ROW(Materials!$A$2:$A$27)-1),ROWS(Materials!$A$1:A1))),"")
    Both of these are ARRAY formulas...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Copy them both down as far as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: List all items that match criteria

    With a little code, starts after change value of C7


    Kind regards
    Leo
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-07-2012
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: List all items that match criteria

    Hi there, Leo I am unable to view your code and therefore can't see how it was done to replicate myself. Can you help?

    FDibbins: I would like to be able to adjust cell C7 to be any combination of A,B,C and Core and then have the corresponding materials populate.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: List all items that match criteria

    Then you will need to put them in their own cells, say in Summary E2:E7

    Becasue I am can only use that formula with the SKU's hard coded, I have now taken a different approach for this, using a helper column.

    1. In materials E2, copy this down (you can hide it if you want)...
    =IF(ISERROR(MATCH(D2,Summary!$E$3:$E$7,0)),Materials!E1,Materials!E1+1)

    Then in Summary...
    B12=IFERROR(INDEX(Materials!$D$2:$D$27,MATCH(ROW(A1),Materials!$E$2:$E$27,0)),"")
    C12=IFERROR(INDEX(Materials!$C$2:$C$27,MATCH(ROW(A1),Materials!$E$2:$E$27,0)),"")
    both copied down as needed

    This will allow you to enter up to 5 codes

  6. #6
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: List all items that match criteria

    If you insist on keeping the different SKU's in one cell, check out the attachment.
    In cell B12 (of Summary) the arrayformula (ctrl+shift+enter), drag down to B33
    =IFERROR(INDEX(Materials!$D$2:$D$27,SMALL(IF(ISNUMBER(SEARCH(Materials!$D$2:$D$27,Summary!$C$7)),ROW($D$2:$D$27)-1,"");ROWS($1:1))),"")
    Attached Files Attached Files

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: List all items that match criteria

    b12=IFERROR(INDEX(Materials!$D:$D,SMALL(INDEX((MMULT((Materials!$D$2:$D$27=TRIM(MID(SUBSTITUTE($C$7,",",REPT(" ",100)),(COLUMN(INDIRECT("a1:j1"))-1)*100+1,100)))*1,ROW(INDIRECT("a1:a10")))=0)*10^10+ROW(Materials!$D$2:$D$27),0),ROW($A1))),"")
    Please Login or Register  to view this content.
    c12=IFERROR(INDEX(Materials!$C:$C,SMALL(INDEX((MMULT((Materials!$D$2:$D$27=TRIM(MID(SUBSTITUTE($C$7,",",REPT(" ",100)),(COLUMN(INDIRECT("a1:j1"))-1)*100+1,100)))*1,ROW(INDIRECT("a1:a10")))=0)*10^10+ROW(Materials!$D$2:$D$27),0),ROW($A1))),"")
    Please Login or Register  to view this content.
    Try this and copy towards down
    It will work up to 10 SKUs in Cell "C7"

    SEE ATTACHED FILE
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  8. #8
    Registered User
    Join Date
    11-07-2012
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: List all items that match criteria

    These are great! thank you. I would need to adjust to accommodate additional brands.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: List all items that match criteria

    Hi Coda,
    code is behind sheet Summery in Worksheet_Change Event

    something like this
    Please Login or Register  to view this content.
    Kind regards
    Leo

  10. #10
    Registered User
    Join Date
    11-07-2012
    Location
    Tampa, FL
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: List all items that match criteria

    Thanks Leo ... although I'm a little shamed to say I don't know much about coding.

+ 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] Formula to show all items that match three criteria
    By Rerock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-17-2014, 01:30 PM
  2. [SOLVED] Formula to show all items that match two criteria?
    By Rerock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2014, 10:35 AM
  3. Replies: 1
    Last Post: 04-07-2014, 05:35 PM
  4. [SOLVED] list items that meet certain criteria
    By littleYS in forum Excel General
    Replies: 3
    Last Post: 08-02-2013, 06:15 AM
  5. List items to new sheet which match specific criteria
    By Toonces in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2013, 02:14 PM
  6. List All Items that match a particular cell.
    By slashdot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2011, 12:47 PM
  7. List All Items that match a particular cell.
    By slashdot in forum Excel General
    Replies: 6
    Last Post: 10-11-2011, 10:20 AM

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