+ Reply to Thread
Results 1 to 4 of 4

How To Find Subsets In excel?

  1. #1
    Registered User
    Join Date
    04-01-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    2

    Post How To Find Subsets In excel?

    hi,

    Can i know how to find subsets of a master set in excel sheet

    for eg

    s1 has v1 v2 v3 v4 v5
    s2 has v3 v5
    s3 has v3 v7

    s1 is master and how can i find s2 as subset of s1 and s3 in not

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

    Re: How To Find Subsets In excel?

    not sure what you have but it's usually better to start with everything in a separate cell
    "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

  3. #3
    Registered User
    Join Date
    04-01-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How To Find Subsets In excel?

    yeah i placed each entry of s1 in seperate cell and same with s2 and s3

    data is placed in following fashion

    A1 -> s1
    B1 -> v1
    C1 -> v2
    D1 -> v3
    E1 -> v4
    F1 -> v5

    A2 -> s2
    B2 -> v3
    C2-> v5

    A3 -> s3
    B2 -> v3
    C3 -> v7


    s1 is master and how can i find s2 as subset of s1 and s3 in not using a logic in excel (not manually)?????? plz help

    Quote Originally Posted by martindwilson View Post
    not sure what you have but it's usually better to start with everything in a separate cell
    Last edited by shree143; 04-05-2011 at 12:23 AM.

  4. #4
    Registered User
    Join Date
    05-01-2012
    Location
    North Carolina, US
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: How To Find Subsets In excel?

    Assuming that all of your data is in columns B through F, you could insert the following formula in cell G2:

    =IF(SUM(IF(ISERROR(HLOOKUP(B2,$B$1:$F$1,1,FALSE)),0,1),IF(ISERROR(HLOOKUP(C2,$B$1:$F$1,1,FALSE)),0,1),IF(ISERROR(HLOOKUP(D2,$B$1:$F$1,1,FALSE)),0,1),IF(ISERROR(HLOOKUP(E2,$B$1:$F$1,1,FALSE)),0,1),IF(ISERROR(HLOOKUP(F2,$B$1:$F$1,1,FALSE)),0,1))=COUNTA(B2:F2),"Yes","No")

    You can then drag the formula down for subsequent rows.

    This formula works by comparing the sum of the items found to the sum of the items looked for, and returns a yes if they are equal. You can expand this as far as you want by adding other terms to the sum and expanding the hlookup and counta ranges accordingly. Note that if there is no data to check, the formula returns a "yes" because 0=0. This could be adjusted if you want.

    Sorry for resurrecting a year old post. I saw the challange and couldn't resist. I hope this helps someone.
    Last edited by horvack; 05-01-2012 at 03:45 PM.

+ 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