gpt4 book ai didi

excel - 您可以在 OR 语句中嵌入 AND 语句吗?

转载 作者:行者123 更新时间:2023-12-04 22:03:46 25 4
gpt4 key购买 nike

好的,所以我有一个想法,但我不确定是否有办法做到这一点。从这个等式开始:

=IF(OR(ARRAYFORMULA(SUM(COUNTIF(B7:O7,{"I","A","X","R","K","E","AL","FFSL","ADM *"})))=10),"80 小时","错误")

如果可能的话,我想在同一个 IF 语句中嵌入一个 AND 语句。例如,上面的等式检查了所有可能的 8 小时类次。如果有 10 人,则员工计划工作 80 小时。接下来我需要检查 4 个 10 小时类次和 5 个 8 小时类次的组合。然后,我需要继续检查其他可能的组合,这些组合可以让员工达到 80 小时。

我知道下面的这个等式不起作用,但这就是我想做的类似的事情。

=IF(OR(ARRAYFORMULA(SUM(COUNTIF(B7:O7,{"I","A","X","R","K","E","AL","FFSL","ADM *"})))=10,(ARRAYFORMULA(SUM(COUNTIF(B7:O7,{"R-10","I-10","X-10","A-10"})))=4 ,AND(ARRAYFORMULA(SUM(COUNTIF(B7:O7,{"I","A","X","R","K","E","AL","FFSL","ADM*"})))=5),"80 小时","错误")

本质上,我试图在原始 OR 语句中嵌入一个 AND 语句。不确定这是否被允许。我在说这样的话:

如果 1 OR (2 AND 3) OR (3 AND 4) 等...

Test Schedule

最佳答案

不应该是这样吗?

=IF(OR(ARRAYFORMULA(SUM(COUNTIF(B7:O7,{"I","A","X","R","K","E","AL","FFSL","ADM *"})))=10,
AND(ARRAYFORMULA(SUM(COUNTIF(B7:O7,{"R-10","I-10","X-10","A-10"})))=4, ARRAYFORMULA(SUM(COUNTIF(B7 :O7,"I","A","X","R","K","E","AL","FFSL","ADM*"})))=5)),"80小时","错误")

关于excel - 您可以在 OR 语句中嵌入 AND 语句吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29086668/

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