簡體   English   中英

在同一單元格中從多個工作表返回ArrayFormula

[英]Returning ArrayFormula from multiple sheets, in the same cell

我有兩個Google表格,它們具有不同的Marvel字符(列A)和它們相應的本地Universe(列C)。

工作表1

| Heroes            | Count         | Universe           |
|:------------------|--------------:|:------------------:|
| Spider Ham        | 365           | Earth-8311         |
| Iron Man          | 467           | Earth-616          |
| Hulk Bunny        | 24            | Earth-8311         |

工作表2

| Heroes            | Count         | Universe           |
|:------------------|--------------:|:------------------:|
| Spider Ham        | 234           | Earth-8311         |
| Iron Man          | 998           | Earth-616          |
| May Porker        | 11            | Earth-8311         |

Sheet3中 ,每行中的此公式=ArrayFormula(TEXTJOIN(", ";1;REPT(Sheet1!A:A;1*(Sheet1!C:C=A$2)))) (放在B列中)獲取數據從Sheet1中返回,如下所示:

| Universe         | Heroes                              |
|:-----------------|------------------------------------:|
| Earth-8311       | Spider Ham, Hulk Bunny              |
| Earth-616        | Iron Man                            |

太好了 但我也想在公式中合並Sheet2的數據-所以Sheet3看起來像這樣(沒有重復項):

| Universe         | Heroes                              |
|:-----------------|------------------------------------:|
| Earth-8311       | Spider Ham, Hulk Bunny, May Porker  |
| Earth-616        | Iron Man                            |

我想修改ArrayFormula以在Sheet1和Sheet2中進行搜索-這可以在單個Spreadsheet公式中進行嗎?

嘗試=ArrayFormula(TEXTJOIN(", ";1;REPT(Sheet1:Sheet2!A:A;1*(Sheet1Sheet2!C:C=A$2))))但它只返回#NAME?

請試試:

=ArrayFormula(TEXTJOIN(", ",1,UNIQUE(filter({Sheet1!A:A;Sheet2!A:A},{Sheet1!C:C;Sheet2!C:C}=A2))))

Google表格中的已使用數組{}filter公式。 Unique是擺脫重復。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM