+ Reply to Thread
Results 1 to 8 of 8

Index all items in a column based on multiple criteria

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2013
    Posts
    26

    Index all items in a column based on multiple criteria

    I'll try to explain this. hopefully the attachment below will help. I am trying to create a list of all instances where contents in A3 is found in C5:C12 and return the values in D5:D12 without any spaces. Right now I can do it in two steps but I'd like to clean it up and do it with only one formula. Any takers??
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Index all items in a column based on multiple criteria

    There's nothing in A3, but I assume you mean A in general.

    Use this array formula:

    =IFERROR(INDEX($C$8:$C$18,SMALL(IF($A$8:$A$18="FULL",ROW($C$1:$C$11)-ROW(A$1)+1),ROW($A1))),"")

    This formula is an array formula confirmed with Ctrl+Shift+Enter to exit the cell, instead of just hitting Enter.

    Then drag down.

    This lists in order just the entries where A = FULL. You can change FULL to a reference such as A3 or whatever.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Index all items in a column based on multiple criteria

    Oops, I think I put in the wrong attachment. This one should make more more sense.
    Attached Files Attached Files

  4. #4
    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,936

    Re: Index all items in a column based on multiple criteria

    This is hardly a Tip or a Tutorial, I will move it to a better forum
    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

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Index all items in a column based on multiple criteria

    Using your second upload, this formula, similar to that of daffodil11's formula will work.

    Array enter this in F5 and copy down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

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

    Re: Index all items in a column based on multiple criteria

    Quote Originally Posted by sabin348 View Post
    Oops, I think I put in the wrong attachment. This one should make more more sense.
    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    2
    Salesman
    3
    840
    Current List
    Result
    4
    Salesman Number
    Customers
    List
    5
    569
    CustomerA
    CustomerY
    6
    569
    CustomerB
    CustomerE
    7
    840
    CustomerY
    CustomerF
    8
    841
    CustomerN
    9
    840
    CustomerE
    10
    840
    CustomerF
    11
    845
    CustomerG
    12
    120
    CustomerS
    13


    This formula entered in F5:

    =IFERROR(INDEX(D:D,AGGREGATE(15,6,1/(C$5:C$12=A$3)*ROW(C$5:C$12),ROWS(F$5:F5))),"")

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    02-25-2014
    Location
    Grand Rapids, MI
    MS-Off Ver
    Excel 2013
    Posts
    26

    Re: Index all items in a column based on multiple criteria

    Thanks a ton guys, it worked great!

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

    Re: Index all items in a column based on multiple criteria

    You're welcome. We appreciate the feedback!

+ 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. Consolidating Items Macro - based upon multiple criteria
    By svalentine91 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2013, 03:13 PM
  2. [SOLVED] Index/Match based on multiple criteria
    By BB1972 in forum Excel General
    Replies: 7
    Last Post: 08-17-2012, 11:45 AM
  3. Index and Match Based on Multiple Criteria
    By duranbeaz in forum Excel General
    Replies: 2
    Last Post: 05-22-2009, 04:37 AM
  4. Replies: 1
    Last Post: 08-02-2006, 12:15 PM
  5. Replies: 2
    Last Post: 10-18-2005, 04:05 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