+ Reply to Thread
Results 1 to 12 of 12

Determine If Duplicate with Value in Adjacent Cell Considered

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Seattle, WA, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Determine If Duplicate with Value in Adjacent Cell Considered

    I have a worksheet with data that looks like this:

    Name Group
    Johnson 1
    Smith 0
    McDonald 2
    Long 3
    Smith 2
    Long 1
    McDonald 0
    Johnson 3

    In an adjacent cell I'd like to be able to indicate which names are duplicated, but are not in group 0. The result may look something like this:

    Name Group Duplicate
    Johnson 1 Yes
    Smith 0 No
    McDonald 2 No
    Long 3 Yes
    Smith 2 No
    Long 1 Yes
    McDonald 0 No
    Johnson 3 Yes

    I would prefer not to use VBA code.

    Any and all help in solving this task is greatly appreciated.
    Thanks.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    Hey BooFoo22

    Welcome to the forum.
    maybe something like.....
    =IF(COUNTIF($A$2:$A$20,A2)>1,"Yes","No")
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    with column headers in a1 and b1 then in c2
    =IF(SUMPRODUCT(--($A$2:$A$9=A2),--($B$2:$B$9<>0))>1,"yes","no")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    ops left a bit out
    =IF(AND(COUNTIF($A$2:$A$20,A2)>1,COUNTIF($B$2:$B$20,B2)>1),"Yes","No")

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    a bit? lol
    still doesn't work as it gives yes for everything
    Last edited by martindwilson; 07-09-2010 at 08:27 PM.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    martin would it be

    =IF(SUMPRODUCT(--($A$2:$A$9=A2),--($B$2:$B$9=B2))>1,"yes","no")

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    nope that gives all no's!

  8. #8
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    Perhaps this:

    =IF(B2=0,"No",IF(SUMPRODUCT(($A$2:$A$10=A2)*($B$2:$B$10<>0))>1,"Yes","No"))

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    @ pike lol!!!!!
    Attached Files Attached Files

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    LOL
    Im a dill

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    err humble pie time! pb71 has pointed out an error (well it was 1:30am on a friday after several pints!) function doesnt work if more than 2 of a person and such ! a new improved version is (now i hope this is right)
    =IF(COUNTIF($A$2:$A$10,A10)=1,"no",IF(SUMPRODUCT(--($A$2:$A$20=A10),--($B$2:$B$20=0)),"no","yes"))
    Attached Files Attached Files
    Last edited by martindwilson; 07-10-2010 at 06:56 AM.

  12. #12
    Forum Contributor
    Join Date
    05-16-2010
    Location
    UK
    MS-Off Ver
    2003 and 2007
    Posts
    252

    Re: Determine If Duplicate with Value in Adjacent Cell Considered

    Martin,
    The more I think about it, maybe your first suggestion was correct. Who knows? If there was more data to work with then it would be clearer e.g.

    Johnson 1 Yes
    Smith 0 Yes (Yes because 2 names Smith are not in group 0??)
    McDonald 2 No
    Long 3 Yes
    Smith 2 Yes (Yes because 2 names Smith are not in group 0??)
    Long 1 Yes
    McDonald 0 No
    Johnson 3 Yes
    Smith 1 Yes

    ..in which case your first suggestion is correct (and advanced apologies)

    or

    Johnson 1 Yes
    Smith 0 No (stays No because group 0??)
    McDonald 2 No
    Long 3 Yes
    Smith 2 Yes (because 2 names Smith not in group 0??)
    Long 1 Yes
    McDonald 0 No
    Johnson 3 Yes
    Smith 1 Yes (because 2 names Smith not in group 0??)

    or

    Johnson 1 Yes
    Smith 0 No (stays No because the name Smith is in group 0??)
    McDonald 2 No
    Long 3 Yes
    Smith 2 No (stays No because the name Smith is in group 0??)
    Long 1 Yes
    McDonald 0 No
    Johnson 3 Yes
    Smith 1 No (stays No because the name Smith is in group 0??)

    ...HELP!!

+ 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