+ Reply to Thread
Results 1 to 5 of 5

Check if data is correct in 2nd column with matching a value in the 1first column

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Check if data is correct in 2nd column with matching a value in the 1first column

    Hi!

    I have 2 columns of data.

    first column is filled with names and the second is filled with a team number like: Team 1, Team 2, Team 3, etc.

    These columns are filled in by users through a form. The problem is that users accidentally fill in the wrong team number. So some of the data will come out like in the example below.

    Names Teams
    Name 1 Team 1
    Name 1 Team 2
    Name 1 Team 2
    Name 2 Team 3

    So 'Name 1' made a mistake with filling in 'Team 1' and it suppose to be 'Team 2'.

    It would be enough for me if I can just get an alert when there is a name connected with more then one team. I could change the values manually. Solutions in VBA or formula's in other column are both welcome.

    Thanks in advance.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Check if data is correct in 2nd column with matching a value in the 1first column

    Hi Looney,

    welcome to the forum.
    You can use below formula to check the data:-
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    name & team.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    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
    48,440

    Re: Check if data is correct in 2nd column with matching a value in the 1first column

    I'm not sure I understand the logic. Is a Name a member of only one (1) Team? If so, what's the point of asking them to fill in what is, to all intents and purposes, some static information linked to the Name.

    Why not have a table set up with all the possible names and their associated team and use VLOOKUP to fill the Team box. problem solved.

    Regards, TMS
    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


  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Check if data is correct in 2nd column with matching a value in the 1first column

    hi looney, welcome to the forum. assuming your data is in A2:B5, you can try this formula in C2:
    =SUMPRODUCT(($A$2:$A$5=A2)*($B$2:$B$5<>B2))>0

    drag down the formula & you have a bunch of TRUEs & FALSEs. you can then filter the TRUE & check them. you can also do conditional formatting to highlight those cells.
    select the range you want to apply to (say from A2:B5)
    in Excel 2007 & above, go to Home -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    in Excel 2003, go to Format -> Conditional Formatting -> Formula is:
    =SUMPRODUCT(($A$2:$A$5=A2)*($B$2:$B$5<>B2))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Check if data is correct in 2nd column with matching a value in the 1first column

    Thanks.

    This is helping... Although after tweaking the formula to my situation. It also tells me 'need checking' when there are more rows with the same name. The entries are daily so there will probably 4 to 5 entries with the same name. Sometimes there is a mistake made with the selected teamnumber. So I only need to check if there are names who have selected different team number in the same week. for example. On Monday 'Name 1' selects 'Team 1' and on Tuesday he selects 'Team 2' and so on. Name 1 should select in one week every time the same team.

    To reply on TMShucks...
    The teams can change every week. A team member can belong to a different team the following week. And there is not a list or possibility to keep track of who is in which team every week.
    If they would... It would make a much easier job for me... but thanks!

    I think the solution of Benishiryo would help me a bit more on the way. I applied this on the column for teams and highlighting those cells is really a charm! It shows directly what needs to be changed!
    I am going to see If I can apply this in some sort of macro.

    Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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