简体   繁体   English

Excel COUNTIF和ISBLANK嵌套的If语句

[英]Excel Nested If statement with COUNTIF and ISBLANK

I am writing a code that pulls on information from a database. 我正在编写一个从数据库获取信息的代码。 I am checking if A1 is in the database between D2 to W2 and if G3 is blank. 我正在检查A1是否在D2到W2之间的数据库中,以及G3是否为空白。 If both of those things are true then return E3. 如果这两种情况都成立,则返回E3。 If just the first part is true (A1 is in the database) then return "something else". 如果仅第一部分为真(A1在数据库中),则返回“其他”。 If neither of those things are true, then return nothing. 如果这两个都不成立,则什么也不返回。

Here is the code I have written: 这是我编写的代码:

=IF(COUNTIF(Database!D2:W2, $A$1)), IF(ISBLANK(G3)), "", E3), "something else"))

I am getting an error with this formula but I am not sure what I am doing wrong. 我在使用此公式时出错,但是我不确定自己在做什么错。

Any help is much appreciated 任何帮助深表感谢

= IF(AND(COUNTIF(Database!D2:W2,$ A $ 1)> 0,(ISBLANK(G3)),E3,IF(COUNTIF(Database!D2:W2,$ A $ 1)> 0,“其他” ,“两者都不”))

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

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