+ Reply to Thread
Results 1 to 7 of 7

Thread: Extracting values from Column

  1. #1
    Registered User
    Join Date
    11-12-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Extracting values from Column

    Hello,

    I have three columns one with

    (A)Person ID # (B) Fathers ID # C) Mother ID #

    I want to find a way that I can derive another two collumns that would contain Ego ID # and Sibling ID # on a second sheet, or in columns J &K
    So it would look:

    (A) Person ID # (B)Sibling ID#


    I need a formula that create two columns with all of the pairings of people who share Fathers and Mothers. In other words, create two new columns that have the pairs of Person ID #'s who have the same value for Father ID # and Mother ID #. Does this make sense? If possible I would like the formula to exclude those people whos father and mother ID #s are 0.
    Attached Files Attached Files

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Extracting values from Column

    PID's 2, 3 and 4 have the same parents.. how will column J and K look for this set?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    11-12-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Extracting values from Column

    J k
    2 3
    3 4
    4 2

  4. #4
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Extracting values from Column

    Try this:

    Duplicate column A to column J... then in K2 add a helper formula:

    =B2&"_"&C2

    copied down.

    Then in L2:

    =IF(OR(COUNTIF($K$2:$K$273,K2)=1,K2="0_0"),"",IF(COUNTIF(K$2:K2,K2)=COUNTIF($K$2:$K$273,K2),INDEX($J$2:$J$273,MATCH(K2,$K$2:$K$273,0)),INDEX($J$2:$J$273,SMALL(IF($K$2:$K$273=K2,IF($J$2:$J$273<>J2,ROW($J$2:$J$273)-ROW($J$2)+1)),COUNTIF(K$2:K2,K2)))))
    confirmed with CTRL+SHIFT+ENTER and not just ENTER and copy down.

    this will show blanks if the parents are 0's or if there are no siblings (i.e. duplicate parents).

    See attached.

    After you have done this, you can hide column K or you can move column K over to column I and delete the blank column K so that the helper is with the original...
    Attached Files Attached Files
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    11-12-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Extracting values from Column

    Thank you that really helped,
    Do you know if there is a way that I can automatically pair down columns J and L to only have values in when there are values in both columns?

  6. #6
    Registered User
    Join Date
    11-12-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Extracting values from Column

    There is a problem with the formula.

    I have been using it on other sheets and when there is a situation where there is a large number of siblings it does not account for all of them.

    Any Ideas how to correct it?

  7. #7
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Extracting values from Column

    Have you adjusted the ranges to suit the new database size?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ 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.2.0