2016-06-09 57 views
-1

我有一些数据如下集团在每一个值列在另一列中的数据

email id   subject of interest 
[email protected]  Java,C++ 
[email protected]   VB 
[email protected]  Python 
[email protected]  Java,C++ 
[email protected]   JS 
[email protected]   C# 

但我需要它的格式如下─

email id   subject of interest 
[email protected]  Java,C++,Python 
[email protected]   VB,JS 
[email protected]  Java,C++ 
[email protected]   C# 

是否有人可以告诉我我怎样才能做到这一点?

回答

1

首先,用=unique(A2:A)创建唯一电子邮件地址列表。假设这是在C列中单元格D2完成

然后,输入=join(",", filter(B$2:B, A$2:A=C2))并拖动该式向下columd D.

说明:filter仅保持从B列中的条目相匹配的电子邮件; join将它们连接成逗号分隔列表。

+0

非常感谢您的帮助.. :)现在我又多了一个查询。 。我必须检查谁对某种语言感兴趣。例如,如果我使用电子邮件ID“[email protected]”搜索,那么我应该将输出作为“Java,C++,Python”。是否有可能? ?通过谷歌电子表格脚本或Excel脚本..? – Kanchan

+0

感谢您的帮助..我有下面的电子表格作为网站所有者列表。我想检查哪个电子邮件ID拥有对网站的所有者访问权限。就像一个电子邮件ID可以让所有者访问许多网站。所以我需要那个。你能告诉我如何使用谷歌应用脚​​本来做到这一点?这里是表格https https://docs.google.com/spreadsheets/d/1xeLZk1AKUCj7sbBrcAaJRl5MON2zkxVwcfssG3Wgzpw/edit#gid=0 – Kanchan

1

尝试使用查询功能:

=QUERY({A:B,A:B},"select Col1, Count(Col2) where Col1 <> '' group by Col1 pivot Col4") 

也可以尝试这个公式,这是单式解决方案:

={UNIQUE(FILTER(A2:A,A2:A>0)),TRANSPOSE(
    SPLIT(
     ", "&join(", ", 
     ARRAYFORMULA(
      if(query(A:B,"select A where not A is null order by A",0)= 
       query(A:B,"select A where not A is null order by A limit "&COUNT(query(A:B,"select A where not A is null",0))-1,1),"","|") 
      & query(A:B,"select B where not A is null order by A",0) 
      & " " 
     ) 
    ) 
    ,", |",0) 
)} 
相关问题