ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create matrix data from two columns? (https://www.excelbanter.com/excel-programming/280422-create-matrix-data-two-columns.html)

Dav Bran

Create matrix data from two columns?
 

Hello Excel Experts,

I've an issue that requires your expertise, as follows:

A MySQL database outputs data about groups members belong
to in two columns, as shown he

GroupID MemberID
1 35
1 657
2 43
2 57
2 35
3 657
3 43
3 57

It would be useful if this data could be re-sorted into a
matrix format, based on either variable, as shown he

Count By GroupID (count of how many members groups share)
1 2 3
1 2 1 1
2 1 3 2
3 1 2 3

Count by MemberID (count of how many groups members share)
35 43 57 657
35 2 1 1 1
43 1 2 2 1
57 1 2 2 1
657 1 1 1 2

As you can see, data is repeated in the matrix, so if its
easier to creat just half the matrix, that's fine too. The
goal is to get the data in matrix format for 'social
network' analysis, which requires the format. Once you
have the data in the right format, you can do a lot, but
getting it into that format usually requires hand-coding
or special data collection tools. If you can figure this
out, there are many, many social scientists out there
who'll be able to convert datasets for new analyses, and
who'll sing your praises in the process.

Thanks in advance,
Dav Bran




All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com