+ Reply to Thread
Results 1 to 10 of 10

Searching a Table for 2 search terms and returning all answers

  1. #1
    Registered User
    Join Date
    01-27-2021
    Location
    San Marcos, CA
    MS-Off Ver
    2016
    Posts
    5

    Angry Searching a Table for 2 search terms and returning all answers

    I have been trying to figure out how to search the table on Sheet 2 (T24 Controls) of my spreadsheet for 2 terms (Series and Type) and return all the answers. I can search the table for both terms and return the first answer OR I can search the table for 1 term and return all the answers. I cant seem to get it to do both at the same time. The terms are in Green and Yellow drop down boxes at the top of Sheet 1 (Lookup). Any help would be greatly appreciated! I have been thrown in to this job position and have managed to brute force my way through my issues so far but this one stopped me...
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Searching a Table for 2 search terms and returning all answers

    In Lookup, A4, copied across and down:

    =IFERROR(INDEX('T24 Controls'!A:A,AGGREGATE(15,6,ROW(T24_Controls[[Qty.]:[Qty.]])/((T24_Controls[[Type]:[Type]]=$E$2)+(T24_Controls[[Series]:[Series]]=$C$2)),ROWS(A$4:A4))),"")

    Also... amend the formula in D4 to read (at the end...), to get rid of irritating zeros...

    .......[Series]]=$C$2)),ROWS(A$4:A4)))&"","")

    see sheet.

    Your location is ambiguous... there are several San Marcos's.... if you're in one of the Spanish speaking ones, you may need to use ; instead of ,

    Please amend your location, in your User CP, to remove ambiguity.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 01-28-2021 at 07:32 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    01-27-2021
    Location
    San Marcos, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Searching a Table for 2 search terms and returning all answers

    Thank you! I am in San Marcos CA. I will update my location.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Searching a Table for 2 search terms and returning all answers

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    01-27-2021
    Location
    San Marcos, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Searching a Table for 2 search terms and returning all answers

    So I am still running into an issue. I tried to apply your corrections to my sheet and it does not seem to work like you set it up. Attached is my full sheet. Can you help me by explaining what I am doing wrong? I would like to apply similar search criteria to the other search boxes I have and more that I will be creating in the future and would like to understand the problem so I don't have to ask for more help...Thank you again!
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Searching a Table for 2 search terms and returning all answers

    You changed my formula. So, of course it doesnt work.

    =IFERROR(INDEX('T24 Controls'!A:A,.....

    you decided to change it to:

    IFERROR(INDEX(T24_Controls[Qty.],....

    change it back the way I set it up.

  7. #7
    Registered User
    Join Date
    01-27-2021
    Location
    San Marcos, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Searching a Table for 2 search terms and returning all answers

    I changed it only because it was not working properly. Would that be due to the differences in our office programs? I see that you are using 365 and I am on 2016. Attached is my file.
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Searching a Table for 2 search terms and returning all answers

    I am beginning to think I have misunderstood your requirement. In your first post, I understood that you were checking for X or Y...

    However, version will make no difference. It is NOT an array formula. I did not tell you to array enter it, but that will not make any difference, either,

    I have extended it out by one column. You will see that it is returning values that are EITHER Pack OR Lutron. Did you want values thta are BOTH Pack and Lutron??

    If so, change the + to a * :

    =IFERROR(INDEX('T24 Controls'!A:A,AGGREGATE(15,6,ROW(T24_Controls[[Qty.]:[Qty.]])/((T24_Controls[[Type]:[Type]]=$AB$2)*(T24_Controls[[Series]:[Series]]=$Z$2)),ROWS(X$4:X4))),"")
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-27-2021
    Location
    San Marcos, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Searching a Table for 2 search terms and returning all answers

    I see! Thank you! Sorry, I have been working with the Array format for everything so I just assumed it was an array. Yes, I was looking to search for items that contained BOTH the Series and the Type and not one or the other. Changing the + to * fixed it. Thank you again. I will now mark this as solved!

    Sorry for the confusion/dumb questions.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Searching a Table for 2 search terms and returning all answers

    It's never dumb if you haven't done it before... just different!!

+ 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] Formula to search specific set of terms in a string and return any found terms
    By fk_ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-12-2020, 10:26 AM
  2. [SOLVED] Searching a table and returning a corresponding number
    By Losguapos1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2017, 04:16 PM
  3. [SOLVED] VLOOKUP returning multiple answers from table
    By Cyclewench in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-06-2013, 03:18 AM
  4. Replies: 33
    Last Post: 01-10-2006, 02:30 AM
  5. Replies: 34
    Last Post: 01-10-2006, 02:30 AM
  6. [SOLVED] searching a large database with a long list of search terms
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 01-10-2006, 02:30 AM
  7. [SOLVED] how to set up a vlookup table with 2 search terms?
    By WendyL in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2005, 09:06 AM

Tags for this Thread

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