Excel - Return 一行中水平匹配两个变量的列中的多个匹配值

Excel - Return multiple matching values from a column matching two variables, horizontally in one row

我有这个table:

|   | A       | B      | C |
|---|---------|--------|---|
| 1 |         |        |   |
| 2 | Oranges | Red    | 1 |
| 3 | Apples  | Yellow | 2 |
| 4 | Grapes  | Orange | 3 |
| 5 | Oranges | Orange | 4 |
| 6 | Apples  | Red    | 5 |
| 7 | Grapes  | Green  | 6 |
| 8 | Apples  | Green  | 7 |

我想检查 A 列中的匹配值,例如 Apples,YellowApples,Green 等...和 ​​return 一行中来自 Column B 的所有对应值:

我尝试将 AND 嵌套到 IF 中,但没有成功,因为它 return 根本没有任何值。

|    | A       | B           | C | D | E |
|----|---------|-------------|---|---|---|
| 11 | Apples  | Green       | 1 |   |   |
| 12 | Oranges | YellowGreen | 2 |   |   |

我的代码:

=INDEX($B:$B, SMALL(IF($A=$A:$A, ROW($A:$A)-ROW($A)+1), COLUMN(A1)))

如何使用此公式来查看要匹配的两个变量?

谢谢。

您似乎在使用数组公式,连接不起作用吗?

{=INDEX($C:$C, SMALL(IF($A11&" "&$B11=$A:$A&" "&$B:$B, ROW($A:$A)-ROW($A)+1), COLUMN(A1)))}