+ Reply to Thread
Results 1 to 10 of 10

Data matching and validation

  1. #1
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Data matching and validation

    I have data in two different columns in sheet 1. The data should contain the same number strings as each other. I have been unsuccessful creating a code that could verify that the numbers in each column are the same. The order by rows is not important, only that one column doesn't have extra or less rows of these number strings as the other. I have attached a workbook that will further explain this. Help would be greatly appreciated. Thank you.
    Data validation question.xlsx
    Last edited by RaydenUK; 02-26-2015 at 08:07 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Data matching and validation

    Does this help?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Data matching and validation

    Thank you for the code! I tried it and it works great. But would it be possible to incorporate a message box that notify the user if one column has more or less rows with the number strings? In the example in the workbook, there are 10 patient numbers in both columns. However, if one of the columns had an extra patient number compare to the other, then a message box would popup and say "Error! Patient entries do not match." But if they do match, as with the workbook example, then have a message box to say "Success! All entries match.". Thank you for your help. Also there may be more than 10 patient entries, essentially up to 100. Can the code be adjusted to recognize the amount of data in each column?
    Last edited by RaydenUK; 02-26-2015 at 10:33 AM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Data matching and validation

    In your sample data Column A how do you determine what is a Patient Number and what is not? I may be confused. Does this help?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Data matching and validation

    Sorry for the confusion, but I should have clarified that the patient numbers are those in each column that contains 9 numbers or so, like 350502945 which corresponds to "Allen". The column on the left contains a few extra rows of info that are considered Quality Control measures. These should be ignored when validating patient numbers in each column. In other words, it just needs to match up the patient numbers that are highlighted in yellow. If those are the exact same and there are the same amount of patients between the columns then its a "success", otherwise if a number is different or one column has more patients then the other then its an "error". I hope this clears it up a bit.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Data matching and validation

    Try:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Data matching and validation

    That almost does what I need it to. This data may range from 1 patient to 100 patients so can it be coded to just recognize the amount present instead of a set limit? Also, If the right column (G) has an extra patient entry then it doesn't get detected and it still says success. If it does give "Error", could it highlight the numbers that don't match in red fill? Again thank you so much for taking the time to do all this.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Data matching and validation

    Try:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 02-26-2015 at 12:37 PM.

  9. #9
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Data matching and validation

    WOW!!! You are amazing! I cannot thank you enough. This is PERFECT! Thank you again!

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Data matching and validation

    You're welcome. Glad to help out and thanks for the feedback.

+ 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] Prevent matching entries on same row from appearing in the Data Validation dynamic range.
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 12-22-2013, 01:32 PM
  2. Help! I need to add together cells with a matching data validation
    By grahamkendall82 in forum Excel General
    Replies: 6
    Last Post: 02-15-2012, 02:48 AM
  3. Calculating Time matching info in Data Validation Column and Date
    By dbroderick in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2010, 04:22 PM
  4. Data matching with data validation
    By nikesone in forum Excel General
    Replies: 2
    Last Post: 10-30-2008, 07:52 PM
  5. Data Validation via Matching?
    By Centrum in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2007, 09:08 AM

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