2016-06-09 56 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) 
)} 
相關問題