简体   繁体   English

在Excel中使用“或”功能匹配文本将导致#VALUE! 错误?

[英]Matching text with “or” function in Excel results in #VALUE! error?

Apologies if this is the wrong forum for this question... 抱歉,如果这是该问题的错误论坛,...

L30 has a nested if statement that results in the text "in". L30具有嵌套的if语句,该语句导致文本“ in”。

L31 is the formula =L30=OR("in","hold") which results in a #VALUE! L31是公式= L30 = OR(“ in”,“ hold”),结果为#VALUE! error. 错误。 I was hoping to get a TRUE from that. 我希望从中得到一个真。 Strangely enough, when I change the formula in L31 to =OR(EXACT(L30,"in"),EXACT(L30,"hold")), it evaluates to TRUE as expected. 奇怪的是,当我将L31中的公式更改为= OR(EXACT(L30,“ in”),EXACT(L30,“ hold”))时,它的计算结果为TRUE。

I feel like there's probably something basic regarding strings or formulas that I'm just not understanding... 我觉得我可能不了解一些关于字符串或公式的基本知识...

OR is a function in Excel which takes at least two conditions and returns TRUE if one of them evaluates to TRUE . OR是Excel中的一个函数,它至少需要两个条件,如果其中一个条件的值为TRUE则返回TRUE Your formula L30=OR("in","hold") uses the two strings "in" and "hold" as conditions - which of course does not work as those are not logical conditions. 您的公式L30=OR("in","hold")使用两个字符串“ in”和“ hold”作为条件-这当然不是有效的,因为它们不是逻辑条件。
What you probably want is =OR(L30="in", L30="hold") 您可能想要的是=OR(L30="in", L30="hold")

您的第一次尝试使用错误的OR语法,第二次示例使用正确的语法。

=OR(L30="in",L30="hold")

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

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