You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Excel中IF+OR组合公式返回FALSE的问题求助

Fixing Excel Formula's FALSE Return Issue

Your original formula has two critical issues leading to unexpected FALSE results:

  • Invalid logical test in OR: The OR function uses D7+$D$1 (an arithmetic calculation) instead of a TRUE/FALSE condition. OR only works with boolean values—for example, if you meant to check if D7 equals $D$1, use D7=$D$1.
  • Missing else clauses: Both IF functions lack a fallback value. When conditions aren't met, Excel returns FALSE by default instead of an empty result.

Corrected Formula (assuming your intended OR condition is "C7 equals $C$1 OR D7 equals $D$1")

=IF(OR(C7=$C$1, D7=$D$1), IF(C7=$C$2, D7+$D$2, ""), "")

Alternative Formula (for conditional sums based on C7 values)

If you wanted to apply D7+$D$1 when C7=$C$1 and D7+$D$2 when C7=$C$2 (returning empty otherwise), use this simpler structure:

=IF(C7=$C$1, D7+$D$1, IF(C7=$C$2, D7+$D$2, ""))

What These Fixes Do

  • The first formula checks if either condition in OR is true. If so, it verifies if C7=$C$2 to return the sum; otherwise, it returns an empty string. If the OR condition fails, it also returns empty.
  • The second formula directly checks each C7 value in sequence, returning the corresponding sum or empty if neither condition matches.

内容的提问来源于stack exchange,提问作者Reshma Mahase

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 21:46:22