+ Reply to Thread
Results 1 to 14 of 14

Lookup on multiple criteria to bring multiple results

  1. #1
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Lookup on multiple criteria to bring multiple results

    Morning Guys

    I have a sheet named "Tracking Log" where column F contains a numeric value and where Column C contains a category.

    What i want to do is look up Column F in the "Tracking Log sheet against Cell F2 in "Sheet1" to pull all values in Column E where the category equals "Item1".

    Can someone please provide me with a formula to do this?

    Again the lookup data could contain multiple values so id guess it would be some kind of an index match formula which i'm not too good with.

    Thanks
    Dave

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: Lookup on multiple criteria to bring multiple results

    Hi Dave,

    It would help if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post. Don't try to use the Paperclip icon, as it doesn't work on this forum.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Lookup on multiple criteria to bring multiple results

    Apologies

    Example attached.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: Lookup on multiple criteria to bring multiple results

    I can't see an "Item 1" - do you mean "Category 1" (and it's in column D of the Tracking log sheet) ?

    Pete

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lookup on multiple criteria to bring multiple results

    Hi

    My solution:

    Into cell C8: ={IFERROR(INDEX('Tracking Log'!E:E,SMALL(IF((--('Tracking Log'!D:D=Lookup!$C$7)*(--('Tracking Log'!F:F=Lookup!$F$2)))=1,ROW('Tracking Log'!E:E)),ROW(1:1)),1),"")} accept with CSE
    copying down to 17.

    for F8 change bolded part for F7, for I8 change for I7 etc.

    When you will be copying this formula into category 4/5/6 (C21/F21/I21) you have to be sure that first row of each of these tables has ROW(1:1) in formula.


    I did not get any idea how to split result if there are more result than can fit into 1 column (C8:C17) and have to go to D8:D17.
    Meantime...... Into D8 paste this formula and put ROW(11:11) and drag down to D17.

    and obviously accordingly in the other tables.
    Last edited by KOKOSEK; 01-18-2019 at 08:31 AM. Reason: important for bottom tables

  6. #6
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Lookup on multiple criteria to bring multiple results

    Apologies Pete

    So yes what i want to do is ..

    On the lookup tab if i type in the ticket number in Cell F2.

    Then i want all the serial numbers in column E pulled through in to the relevant table on the lookup page.

    You will notice that each category has 20 blank fields so each one of those should contain a unique number from the serial number column for that category and ticket number.

    Some tickets and categories could only have 1 result but others could have up to 20.

    Thanks
    Dave

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lookup on multiple criteria to bring multiple results

    I've add you file with my solution because when I am reading my own post I feel a bit confused.
    Excuse my English as it is not my native language.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Lookup on multiple criteria to bring multiple results

    Hi KOKOSEK

    Your solution has multiple of the same value.

    Only uniques should be pulled in

    Thanks
    Dave

  9. #9
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lookup on multiple criteria to bring multiple results

    I've change serials to be sure that I've correct results. When you applied formulas into your original file you will get proper results. Don't worry.
    Solution with original data has been attached.
    Attached Files Attached Files
    Last edited by KOKOSEK; 01-18-2019 at 08:55 AM. Reason: Solution with original data has been attached.

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: Lookup on multiple criteria to bring multiple results

    I've changed the layout of your Lookup sheet slightly, so that each category table occupies only one column - this makes it easier to expand if you need to.

    I've set up data validation in cell E2 so that you can select the Ticket number from the drop-down - this is governed by a table I have set up in column J of the Tracking Log sheet.

    I've used a helper column in column H of the Tracking Log sheet, with this formula in H5:

    =IF(F5=Lookup!$E$2,D5&"_"&COUNTIFS(F$5:F5,F5,D$5:D5,D5),"")

    This identifies each record which matches the criteria, and gives each a unique code. Then I have used this in cell B8 of the Lookup sheet:

    =IFERROR(INDEX('Tracking Log'!$E$5:$E$500,MATCH(B$7&"_"&ROWS($1:1),'Tracking Log'!$H$5:$H$500,0)),"")

    This can be copied down as far as you need it, and then that block of formulae can be copied across into D8, F8 etc.

    Then you can just use the drop-down to select a new Ticket number in E2, and the display will change automatically.

    Hope this helps.

    Pete
    Attached Files Attached Files

  11. #11
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Lookup on multiple criteria to bring multiple results

    I did not want to recreate original layout. This solution definitely will be much, much quicker as there is no array formulas.

  12. #12
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Lookup on multiple criteria to bring multiple results

    Quote Originally Posted by Pete_UK View Post
    I've changed the layout of your Lookup sheet slightly, so that each category table occupies only one column - this makes it easier to expand if you need to.

    I've set up data validation in cell E2 so that you can select the Ticket number from the drop-down - this is governed by a table I have set up in column J of the Tracking Log sheet.

    I've used a helper column in column H of the Tracking Log sheet, with this formula in H5:

    =IF(F5=Lookup!$E$2,D5&"_"&COUNTIFS(F$5:F5,F5,D$5:D5,D5),"")

    This identifies each record which matches the criteria, and gives each a unique code. Then I have used this in cell B8 of the Lookup sheet:

    =IFERROR(INDEX('Tracking Log'!$E$5:$E$500,MATCH(B$7&"_"&ROWS($1:1),'Tracking Log'!$H$5:$H$500,0)),"")

    This can be copied down as far as you need it, and then that block of formulae can be copied across into D8, F8 etc.

    Then you can just use the drop-down to select a new Ticket number in E2, and the display will change automatically.

    Hope this helps.

    Pete
    That is perfect Pete.

    Thanks for your help.

    Quote Originally Posted by KOKOSEK View Post
    I did not want to recreate original layout. This solution definitely will be much, much quicker as there is no array formulas.
    That's no problem KOKOSEK, Thanks for your help either way.

  13. #13
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,800

    Re: Lookup on multiple criteria to bring multiple results

    Glad to help, Dave - thanks for the rep.

    Us Northerners need to keep together !!

    Pete

  14. #14
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Manchester, UK
    MS-Off Ver
    Microsoft Office 365
    Posts
    127

    Re: Lookup on multiple criteria to bring multiple results

    Quote Originally Posted by Pete_UK View Post
    Glad to help, Dave - thanks for the rep.

    Us Northerners need to keep together !!

    Pete
    No problem Pete.

    ANd that's very true!

+ 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] Lookup to match multiple criteria and return multiple results excluding duplicates.
    By kris3012 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-13-2018, 11:06 AM
  2. multiple criteria lookup to bring back MAX date
    By AlexDNI167 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-05-2016, 10:26 AM
  3. Multiple Criteria Lookup for Multiple Results
    By rchow in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-28-2014, 02:45 PM
  4. Replies: 1
    Last Post: 09-04-2014, 12:14 PM
  5. Replies: 11
    Last Post: 02-07-2013, 02:22 AM
  6. Lookup multiple & non duplicated results for multiple matching criteria
    By melvil007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-19-2012, 01:22 AM
  7. Multiple Lookup Criteria and Concatenate Multiple Results
    By Elwood07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2012, 10:27 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