+ Reply to Thread
Results 1 to 7 of 7

Lookup creteria match formula with results in rows (horizontal)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Lookup creteria match formula with results in rows (horizontal)

    Hi.

    Is there a formula that can lookup a distinct creteria and return all values associated with this creteria? The trouble I am having is I want the results of the formula in a row (horizontal) not vertical. As an example I am looking for the unique values in column B that are associated with either creteria in column A.
    I want the formula result to not repeat any value already found. Below is an example I have pasted;

    Column A Column B


    Row3 MX Beatle
    Row4 AA Eel
    Row5 EK Ant
    Row6 OP Cobra
    Row7 LD Centipede
    Row8 AA Spider
    Row9 LD Beatle
    Row10 MX Mites
    Row11 PP Eel
    Row12 BB Sting
    Row13 AA Spider
    Row14 CP Crab
    Row15 LD Crab
    Row16 BB Ant
    Row17 MX Cobra
    Row18 LD Hyte

    Lookup Formula results below

    MX Beatle Mites Cobra #N/A
    AA Eel Spider #N/A
    LD Crab Centipede Beatle Hyte #N/A



    Say If I am looking for all Values/Text associated with MX, the formula should return Beatle, Mites and Cobra. and so forth.

    Your assistance will be much appreciated.

    Pi*
    Last edited by Pi*; 11-03-2017 at 09:30 PM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,649

    Re: Lookup creteria match formula with results in rows (horizontal)

    Is it are you looking for?
    Attached Files Attached Files
    Quang PT

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup creteria match formula with results in rows (horizontal)

    Here is a shorter formula
    Enter in E3 copy across and down

    ***Array formula
    ...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.

    Formula: copy to clipboard
    =IFERROR(INDEX($B:$B,SMALL(IF($A$3:$A$18=$D3,ROW($A$3:$A$18)),COLUMNS($A:A))),"")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,992

    Re: Lookup creteria match formula with results in rows (horizontal)

    or try a non array formula

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    3
    MX Beatle
    4
    AA Eel
    5
    EK Ant
    6
    OP Cobra MX Beatle Mites Cobra
    7
    LD Centipede AA Eel Spider Spider
    8
    AA Spider
    9
    LD Beatle
    10
    MX Mites
    11
    PP Eel
    12
    BB Sting
    13
    AA Spider
    14
    CP Crab
    15
    LD Crab
    16
    BB Ant
    17
    MX Cobra
    18
    LD Hyte


    E6
    Formula: copy to clipboard
    =IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($A$3:$A$18)/($A$3:$A$18=$D6),COLUMNS($D6:D6))),"")


    Copy across
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Lookup creteria match formula with results in rows (horizontal)

    Good morning,

    Thank you all sincerely, but is there a way the formula will not repeat a value already found more than once? For instance If I am searching for criteria associated with AA in my original list, I want the result of the formula to show Eel Spider only not Eel Spider Spider. I don't want the formula to repeat any values found twice.

    I appreciate the help

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookup creteria match formula with results in rows (horizontal)

    Try this
    Enter in E3, copy across and down
    Array formula must be entered with Ctrl+Shift+Enter key combination.
    Formula: copy to clipboard
    =IFERROR(INDEX($B$3:$B$18,MATCH(0,IF($A$3:$A$18=$D3,COUNTIF($D$3:D3,$B$3:$B$18)),0)),"")

    v A B C D E F G H
    1
    2
    3 MX Beatle MX Beatle Mites Cobra
    4 AA Eel AA Eel Spider
    5 EK Ant EK Ant
    6 OP Cobra OP Cobra
    7 LD Centipede LD Centipede Crab Hyte
    8 AA Spider PP Eel
    9 LD Beatle BB Sting
    10 MX Mites CP Crab
    11 PP Eel
    12 BB Sting
    13 AA Spider
    14 CP Crab
    15 LD Crab
    16 BB Ant
    17 MX Cobra
    18 LD Hyte
    19
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Lookup creteria match formula with results in rows (horizontal)

    Good evening,

    Perfect! AlKey. Thank you very much for your time bebo021999 and shukla.ankur281190. Bless you all.

    Pi*

+ 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. Horizontal lookup return data vertically (Index Match ?)
    By Prospidnick in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2017, 06:52 AM
  2. [SOLVED] using a lookup formula to find all rows that match same criteria
    By nicki_rae22 in forum Excel General
    Replies: 3
    Last Post: 12-09-2014, 10:38 AM
  3. Index match using multiple creteria
    By alexduy in forum Excel General
    Replies: 3
    Last Post: 12-03-2014, 05:44 PM
  4. Replies: 0
    Last Post: 07-02-2013, 01:37 PM
  5. Replies: 5
    Last Post: 02-29-2012, 08:51 PM
  6. Match data with 3 creteria..
    By sid_12 in forum Excel General
    Replies: 3
    Last Post: 07-29-2010, 04:44 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