+ Reply to Thread
Results 1 to 7 of 7

Using VBA to match

  1. #1
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    18

    Using VBA to match

    Hello Everybody,

    I have a business requirement to come up with a list of conflicting duties for any person who has duties assigned.
    I am not able to get the logic to do this on Excel and would need some help.

    Tables I have (Inputs):
    1) Name and Duty
    2) Duty and Conflict

    Output required:
    1) Name, Duty, Conflict

    I have attached a sample of the requirement. It has the input tables and the required output.

    Please advice.
    Warm regards.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Using VBA to match

    What about
    C2 =VLOOKUP(B2,$F$2:$G$6,2,0)
    Copy down as needed
    Then use a filter
    Attached Files Attached Files
    Last edited by PCI; 06-25-2014 at 04:55 PM. Reason: Typo

  3. #3
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Using VBA to match

    Hey PCI,

    I tried your solution on real data. But there were few conflicts listed although it was not really a conflict.
    I have attached the file here.

    What the tool needs to actually do is, check if the conflicting duty is also part of the duty list for the user.
    If it is not, then it is not a conflict.
    And this has to be checked for each user.

    Thank you so much.
    Attached Files Attached Files
    Last edited by kravi88; 06-25-2014 at 05:14 PM.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Using VBA to match

    I don't see where is an issue except that when there is several conflicts for a user only the first one is shown.
    To avoid the display of error when the user don't exist use:
    =IF( ISERROR(VLOOKUP(B2,$F$2:$G$891,2,0)),"",VLOOKUP(B2,$F$2:$G$891,2,0))
    Give more details about the wrong result of the solution
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Using VBA to match

    Hi PCI,

    The conflict should be listed only if the 'conflicting duty' is also a duty for the person.
    For eg. in the file VLookup_Method2.xlsx‎ ,
    If Ravi has duty "Application developer" alone, then "System Administrator" should not be listed as a conflicting duty.
    But If Ravi is assigned both "Application developer" and "System Administrator" as duties, then the solution should indicate that there is a conflict.
    And the result should be like this in that case:


    Name| Duty | Conflict
    Ravi |"Application developer"|"System Administrator"
    Ravi |"System Administrator"|"Application developer"

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Using VBA to match

    Try and comment
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Using VBA to match

    PCI,

    this works well.
    I couldn't understand the logic though.

    Thank you so much.

    Regards,
    Ravi.

+ 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] Vlookup to Pivot Table, using Match function, returns error if can't find match value
    By AndrewHowarth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-16-2015, 12:10 AM
  2. Index Match Match Formula DOESN'T WORK WITH TABLES/TABLE NAMES ??
    By Underling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2014, 09:01 PM
  3. Replies: 3
    Last Post: 05-08-2013, 02:10 PM
  4. [SOLVED] Index/Match/Match....Stops without completing the match
    By irsles in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-14-2012, 10:16 PM
  5. Replies: 5
    Last Post: 02-29-2012, 08:51 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