Results 1 to 27 of 27

Exclude data conflicts and then match remaining Data

Threaded View

Lee_of_Excel Exclude data conflicts and... 09-01-2020, 09:03 PM
Lee_of_Excel Re: Exclude data conflicts... 09-02-2020, 09:31 PM
jindon Re: Exclude data conflicts... 09-02-2020, 10:44 PM
Lee_of_Excel Re: Exclude data conflicts... 09-02-2020, 10:59 PM
jindon Re: Exclude data conflicts... 09-02-2020, 11:15 PM
Lee_of_Excel Re: Exclude data conflicts... 09-02-2020, 11:24 PM
jindon Re: Exclude data conflicts... 09-02-2020, 11:28 PM
Lee_of_Excel Re: Exclude data conflicts... 09-02-2020, 11:41 PM
Lee_of_Excel Re: Exclude data conflicts... 09-02-2020, 11:32 PM
jindon Re: Exclude data conflicts... 09-02-2020, 11:39 PM
Lee_of_Excel Re: Exclude data conflicts... 09-02-2020, 11:46 PM
jindon Re: Exclude data conflicts... 09-03-2020, 05:33 AM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 05:59 AM
jindon Re: Exclude data conflicts... 09-03-2020, 06:03 AM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 07:09 AM
jindon Re: Exclude data conflicts... 09-03-2020, 07:30 AM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 07:44 AM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 08:28 PM
jindon Re: Exclude data conflicts... 09-03-2020, 08:51 PM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 10:01 PM
jindon Re: Exclude data conflicts... 09-03-2020, 10:06 PM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 10:12 PM
jindon Re: Exclude data conflicts... 09-03-2020, 10:22 PM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 10:38 PM
jindon Re: Exclude data conflicts... 09-03-2020, 10:45 PM
Lee_of_Excel Re: Exclude data conflicts... 09-03-2020, 11:00 PM
Lee_of_Excel Re: Exclude data conflicts... 09-04-2020, 02:39 AM
  1. #1
    Registered User
    Join Date
    11-07-2018
    Location
    Sydney Australia
    MS-Off Ver
    2016 Pro
    Posts
    74

    Exclude data conflicts and then match remaining Data

    Hello again all,

    I have another matching puzzle to solve, previously Jindon was able to solve my 2 way preference matching, Thanks again @Jindon!! but this time I have a some other variables with 1 way preferences.

    Ok...

    My goal is to Match a list of 1-10000 USERID's with an appropriate SITEID.

    I have a full table of SITEID's.

    The USERID data will come in as a row in Excel, which shows:
    1. USERID (Which is Numeric)
    2. States of Australia to Exclude (could also be none)
    3. 0 - 50 SITEID's to Exclude (alpha/numeric and numeric)
    4. 0 - 5 SITEID Preferences (alpha/numeric and numeric)


    My Matching algorithm includes the following rules:
    1. Exclude USERID States from corresponding list of SITEID States (For example if a USERID inputs NSW and VIC, they will be excluded from all SITEID's in these states, could also have none)
    2. Exclude USERID Conflict SITEID's A (e.g. If a USERID inputs 0-50 SITEID's, they will be excluded from their choice of SITEID's)
    3. Match a USERID to SITEID Preference Match - they may input 0-5 preferences, (e.g. If the USERID's preference 1 matches a SITEID from the remaining list of SITEID's let over after Exclusions then Show the match in a new Cell, (Preferences have order of priority)
    4. If there are no SITEID's to match the preferences show "No Match"

    So a full Example might be:
    USERID 111 identifies NSW and VIC to be excluded
    USERID 111 identifies SITEID 111, SITEID 112 and SITEID 113 to be excluded
    USERID 111 preferences are SITEID's 115, 116 and 117
    As SITEID 115 is in NSW this SITEID isn't available, so the algorithm tries preference 2 - SITEID 116
    SITEID 116 is in QLD so we have a match of USERID 111 and SITEID 116
    Then the Algorithm moves to the next USERID
    (If the algorithm couldn't match any SITEID's from the USERID preferences then it would show "NO MATCH")
    (Some SITEID don't have a State assigned or aren't in Australia so these can also show "NO MATCH")


    Multiple USERID's can match the same SITEID's
    Each USERID starts with a full list of SITEID's before exclusions occur

    So the end product will show in the last column for each row (Each USERID), something like:
    SITEID 111
    SITEID 5435
    No Match
    SITEID 3267
    No Match
    No Match
    SITEID 111

    and so on.

    I have attached the spreadsheet and I believe the solution is to Reference the STATEEXCLUSIONS against the StateTable (Table 2) as a dictionary, and Reference the SITEEXCLUSIONS against the SITETABLE (Table 1) as a dictionary to Exclude them from the full Site list and then Match the SITEPREFERENCES. I just can't write the syntax correctly.

    Cheers

    *Note: This isn't listed on any other forums etc
    Attached Files Attached Files
    Last edited by Lee_of_Excel; 09-02-2020 at 09:45 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to eliminate certain data from the worksheet and then sort the remaining data
    By sumesh56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2018, 12:13 PM
  2. Macro to clear row data then shift remaining data up to empty rows.
    By clarmech in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2014, 04:35 PM
  3. Exclude items from Data Validation List based on another columns data
    By amartin575 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-19-2013, 11:53 AM
  4. Index/match or Vlookup to exclude data
    By MZing81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2012, 03:32 PM
  5. How to find match data and exclude with condition
    By buvan in forum Excel General
    Replies: 2
    Last Post: 11-17-2011, 06:51 AM
  6. exclude a match condition between two data fields
    By rhiekel in forum Excel General
    Replies: 6
    Last Post: 04-22-2011, 10:53 AM
  7. [SOLVED] Adding data to celss but keeping the remaining data intact.
    By TP in forum Excel General
    Replies: 4
    Last Post: 04-12-2006, 09:20 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