+ Reply to Thread
Results 1 to 8 of 8

Lookup Values which meet two or more criteria and return multiple matches horizontally

  1. #1
    Registered User
    Join Date
    02-02-2015
    Location
    Adelaide
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    2

    Lookup Values which meet two or more criteria and return multiple matches horizontally

    Lookup values which meet two or more criteria and return multiple matches horizontally.xlsxLookup values which meet two or more criteria and return multiple matches horizontally.PNGHi everyone

    I have been reading your posts for a while and they have been very useful.

    I was wondering if any of you can assist me with the following problem.

    I would like to lookup for values (prices) in a table that meet two criteria (item name="Pen" & Delivery date<Today()) and retrieve all results horizontally. So far I have been able to identify two formulas that may help but I haven't been able to combine them and come with the solution yet.

    The formulas are:

    {=+IFERROR(INDEX($C$3:$C$12, SMALL(IF($A$3:$A$12="Pen",ROW($A$3:$A$12)-ROW($C$3)+1), COLUMN(A1))),"-")}
    Main Issue: Retrieves values which do not meet the criteria


    {=+IFERROR(INDEX($A$3:$C$12,MATCH(1,($A$3:$A$12="Pen")*($B$3:$B$12<TODAY()),0),3),"-")}
    Main Issue: Retrieves only one of the values which meet the criteria

    Have you come across this problem before?

    Your help is greatly appreciated

    Regards

    Jose Martinez



    Range to Lookup
    Item Delivery Date Purchase Price Meet Criteria
    Pen 05-Feb-2015 $5.20 No
    Eraser 01-Feb-2015 $5.30 No
    Paper 08-May-2015 $5.40 No
    Pen 15-Jan-2015 $5.50 Yes
    Paper clip 15-Jan-2015 $2.20 No
    Pen 01-Feb-2015 $4.30 Yes
    Eraser 05-Jan-2015 $2.10 No
    Paper 31-Dec-2014 $6.30 No
    Pen 30-Mar-2015 $3.20 No
    Paper clip 05-Mar-2015 $9.50 No

    Search Criteria
    Item Pen
    Delivery Date <Today() Today = 03-Feb-2015

    Values to return (Horizontally)
    Pen <Today() $5.50 $4.30
    (15/01/2015) (1/02/2015)
    Functions Used:

    Formula: {=+IFERROR(INDEX($C$3:$C$12, SMALL(IF($A$3:$A$12="Pen",ROW($A$3:$A$12)-ROW($C$3)+1), COLUMN(A1))),"-")}
    Results 5.2 5.5 4.3 3.2
    Criteria Meet No Yes Yes No
    Main Issue: Retrieves values which do not meet the criteria


    Formula: {=+IFERROR(INDEX($A$3:$C$12,MATCH(1,($A$3:$A$12="Pen")*($B$3:$B$12<TODAY()),0),3),"-")}
    Results 5.5 5.5 5.5 5.5
    Criteria Meet Yes Yes Yes Yes
    Main Issue: Retrieves only one of the values which meet the criteria
    Last edited by josetmg; 02-03-2015 at 12:57 AM.

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

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    Please see the file hope this works


    regards

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    In the second formula you have just 3 for the column number. That explicitly limits the return to just that one item.

    Use what you did in the first formula for the second formula, but include the date criteria. Leave the columns argument blank.

    In the first formula you haven't set a date criteria.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    Can you upload a sample file? Saves having to retype what you posted.

    I can't get Azumi's file to download.

    Can't get your file to download either.
    Last edited by FlameRetired; 02-03-2015 at 12:35 AM.

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    Try this...


    =IFERROR(INDEX($C$3:$C$12,SMALL(IF(($A$3:$A$12="Pen")*($B$3:$B$12<TODAY()),ROW($A$3:$A$12)-ROW($A$3)+1), COLUMNS($A:A))),"-")


    Drag it right...


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  6. #6
    Registered User
    Join Date
    02-02-2015
    Location
    Adelaide
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    2

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    Thank you everyone for your prompt response!

    It's solved now.

    Brilliant!
    Last edited by josetmg; 02-03-2015 at 01:17 AM.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    FlameRetired
    I was able to download the file. I suspect it may be an issue with your computer.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Lookup Values which meet two or more criteria and return multiple matches horizontally

    Quote Originally Posted by alansidman View Post
    FlameRetired
    I was able to download the file. I suspect it may be an issue with your computer.

    Alan
    Thanks Alan for looking into it.

    Others have mentioned some difficulties with files I had no problem downloading. Don't know what's going on. Files download sometimes and sometimes they don't.

    Thanks again, though.

+ 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. Replies: 2
    Last Post: 03-03-2014, 10:03 PM
  2. [SOLVED] Formula to lookup and return multiple results horizontally sheet 1 and 2
    By Chris1234567 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-04-2014, 11:17 AM
  3. Lookup to return multiple values horizontally
    By ROBMP in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-06-2014, 01:32 PM
  4. [SOLVED] Array Formula to Lookup and Return All Rows in Table that Meet Single Criteria
    By Torkel74 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2013, 10:41 PM
  5. Replies: 3
    Last Post: 11-03-2010, 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