我有一张从 A1-A10 看起来像这样的桌子
**Animal**
Zebra
Zebra
Zebra
Giraffe
Giraffe
Monkey
Monkey
Cat
Cat
Run Code Online (Sandbox Code Playgroud)
我只想返回水平连续的唯一值 - 并按字母顺序对它们进行排序
像这样:
Cat Giraffe Monkey Zebra
Run Code Online (Sandbox Code Playgroud)
目前我在 D3 中有这个公式:但这会垂直返回唯一值
=IFERROR(LOOKUP(2, 1/(COUNTIF($D$2:D2, $A$2:$A$10)=0), $A$2:$A$10), "")
Zebra
Monkey
Giraffe
Cat
Run Code Online (Sandbox Code Playgroud) 我在 Sheet1 中有一张看起来像这样的表
**Sport**
Basketball
Basketball
Basketball
Volleyball
Volleyball
Football
Football
Football
Football
Football
Football
Hockey
Hockey
Hockey
Run Code Online (Sandbox Code Playgroud)
我在 Sheet2 中有一张表,如下所示:
SPORT Basketball Volleyball Football Hockey
SCORE 3 2 6 3
Run Code Online (Sandbox Code Playgroud)
我在 B1 中应用了以下公式:
=TRANSPOSE(UNIQUE(FILTER(Sheet1!$A$2:$A$15,Sheet1!$A$2:$A$15<>"")))
Run Code Online (Sandbox Code Playgroud)
B2中的公式:
=COUNTIF(Sheet1!$A$2:$B$15,Sheet2!B1)
Run Code Online (Sandbox Code Playgroud)
但是,当 Sheet1 中的列更新时。例如,将曲棍球领域之一更改为高尔夫,这会在 HEADER 中更新,但下面的公式和格式不会传递,而无需实际拖动它。
SPORT Basketball Volleyball Football Hockey Golf
SCORE 3 2 6 3
Run Code Online (Sandbox Code Playgroud)
正如你所看到的 Gold 的分数是空的....我需要自动填充它。有没有办法让excel自动将列中连续的公式“拉”到添加的行中?
(简化数据和公式,便于理解!!)