gpt4 book ai didi

excel - Excel 公式中的 -- 有何作用?

转载 作者:行者123 更新时间:2023-12-01 17:05:39 25 4
gpt4 key购买 nike

尝试破译一些 Excel 公式,我看到一些类似 SUMPRODUCT(--Left(...)...) 的内容

--在做什么?当然,对我来说似乎是递减,但找不到任何相关文档。

最佳答案

双破折号被称为双一元运算符。

尝试此链接:Why use -- in SUMPRODUCT formulae

具体:

SUMPRODUCT() ignores non-numeric entries. A comparison returns a boolean (TRUE/FALSE) value, which is non-numeric. XL automatically coerces boolean values to numeric values (1/0, respectively) in arithmetic operations (e.g., TRUE + 0 = 1).

The most efficient way to coerce the value is first to apply the unary minus operator, coercing TRUE/FALSE to -1/0, then applying it again to negate the value, e.g., +1/0.

单个一元运算符 (-) 将 true/false 值强制转换为 -1/0。通过使用双一元运算符,我们再次将值强制为 1/0

关于excel - Excel 公式中的 -- 有何作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3286197/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com