Matrix style Vlookup?

csh8428

New Member
Joined
Mar 20, 2013
Messages
5
I have a spreadsheet with 4 columns: A - Child, B - Parent, C - Child contact, D - Parent contact
Each Parent belongs to the same parent(this is needed for reasons unrelated to this issue)
Each child belongs to a parent
Each child can have none, 1, or multiple contacts. Each Parent can have none, 1, or multiple contacts
These contacts may be the same for the child and the parent.

What I need to know is to identify each parent and child where the child and parent have a different contact, unless the parent has a contact, but the child doesn't.


Code:
|  Child | Parent | Child contact | Parent Contact|
| 123 |   123      |   John            |    John            |
| DEF  |   123    |   John            |   John             |
| 345  |   345     |   Sam            |   Sam             |
| JKL   |   345    | David            |   Sam             |
| MNO |  345     |                     |   Sam             | 
| 567  |   567     |                     |                       |
| TUV  |  567     | Scott            |                       |
| 789  |   789     | Kim              |  Kim                |
| QRS |  789      |                    | Kim                 |

These SHOULD be identified
345(Parent) - Parent has a different contact than at least one of the children
JKL (child) - has different contact than it's parent(345)
567(Parent) - has different contact than child
TUV(child) has different contact than parent

These should NOT be identified
123(parent), DEF(child) - same contacts
789(parent), QRS(child) - Child doesn't have a contact, but the parent does
MNO(child) - child doesn't have a contact, but the parent does

Thanks for any help!

Craig
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
It took me a while to work through your logic, but I believe this does what you want:

ABCDEF
1ChildParentChild ContactParent ContactIdentify
2123123JohnJohnFALSE
3DEF123JohnJohnFALSE
4345345SamSamTRUE
5JKL345DavidSamTRUE
6MNO345SamFALSE
7567567TRUE
8TUV567ScottTRUE
9789789KimKimFALSE
10QRS789KimFALSE

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
F2=IF(A2=B2,COUNTIFS(B:B,B2,C:C,D2)+COUNTIFS(B:B,B2,C:C,"")< COUNTIF(B:B,B2),IF(C2<>"",IF(COUNTIFS(A:A,B2,D:D,C2)=0,TRUE)))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top