我正在一个Gephi项目中,我需要定义人(与谁一起工作的人)之间的链接。
我有一个Google表格文档,每行都有名称。 例如:
我正在寻找一个函数,该函数可以在两列中显示谁与谁一起工作。这样:
如果您认为Google表格不是问题,并且可以在Excel上进行操作,也可以向我发送建议。
答案 0 :(得分:0)
如果有人在寻找答案,我今天早上就找到了。
我所要做的就是编辑有关此堆栈溢出问题的代码 Google Sheets - Function to combine cells in a column into two columns with all possible combinations?
更改包含数据的单元格范围(例如,从A1到F1),然后将代码粘贴到新的单元格中。
示例:
=ARRAYFORMULA(SPLIT(SORT(TRANSPOSE(SPLIT(CONCATENATE(REPT(UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",",1,A1:F1)),",")))&","& TRANSPOSE(UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",", ,A1:F1)),",")))), ( UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",",1,A1:F1)),",")))<= TRANSPOSE(UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",",1,A1:F1)),",")))))* REGEXMATCH(CONCATENATE(","&SUBSTITUTE(TEXTJOIN(",",1,A1:F1),",",",,")&","&CHAR(9)),"(,"& UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",",1,A1:F1)),",")))&",[^\t]*,"& TRANSPOSE(UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",",1,A1:F1)),","))))&",)|(,"& TRANSPOSE(UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",",1,A1:F1)),","))))&",[^\t]*,"& UNIQUE(TRANSPOSE(SPLIT(JOIN(",",TEXTJOIN(",", ,A1:F1)),",")))&",)"))&CHAR(9)),CHAR(9)))),","))