简体   繁体   English

Excel AND 和 NOT

[英]Excel AND and NOT

Please can you help:请你帮忙:

I have an Excel query.我有一个 Excel 查询。
I use IF AND and NOT.我使用 IF AND 和 NOT。
When I write 3 AND statements it works.当我写 3 个 AND 语句时,它起作用了。
When I write 1 AND and 2 NOT statements it works too.当我写 1 AND 和 2 NOT 语句时,它也可以工作。 When I write 2 AND and 1 NOT this does not work - This is the last 4 lines of the IF statement below.当我写 2 AND 和 1 NOT 这不起作用 - 这是下面 IF 语句的最后 4 行。

How do you create an AND and NOT statement in Excel: I want to show two AND and 1 NOT.如何在 Excel 中创建 AND 和 NOT 语句:我想显示两个 AND 和 1 NOT。 I have done this current by: AND( statement 1 and statement 2, NOT( statement 3)) - but this does not work.我已经通过以下方式完成了此操作:AND(语句 1 和语句 2,NOT(语句 3))-但这不起作用。

This image is not the calculation, it just shows I need to write 8 lots of IF statements.这张图片不是计算,它只是表明我需要编写 8 批 IF 语句。

在此处输入图像描述

IF((AND(Overview!$D$8="NO ASSISTANT",Overview!$D$5="ALL",Overview!$D$6="ALL")),SUMIFS(x),
IF((AND(Overview!$D$8="ASSISTANT",NOT(AND(Overview!$D$5="ALL",Overview!$D$6="ALL")))),SUMIFS(x),
IF((AND(Overview!$D$8="NO ASSISTANT",NOT(AND(Overview!$D$5="ALL",Overview!$D$6="ALL")))),SUMIFS(x),
IF((AND(Overview!$D$8="ASSISTANT",Overview!$D$5="ALL",NOT(AND(Overview!$D$6="ALL")))),SUMIFS(x),
IF((AND(Overview!$D$8="NO ASSISTANT",Overview!$D$5="ALL",NOT(AND(Overview!$D$6="ALL")))),SUMIFS(x),
IF((AND(Overview!$D$8="ASSISTANT",Overview!$D$6="ALL",NOT(AND(Overview!$D$5="ALL")))),SUMIFS(x),
IF((AND(Overview!$D$8="NO ASSISTANT",Overview!$D$6="ALL",NOT(AND(Overview!$D$5="ALL")))),SUMIFS(x)))))))))

So, I assume the "x" means available based on the results you show, so this works:因此,我假设“x”表示根据您显示的结果可用,所以这有效:

在此处输入图像描述

Based on the comment that seems to state a different case to that shown in the OP's image then this version works:根据 state 的评论,与 OP 图像中显示的情况不同,则此版本有效:

在此处输入图像描述

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

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