+ Reply to Thread
Results 1 to 3 of 3

match() an array filtered based on criteria in another column

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    match() an array filtered based on criteria in another column

    i've got a list of product codes in column A for which i'm trying to return a high level product family from column B. many of the values in product family are a generic term, not specific to the actual product, so I'm trying to look through my dataset for similar product codes and return a product-specific family instead of the generic term.

    In the sample attached, abcdefg is a product code which is followed by either 10 or 01. Product Family can be either the generic terms "A" or "B", or the product-specific term "C". In my example formula in c2, I want to return "C" - the first non-generic value for which i can match the product code abcdefg.

    I'm thinking the formula should look something like:

    Formula: copy to clipboard
    {=INDEX($A$3:$B$7,MATCH(LEFT(A2,LEN(A2)-2),--(NOT(OR(B3:$B$7="B",B3:$B$7="A")))*left(A3:$A$7,len(A3:$A$7)-2),0),2)}


    but Not()*A5:$A$7 returns a value error - multiplying "True" by my array... what i think i want is to return {false,true,true,false,false,true} so that my match formula is only looking at the array {B3,B4,0,0,B7} to find "abcdefg".

    open to pretty much any suggestions including helper columns etc...

    thanks in advance!
    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: match() an array filtered based on criteria in another column

    Good ol' fashioed LOOKUP to the rescue.

    =LOOKUP(2,1/((LEFT($A$2:$A$7,LEN($A$2:$A$7)-2)=LEFT(A2,LEN(A2)-2))*
                 ($B$2:$B$7<>"A")*
                 ($B$2:$B$7<>"B")),$B$2:$B$7)
    Last edited by daffodil11; 11-11-2014 at 02:36 PM. Reason: Missed the A & B criteria
    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
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: match() an array filtered based on criteria in another column

    Thanks Daffodil. Solution works perfectly.

+ 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. I want match 2 criteria and search column and return value based on a value
    By laliparker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-15-2014, 11:41 AM
  2. [SOLVED] Array index with 3 way match criteria of 2 rows and 1 column cant get to work!
    By volchik696 in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 01-20-2014, 06:18 AM
  3. [SOLVED] Index and match based off of top 5 list for a specific field in a filtered column
    By ScottBeatty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-27-2013, 04:37 PM
  4. Match values in a colum based on criteria from other column
    By lcaseybsa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-15-2013, 02:04 PM
  5. An array and countif based on criteria in each column
    By Rochelle B in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-25-2005, 01: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