Excel FILTER 公式在条件中使用溢出范围

问题描述 投票:0回答:2

我无法使用溢出范围使 FILTER 公式发挥作用。这是一个示例场景:

我在 E2 中有一个溢出范围,它为我提供了我想要查找的数字列表。查找表是A2:B6。如果我在 F2 中使用以下公式并将其向下拖动到 F4,一切都会完美运行:

   =LET(ProductFound, UNIQUE(FILTER($B$2:$B$6, $A$2:$A$6=E2, "Nothing found")),
    IFS(ROWS(ProductFound)>1, "There are two products with the same SKU #",
        ProductFound="Nothing found", "No Such Product with SKU #",
        TRUE, ProductFound))

但是,我希望 F2 成为一个溢出公式,自动匹配 E2 的大小,这样我就不必执行任何手动下拉,但我想不出办法。当我更改公式以使用溢出范围运算符时,我在 F2 中仅得到 #N/A

   =LET(ProductFound, UNIQUE(FILTER($B$2:$B$6, $A$2:$A$6=E2#, "Nothing found")),
    IFS(ROWS(ProductFound)>1, "There are two products with the same SKU #",
        ProductFound="Nothing found", "No Such Product with SKU #",
        TRUE, ProductFound))

有人可以帮忙解决吗?谢谢。

excel filter
2个回答
1
投票

使用 BYROW:

=BYROW(E2#,LAMBDA(a,LET(ProductFound, UNIQUE(FILTER($B$2:$B$6, $A$2:$A$6=a, "Nothing found")),
IFS(ROWS(ProductFound)>1, "There are two products with the same SKU #",
    ProductFound="Nothing found", "No Such Product with SKU #",
    TRUE, ProductFound))))


0
投票

使用相同的表结构复制了相同的解决方案,但我得到了#CALC!嵌套数组错误

© www.soinside.com 2019 - 2024. All rights reserved.