+ Reply to Thread
Results 1 to 2 of 2

Need help with formula to determine if two names appear together in a column

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    Mississippi
    MS-Off Ver
    Excel 2011
    Posts
    1

    Need help with formula to determine if two names appear together in a column

    Hi,

    I'm working on building a spreadsheet to track the results of a friendship survey completed by elementary school students. I'm trying to build a formula that will determine if two names appear together in a column (friendship group). A brief sample of how entries would look:

    A B C D
    1 Mike Sara Steve Chad
    2 Ryan Owen Chad Steve
    3 Steve David Owen Sara
    4 Sara Kate Mike Mike

    The formula I need help with would determine how many times a particular student is endorsed as belonging to the same friendship group as a peer. For example, in how many columns "Mike" appears with "Sara."

    Any help would be greatly appreciated!

    Thanks!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need help with formula to determine if two names appear together in a column

    It may be easiest to insert a helper column to create a single string of all the names in one row. Then a not-too-complex COUNTIFS() function can test those strings for pieces that match.

    E1: =A1&"-"&B1&"-"&C1&"-"&D1
    G2: Name to search
    H2: Name to search
    I2: Results =COUNTIFS(E:E, "*"&G2&"*",E:E, "*"&H2&"*")


    2013-02-23_0306.png
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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