【问题标题】:IF Function with multiple value and logic in google sheetIF函数在谷歌表中具有多个值和逻辑
【发布时间】:2022-12-20 02:05:21
【问题描述】:

在谷歌表格上使用 if 函数时我遇到了一个小问题,我找不到解决方案。

我想把每个条件都放在函数中

  • A2为正,B2为正则C2会显示Positive+

  • 如果 A2 为正且 B2 为负,则 C2 将显示为正

  • 如果 A2 为负且 B2 为正则 C2 将显示负

  • 如果 A2 和 B2 均为负值,则 C2 将显示负值+

我想把所有这些条件放在一个公式或脚本上,我可以在谷歌应用脚​​本上运行

我已经尝试过 if 函数与 AND,OR 但无法解决。

【问题讨论】:

  • 仅通过测试 A2 即可获得相同的结果 - B2 的值没有区别。

标签: google-apps-script google-sheets spreadsheet


【解决方案1】:

尝试:

=IFS(AND(A2>0,B2>0),"Positive+",AND(A2>0,B2<0),"Positive",AND(A2<0,B2<0),"Negative+",AND(A2<0,B2>0),"Negative")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-04
    • 2018-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多