在 Excel 内使用命名范围的逻辑操作

Logical operations using Named Ranges within Excel

我在尝试使用我的电子表格中引用的更好命名时遇到了这个问题

以布尔逻辑为例

A 列具有命名范围 "Include1" B 列的命名范围为 "Include2"

公式为:

我看到的是,如果我直接使用命名范围,它会获取值,但是当我将它包含在布尔比较 (AND、OR) 中时,它就不起作用了。 (F 列和 I 列应与 G 列和 J 列一样匹配)

我是不是做错了什么或者这是一个已知问题? 如果我做错了什么,我如何让布尔比较与命名范围一起工作?

--编辑

我刚刚发现具有以下作用:

=AND(Include1=TRUE, Include2=TRUE)
=OR(Include1=TRUE, Include2=TRUE)

这不太直观,但这是 excel 设计的吗?

AND函数的描述(MS link):

Syntax

AND(logical1, [logical2], ...)

The AND function syntax has the following arguments:

logical1 Required. The first condition that you want to test that can evaluate to either TRUE or FALSE.

logical2, ... Optional. Additional conditions that you want to test that can evaluate to either TRUE or FALSE, up to a maximum of 255 conditions.

Remarks

The arguments must evaluate to logical values, such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values.

If an array or reference argument contains text or empty cells, those values are ignored.

这意味着:

=AND(Inlude1)

计算第 A 列中所有单元格(文本和空单元格除外)的逻辑 AND

在第二个版本中:

=AND(Include1=True)

参数为数组,仅在数组公式中(用Ctrl+Shift+Enter确认)。使用 Enter 确认的相同公式仅采用列 A 中当前行的值。同样的规则适用于 OR 函数和多个命名范围。