+ Reply to Thread
Results 1 to 9 of 9

Compare four columns, give "yes" or "no" answer

  1. #1
    Registered User
    Join Date
    09-17-2009
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    15

    Compare four columns, give "yes" or "no" answer

    Hello! This is my first time posting- I would like to thank everyone for all of the great answers. This time I can't seem to find exactly what I need on another thread, so I thought I would post my own.

    I have the attached worksheet with clients' names in four columns (A-D). The first names and last names must remain separate. I need one additional column that shows whether a full name (first and last) in C and D also appears in A and B.

    Then one more column that shows how many times the name in C and D shows up, but only if it is also in A and B.

    I hope that isn't too confusing. Thanks!

    Lauren
    Attached Files Attached Files
    Last edited by LaurenR; 09-17-2009 at 03:53 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Compare four columns, give "yes" or "no" answer

    Like this:

    forum%20example(1).xls

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Compare four columns, give "yes" or "no" answer

    Try:

    =ISNUMBER(MATCH(1,INDEX(($C$2:$C$765=A2)*($D$2:$D$765=B2),0),0))

    and

    =SUMPRODUCT(($C$2:$C$765=A2)*($D$2:$D$765=B2))

    respectively and copy them dowm
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    09-17-2009
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Compare four columns, give "yes" or "no" answer

    Quote Originally Posted by zbor View Post
    Like this:

    Attachment 53339
    Thanks for the quick reply! It looks great! I just want to make sure that the "Is Client a User" column corresponds to the name that is in columns A and B.

    In other words: in row 2, does the "yes" in column E mean that Lillian Gonzalez shows up somewhere in columns C and D? Then the 5 is how many times she is in columns C/D?

    Thanks again!

    Lauren

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Compare four columns, give "yes" or "no" answer

    If there is at least one in C/D then it's yes. If 0, then it's No.

  6. #6
    Registered User
    Join Date
    09-17-2009
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Compare four columns, give "yes" or "no" answer

    Excellent!

    One last question. When I double-clicked column F, it appears that the cells selected in columns C/D move down with each row. Should I put $s in to make them stay the same for all rows?

    Thanks to both of you for all of your help!

    Lauren

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Compare four columns, give "yes" or "no" answer

    Yes, you can lock range $C$2:$C$1000

    also, when you exceed it, don't foget to extend it.
    Although you could use C:C but it would slow your workbook slightly.

    (same for D)

  8. #8
    Registered User
    Join Date
    09-17-2009
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Compare four columns, give "yes" or "no" answer

    Thanks so much! Have a great day!

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Compare four columns, give "yes" or "no" answer

    or night

    please, make thread [solved]

+ 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