+ Reply to Thread
Results 1 to 11 of 11

How to isolate one to one relationships?

  1. #1
    Registered User
    Join Date
    08-13-2018
    Location
    Edmonton, Canada
    MS-Off Ver
    13
    Posts
    16

    How to isolate one to one relationships?

    Hi, hoping someone can help me with this?

    For every record in column A there can me many records in column B. For every record in column B there can be many different records in column C. I only want to look at records in column A that only have one unique record in column B.

    Hope my explanation makes sense? Be gentle with me.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: How to isolate one to one relationships?

    It would help if you attached a sample Excel workbook, then we can see exactly what you have.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    It strikes me that you can use a formula with COUNTIFS, but it would be easy to check this out if we can see your data.

    Pete

  3. #3
    Registered User
    Join Date
    08-13-2018
    Location
    Edmonton, Canada
    MS-Off Ver
    13
    Posts
    16

    Re: How to isolate one to one relationships?

    Thanks for the advice Pete. Here's the attachment.

    I am only interested in records in column A that only have one unique record in column B.

    Hope the attachment worked.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: How to isolate one to one relationships?

    Try this in cell D2:

    =IF(COUNTIF(A:A,A2)=1,"here","")

    then copy down. Is that the kind of thing that you mean?

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    08-13-2018
    Location
    Edmonton, Canada
    MS-Off Ver
    13
    Posts
    16

    Re: How to isolate one to one relationships?

    Thanks Pete. Almost what I wanted. I don't think I am explaining it very well. I want the rows with a one to one relationship even if there are multiple rows. Like in the first four rows of data, there is only one unique number in column B that correlates to column A, so I want those rows isolated as well.

    Rows 8-21 have more than one unique record in column B for every unique record in Column A, so I want them filtered out.

    I appreciate your help on this.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to isolate one to one relationships?

    Like this?

    A
    B
    C
    D
    E
    1
    Purch.Doc. Delivery Article
    2
    4501879764
    368177104
    1122697
    0
    D2: =COUNTIFS($A$2:$A$21, A2, $B$2:$B$21, "<>" & B2)
    3
    4501879764
    368177104
    1129457
    0
    4
    4501879764
    368177104
    1129633
    0
    5
    4501879764
    368177104
    1129636
    0
    6
    4501887045
    371040471
    1097146
    0
    7
    4501900610
    369255024
    1106098
    0
    8
    4501910018
    368307623
    1050078001
    2
    9
    4501910018
    368307623
    1050078002
    2
    10
    4501910018
    368307623
    1050078003
    2
    11
    4501910018
    368307623
    1050078004
    2
    12
    4501910018
    368307623
    1050078005
    2
    13
    4501910018
    368905681
    1050123002
    5
    14
    4501910018
    368905681
    1050123005
    5
    15
    4501910021
    369241847
    1060658001
    3
    16
    4501910021
    369241847
    1078665003
    3
    17
    4501910021
    369241847
    1078665004
    3
    18
    4501910021
    369241847
    1078665005
    3
    19
    4501910021
    369535643
    1101849005
    4
    20
    4501910021
    369535643
    1101849006
    4
    21
    4501910021
    369535643
    1101849007
    4


    The zero means there are no other values in col A that have a different value in col B.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to isolate one to one relationships?

    Maybe this, in d2 copied down:

    =SUM(INDEX(($A$2:$A$21=A2)*($B$2:$B$21<>"")/COUNTIFS($A$2:$A$21,$A$2:$A$21&"",$B$2:$B$21,$B$2:$B$21&""),0))

    Filter on 1 or 2 as required...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Registered User
    Join Date
    08-13-2018
    Location
    Edmonton, Canada
    MS-Off Ver
    13
    Posts
    16

    Re: How to isolate one to one relationships?

    Winner winner chicken dinner.

    Thanks so much for your help!

    May the force be with you.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to isolate one to one relationships?

    Who are you talking to??

  10. #10
    Registered User
    Join Date
    08-13-2018
    Location
    Edmonton, Canada
    MS-Off Ver
    13
    Posts
    16

    Re: How to isolate one to one relationships?

    Quote Originally Posted by shg View Post
    Like this?

    A
    B
    C
    D
    E
    1
    Purch.Doc. Delivery Article
    2
    4501879764
    368177104
    1122697
    0
    D2: =COUNTIFS($A$2:$A$21, A2, $B$2:$B$21, "<>" & B2)
    3
    4501879764
    368177104
    1129457
    0
    4
    4501879764
    368177104
    1129633
    0
    5
    4501879764
    368177104
    1129636
    0
    6
    4501887045
    371040471
    1097146
    0
    7
    4501900610
    369255024
    1106098
    0
    8
    4501910018
    368307623
    1050078001
    2
    9
    4501910018
    368307623
    1050078002
    2
    10
    4501910018
    368307623
    1050078003
    2
    11
    4501910018
    368307623
    1050078004
    2
    12
    4501910018
    368307623
    1050078005
    2
    13
    4501910018
    368905681
    1050123002
    5
    14
    4501910018
    368905681
    1050123005
    5
    15
    4501910021
    369241847
    1060658001
    3
    16
    4501910021
    369241847
    1078665003
    3
    17
    4501910021
    369241847
    1078665004
    3
    18
    4501910021
    369241847
    1078665005
    3
    19
    4501910021
    369535643
    1101849005
    4
    20
    4501910021
    369535643
    1101849006
    4
    21
    4501910021
    369535643
    1101849007
    4


    The zero means there are no other values in col A that have a different value in col B.
    Winner winner chicken dinner.

    Thanks so much for your help!

    May the force be with you.

  11. #11
    Registered User
    Join Date
    08-13-2018
    Location
    Edmonton, Canada
    MS-Off Ver
    13
    Posts
    16

    Re: How to isolate one to one relationships?

    Quote Originally Posted by Glenn Kennedy View Post
    Who are you talking to??
    Sorry for the confusion. I did not try your solution as shg's solution seemed to work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using Relationships in Powerpivot
    By kiddles13 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-04-2016, 04:57 PM
  2. Replies: 15
    Last Post: 11-28-2014, 07:10 AM
  3. Non-Linear Relationships
    By Dar in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-04-2012, 01:39 PM
  4. VBA code, One to Many relationships
    By randell.graybill in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2011, 08:39 PM
  5. Workbook Relationships
    By SDruley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2009, 05:13 PM
  6. Relationships / Calculations
    By shone in forum Excel General
    Replies: 4
    Last Post: 06-06-2006, 02:55 PM
  7. Newbie - Relationships
    By Ken in forum Excel General
    Replies: 1
    Last Post: 01-02-2005, 07:06 PM

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