+ Reply to Thread
Results 1 to 9 of 9

Need help with a challenging lookup/match type of situation

  1. #1
    Registered User
    Join Date
    02-17-2022
    Location
    Dallas, TX
    MS-Off Ver
    360
    Posts
    5

    Post Need help with a challenging lookup/match type of situation

    I don't think a look-up is the answer but its the best way to describe what I'm trying to do.

    Basically:
    1) I'm allowing a user to create 10 rows of possible criteria combinations. Those combinations are being used to group a large amount of data. They can choose 1, 2, 3...etc.. or all 9 fields to filter. Only criteria combinations with at least 1 field chosen will be used to match against, if none of the 9 fields are selected it will be ignored
    2) Depending on their selection I need to create a formula that will look at the 10 combinations and assign the correct "MATCH" number. Where it gets complicated is that if they don't choose a specific field in the criteria combination, I want it to assume all records in that field are a match.
    3) Anything not matching one of the 10 combinations will show as "N" for no match.

    I'm attaching an example to help illustrate it. I really appreciate anyone's expertise on this. I've tried every formula I can think of and several options on the web. Am I over thinking this?

    Many thanks... Jay
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need help with a challenging lookup/match type of situation

    Is that a typo and D4 on Data should be CA
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-17-2022
    Location
    Dallas, TX
    MS-Off Ver
    360
    Posts
    5

    Re: Need help with a challenging lookup/match type of situation

    Yes. Sorry. Criteria should have been ELMIRAGE AZ not ELMIRAGE CA. Corrected in the attached. Thanks
    Attached Files Attached Files

  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,064

    Re: Need help with a challenging lookup/match type of situation

    IF you made a mistake at Row 18:

    =IF(C4&D4="RICHMONDCA",3,IF(A4&B4&C4&D4="CHICAGOILSANBERNARCA",2,IF(A4&B4="CHICAGOIL",1,IF(A4&B4&C4&D4="BIRMINGHAALELMIRAGEAZ",6,"N"))))
    Attached Files Attached Files
    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

  5. #5
    Registered User
    Join Date
    02-17-2022
    Location
    Dallas, TX
    MS-Off Ver
    360
    Posts
    5

    Re: Need help with a challenging lookup/match type of situation

    Row 18 is correct as shown in the example. In reality it's possible to match to multiple combinations. The "expected" results assume that if a row matches more than one combination the following order is used to determine the match:

    1) Most criteria matched Ex: CHICAGO IL - SANBERNAR CA trumps just origin of CHICAGO IL
    2) Order on the list: CHICAGO IL trumps RICHMOND CA because it's above it on the criteria selection order (ie. it's matchline ref is number #1 vs #3)

    As for the formula, there are many options for each drop down so it might not be "CHICAGO IL" every time. In fact, a CITY/ST combo isn't always going to be used. So tying it to a specific location like "CHICAGO IL" won't work if the user wants to select just ORIGIN ST "TX" and no City, or a different CITY "BIRMINGHAM" and ST "AL".

    Hope that makes sense.
    Last edited by JDBNSF; 02-18-2022 at 03:01 PM.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,572

    Re: Need help with a challenging lookup/match type of situation

    This rearrangement of Glenn's formula yields the results that were manually placed into column E on the DATA sheet:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I feel that in order for us to help with the scenario where there might only be a state selected, we will need to see another sample with expected results and perhaps corresponding explanations.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    02-17-2022
    Location
    Dallas, TX
    MS-Off Ver
    360
    Posts
    5

    Re: Need help with a challenging lookup/match type of situation

    Sure I added a couple of examples to this one of just state. At a minimum I'd like the lookup to not exclude a row of data because a City or st is blank in the criteria options because the user didn't want to manually select every column. In the actual data there will be up to 9 criteria columns that the user can choose to select a value to use as a criteria filter (ex Store ID, model #, product #, Month, Year, Origin City, Origin ST, dest City, Dest ST, etc). So they may select any number of filters and combinations. So ignoring the blanks in the lookup will allow them to do that.

    So for example.

    1) A user selects only IL as their origin ST criteria.
    2) Lookup won't assume CHICAGO IL isn't a match in the data row because user left Origin City blank.
    3) Lookup won't assume JOLIET IL to DALLAS TX isn't a match because the user left Dest CITY and ST blank.
    4) Lookup will exclude HOUSTON TX to MIAMI FL because none of the data fields match any of the criteria selections of the user

    If I can just get to that point that is fine because I can direct the user to order their criteria from most filtered to least, but it needs to look at multiple rows of criteria combinations independently, so it can't be as simple as IF (CRITERIA!A5="" then look at CRITERIA!B5... because user may have selected an origin City in CRITERIA!A6 for a different combination of matching criteria.

    But ideally, I'd like the formula to match from most complete to least complete. So if a user selects 3 different set of criteria in the CRITERIA TAB

    1) User selects only ORIGIN CITY ST of CHICAGO IL as criteria row 1
    2) User selects only ORIGIN CITY ST of CHICAGO IL and DEST CITY ST as SANBERNAR CA as criteria row 2
    3) User selects only DESTIN ST of CA as criteria row 3

    The the formula will match a row in the DATA tab of CHICAGO IL to SANBERNAR CA as 2 because it's the most complete match even though it matches all 3 in one way or another. So the hierarchy would be:

    1) Match to 2 because it the Orig City ST and Dest City ST match criteria selections of CHICAGO IL and SANBERNAR CA (most complete)
    2) Match to 1 because the origin CITY ST matches CHICAGO IL (less complete but still a match)
    3) Match to 4 because the destination ST matches to CA (least complete, but still a match)

    Hope this helps. The more I write the more I think this is too complex for excel which is why I'd be good with just not excluding a match because there is a blank in a given criteria column.
    Attached Files Attached Files
    Last edited by JDBNSF; 02-22-2022 at 11:23 AM.

  8. #8
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Need help with a challenging lookup/match type of situation

    If we assume you've no control over how the 10 criteria rows are populated, in terms of completeness, I'd likely approach along lines of the attached

    1. include a "priority" flag on each criteria row, based on completeness, and prioritise Origin over Destination (where counta otherwise identical), e.g.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    2. modify your search keys such that they incorporate wildcards + common delimiter, e.g.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    at which point

    3. conduct a SEARCH of each criteria key, isolate the most complete, and return associated index #

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    the above / attached would then mirror your expected results.
    if you're using O365 some of the above could be adapted / shortened...
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-17-2022
    Location
    Dallas, TX
    MS-Off Ver
    360
    Posts
    5

    Re: Need help with a challenging lookup/match type of situation

    That worked really good. Thank you so much! I'll play with it and see if I have any questions. Thank you all for your help!

+ 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] Index-Match type lookup to assign phrase to a number from a MaxDiff type survey matrix
    By FivestarMac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2018, 02:24 PM
  2. Replies: 1
    Last Post: 09-12-2017, 09:15 AM
  3. Need help with a VLOOKUP Type of Situation...Again
    By Daveguy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-23-2016, 10:34 AM
  4. Need help with a VLOOKUP Type of Situation
    By Daveguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-06-2016, 12:42 PM
  5. [SOLVED] sudoku type situation
    By marciupial in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-02-2015, 12:18 PM
  6. Really challenging lookup situation
    By guntar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2009, 11:05 PM
  7. Help with a Vlookup/max type situation
    By cwn7499 in forum Excel General
    Replies: 5
    Last Post: 02-15-2009, 11:19 PM

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