+ Reply to Thread
Results 1 to 7 of 7

alphanumeric code match based on multiple criteria

  1. #1
    Registered User
    Join Date
    11-30-2018
    Location
    London
    MS-Off Ver
    2016
    Posts
    10

    alphanumeric code match based on multiple criteria

    Hi,

    I am trying to find a formula(s) that help inform whether an alphanumeric code in a specific cell matches criteria for it to a be ‘Pass’ or ‘No Pass’ with other cells of the same column.

    The 1st column would hold the alphanumeric code and the second column would hold the formula which would tell whether the code is a ‘Pass’ or ‘No Pass’.

    An example of the codes used:

    A1000
    B1000
    A2000
    X2000
    B300
    Y300
    A4000
    Z4000
    X4000
    A800
    B9000
    X500
    Z500

    Explanation of how codes interact:

    A and B codes can be standalone codes only (e.g. A800 or B9000) = Pass
    X, Y and Z codes need to have a matching A or B code (e.g. A2000 and X2000 or B300 and Y300) = Pass
    A and B codes can never match (e.g A1000 and B1000) = No Pass
    X, Y and Z codes can never match (e.g X500 and Z500) = No Pass
    Only one pair of A and B codes can ever match with X, Y and Z codes (A2000 and X2000 or B300 or Y300) = Pass
    There cannot be more than one pair of either X, Y or Z codes that match with either an A or B code (e.g. X4000 and Y4000 and A4000) = No pass

    The minimum number of digits for numbers used in a code would be 3 while the maximum would be 4.

    I hope this makes sense and hope someone can help me out.

    Thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: alphanumeric code match based on multiple criteria

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-30-2018
    Location
    London
    MS-Off Ver
    2016
    Posts
    10

    Re: alphanumeric code match based on multiple criteria

    Have now attached an excel spreadsheet if this helps anyone?
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: alphanumeric code match based on multiple criteria

    Try this in B2 and copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-30-2018
    Location
    London
    MS-Off Ver
    2016
    Posts
    10

    Re: alphanumeric code match based on multiple criteria

    Thanks for getting back to me.

    The formula is not where I want it to be - just yet. I definitely think your on the right path though - thanks for your help so far.

    I have attached an updated spreadsheet which I hope can help you out.

    I have highlighted in orange where the formula is not working as expected.

    I dont think the formula is taking into consideration the any Z codes?

    The A4000, Z4000 and X4000 codes should all be 'No Pass' - this is because there are Z and X codes that match with A codes.

    A5777, Y5777, X5777 and B777 codes should also be 'No Pass' also.

    This is because there are Y and X codes that match, as well A and B codes that match.

    If one does not pass they all should be 'No Pass'.

    A777 and Z777 should 'Pass' because the code has a matching A code.

    I hope this is a better explanation, I know there are a couple if things I did not mention before that I should have done.
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: alphanumeric code match based on multiple criteria

    I know there are a couple if things I did not mention before that I should have done.
    Mmm, well, you don't get what you don't ask for

    I have provided a number of OR'd conditions that were intended to cater for the majority of the conditions you outlined. That said, the combinations are complex and not easy to follow. You, obviously know what you consider valid and what you don't.

    Given the formula that you now have, I suggest that you have ago at adding further constraints to exclude invalid combinations.

    I'm sure it will be easier for you with your insight into your data than it will be for an outsider.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: alphanumeric code match based on multiple criteria

    Does this right?

    Please try at E2

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Base on your description, A and B codes can never match (e.g A1000 and B1000) = No Pass
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 01-18-2019, 03:55 PM
  2. How to sum Index/Match based on multiple criteria ?
    By donny007 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-18-2019, 02:06 AM
  3. Optimize VBA code: Match multiple criteria
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2017, 08:56 AM
  4. [SOLVED] How to use Index and Match based on multiple criteria using multiple worksheets
    By MariMano in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-15-2017, 09:01 AM
  5. VBA Code for Index/Match/Match to input into excel based on 2 criteria inside form
    By Carl Fisher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2017, 12:11 PM
  6. VBA code for combined sumif index/match for multiple criteria
    By megaheinz in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-16-2016, 11:44 AM
  7. match based on multiple criteria
    By simpson in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-20-2013, 05:49 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