jamescurtis29
New Member
- Joined
- Jan 9, 2019
- Messages
- 3
Hello Excel superior beings, I bow to your wisdom and knowledge.
Apologies for reposting this question, the last post had such poor layout! I think I've fixed it now and you can see the tables below.
I know this must be possible but I cannot think of how to do it and have used this forum in the past to find information but have not been able to find this question asked previously.
I have a list of groups with group ids and members of each group representing subgroups. It looks a little like this:
<thead>
[TH="align: left"]Group
[/TH]
[TH="align: left"]Sub-group
[/TH]
[TH="align: left"]
[/TH]
</thead> <tbody>
[TD="align: left"]1
[/TD]
[TD="align: left"]a
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]2
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]2
[/TD]
[TD="align: left"]d
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]3
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]3
[/TD]
[TD="align: left"]d
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]4
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]4
[/TD]
[TD="align: left"]e
[/TD]
[TD="align: left"]
[/TD]
</tbody>
I want to find the most common pairings of subgroups. So in the list above a+b appear in 1 groups, a+c appear in 1 groups, b+c appear in 1 group, c+d appear in 2 groups and b+e appears in 1 group. But I cannot think of how to achieve it.
I think it would end with a table that looks like:
<thead>
[TH="align: left"]Sub-group
[/TH]
[TH="align: left"]Sub-group
[/TH]
[TH="align: left"]number of groups
[/TH]
</thead> <tbody>
[TD="align: left"]c
[/TD]
[TD="align: left"]d
[/TD]
[TD="align: left"]2
[/TD]
[TD="align: left"]a
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]a
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]e
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
</tbody>
Any ideas? Something to do with countifs and pivot tables?
Thank you in advance for your help. If you alternatively can think of the answer to this from a previous post and could share that with me, that would also be very welcome!
Apologies for reposting this question, the last post had such poor layout! I think I've fixed it now and you can see the tables below.
I know this must be possible but I cannot think of how to do it and have used this forum in the past to find information but have not been able to find this question asked previously.
I have a list of groups with group ids and members of each group representing subgroups. It looks a little like this:
<thead>
[TH="align: left"]Group
[/TH]
[TH="align: left"]Sub-group
[/TH]
[TH="align: left"]
[/TH]
</thead> <tbody>
[TD="align: left"]1
[/TD]
[TD="align: left"]a
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]2
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]2
[/TD]
[TD="align: left"]d
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]3
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]3
[/TD]
[TD="align: left"]d
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]4
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]4
[/TD]
[TD="align: left"]e
[/TD]
[TD="align: left"]
[/TD]
</tbody>
I want to find the most common pairings of subgroups. So in the list above a+b appear in 1 groups, a+c appear in 1 groups, b+c appear in 1 group, c+d appear in 2 groups and b+e appears in 1 group. But I cannot think of how to achieve it.
I think it would end with a table that looks like:
<thead>
[TH="align: left"]Sub-group
[/TH]
[TH="align: left"]Sub-group
[/TH]
[TH="align: left"]number of groups
[/TH]
</thead> <tbody>
[TD="align: left"]c
[/TD]
[TD="align: left"]d
[/TD]
[TD="align: left"]2
[/TD]
[TD="align: left"]a
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]c
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]a
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]b
[/TD]
[TD="align: left"]e
[/TD]
[TD="align: left"]1
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
[TD="align: left"]
[/TD]
</tbody>
Any ideas? Something to do with countifs and pivot tables?
Thank you in advance for your help. If you alternatively can think of the answer to this from a previous post and could share that with me, that would also be very welcome!