+ Reply to Thread
Results 1 to 23 of 23

Return multiple results based on multi-criteria selection

  1. #1
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Return multiple results based on multi-criteria selection

    Hi everyone,
    I've used a code found in another post in order to create an item selector based on a number of criteria.
    Each cell which is filled in is supposed to look in another sheet and return a number of possible options as a result in one unique cell.

    My problem is that not all possible results show up in the destination cell, as it seems that the returned value is the 1st one found and then the search stops. Furthermore, I have the feeling that at some stage the search is not on anymore, as some search fields don't seem to be taken into account (C14:C19)

    I've attached the file and would very much appreciate any help I can get in order to understand what I'm doing wrong.
    Many thanks,

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    It looks like your destination cell is E15 in sheet Selector. When you say
    not all possible results show up in the destination cell
    do you mean that more than one Option should be listed in E15 if there is more than one match?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    That's correct Mumps1. I made a mistake in my first post.

    If I enter "Control & Setting" in C2 in the Selector worksheet, then Option 3, Option 5 and Option 6 from the Source Worksheet should all show up in E15 in Selector Worksheet.

    However, what in fact happens, is that E15 returns only the 1st occurrence it finds.
    Last edited by Macpic; 10-13-2017 at 09:57 AM.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    Try the attached file. I had to make a few changes.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Mumps1,
    Thanks very much, we're almost there.

    There's still a problem though. In the attached screenshot, you'll notice that accoridng to selected criteria, only options 3 & 6 should show in the yellow box. However, 1, 2 and 4 show up as well.

    2017-10-13 17_43_30-Macpic selector - Excel.png

    I think that I may be missing something with the OR. Maybe an AND / OR condition would do the trick
    Last edited by Macpic; 10-13-2017 at 12:12 PM.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    You want to match the 60 and the Yes and these values are found under Option 3 and Option 5. Do you not also want to match the 2 for the number of sensors? If you do, then you are matching 3 values not 2 values. In this case, only Option 3 would qualify because Option 5 has 3 for the number of sensors. Could you please clarify.

  7. #7
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Yes, the sensors do come into the equation, but in fact the returned result must be basis all results of the filled cells.

    The thing is, maybe not all cells will be filled in, so the result must be calculated only basis the "true" values. I'm not sure that explanation is very clear... In fact, I want to match all filled in values, however many there are

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    Try the attached file.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Brilliant, that seems to work just fine !

    I'm now going to have to read through your new code to try to understand it !

    Mumps1, you've been a fantastic help, I much appreciate it !
    Many many thanks indeed

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    You are very welcome.

  11. #11
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Hi Mumps1,

    There seems to be an issue :

    In C2/C3/C4 and in C19 of the SELECTOR worksheet, whilst the SOURCE data seems to be identifed, the returned result in E10 seems to be "erased" and *No matches* shows up. I say that the data is identified, because it shows up for a fraction of a second and then disappears.
    I've identified working and non-working cells in column F of the SELECTOR sheet.
    I'm attaching the file.
    Thanks again for your help.
    Attached Files Attached Files

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    Give this a try:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Brilliant, that works a treat !

    Again, many many thanks Mumps1.

    i'll set the status of the post to SOLVED.

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    My pleasure.

  15. #15
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    OK, I seem to have an issue with the code.

    What I think happens I see that the “form” does not reset. Hence after using it a few times, then result ends up by showing *no matches*.

    Does anyone know how to include some sort of reset button or code to ensure that’s this keeps working ?

    Many thanks to anyone out there who’ll be able to help.

  16. #16
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    What do you mean by "Reset"? If the macro works properly once, it should continue to work properly unless a change has been made to the form or to the source data.

  17. #17
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Hi Mumps,

    What I mean is that it does not provide the same results basis same data input. It looks like once you've made a few selections, then it gets confused and does not provide results it should. I forwarded the file to 2 people for testing. When they opened it first time, it worked a treat, then after about 20 minutes testing, when it should have given some positive results, the *no matches* showed up, but did so just after the yellow "positive" result showed up for a fraction of a second.
    It's very bizarre, becaus eit seems the macro runs, finds a result, and then returns a negative result. But it only does so for part of the selection.

  18. #18
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    I'm sorry but after playing with it for a while, I can't reproduce the problem. Can you let me know the selections that are present in column C when the problem occurs?

  19. #19
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    C4 & C10 are both set to "YES" => No matches
    C4 set to "YES" => No matches

  20. #20
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    With those settings I get Options 1 to 5 which is correct. Do you get "No matches" with these settings? I am assuming that all other cells in C2:C19 are blank.

  21. #21
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Yes, all other cells are blank and I get "no matches".

    However, before E10 displays "no matches", for a split second, it shows results and then they disappear and "no matches" up.

  22. #22
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: Return multiple results based on multi-criteria selection

    I've tried again and I'm not having any problem. The file is attached.
    Attached Files Attached Files

  23. #23
    Registered User
    Join Date
    10-04-2017
    Location
    France
    MS-Off Ver
    2016
    Posts
    15

    Re: Return multiple results based on multi-criteria selection

    Ok, thanks. I'll test again and let you know if any issue.

+ 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. Return multiple results based on multiple criteria
    By sthomay in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-06-2017, 01:30 PM
  2. [SOLVED] Return multiple results when a criteria is met
    By kpodoh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:49 AM
  3. Replies: 1
    Last Post: 09-06-2013, 10:05 AM
  4. Select multiple criteria based on check box selection and return all unique values.
    By TommyToe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 09:14 AM
  5. SOS:Return multiple values against multi criteria match and index function
    By nitesh_inin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-26-2012, 05:45 PM
  6. Multiple selection criteria, which formula? .. and selection based on unique numbers
    By FalkirkJim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2012, 05:22 PM
  7. Return results based on multiple criteria
    By Bryce in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2005, 08:05 PM

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