简体   繁体   English

在Excel中向量化逻辑运算符

[英]Vectorizing logical operators in Excel

Suppose I have two columns 假设我有两列

A: (TRUE, TRUE, FALSE) 答:(正确,正确,错误)

B: (TRUE, FALSE, FALSE) B :(正确,错误,错误)

I want to do something like 我想做类似的事情

AND(A1:A3,B1:B3) that returns (TRUE, FALSE, FALSE) 返回(TRUE,FALSE,FALSE)的AND(A1:A3,B1:B3)

is this possible? 这可能吗?

Select, say, C1:C3 , with selected cells enter formula in formula bar: 选择C1:C3 ,并选择单元格,在公式栏中输入公式:

=(A1:A3)*(B1:B3)

and press CTRL + SHIFT + ENTER . 然后按CTRL + SHIFT + ENTER Curly brackets will automatically appear at the start and end of the formula. 括号将自动出现在公式的开头和结尾。

It produces output 1,0,0 . 它产生输出1,0,0 If you want exactly TRUE/FALSE , use: 如果要精确地为TRUE/FALSE ,请使用:

=(A1:A3)*(B1:B3)>0

also with array entry 也有数组项

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM