IF/AND Google Sheets error

萝らか妹 提交于 2019-12-24 04:42:06

问题


I'm trying to create an IF Statement on Sheets so that if at least one of the last 3 columns (W,X,Y) contains 'YES' then column Z will say 1. If all of them are empty or contain 'NO' then column Z will say 'FALSE' or 'NO'.

Please see what I have below, each time I do it, it only takes the data from W and ignores X and Y.

=IF(W3='DATA VALIDATION'!B2,
  1,
  AND(X3='DATA VALIDATION'!B2,1,AND(Y3='DATA VALIDATION'!B2,1,))
)

回答1:


Use a countif across W:Y to see if there is a Yes. Any result greater than 0 will ring true in an if. A formula for Z2 would be:

=if(countif(W2:Y2, "Yes"), 1, "No")

Fill or drag the formula down as necessary.




回答2:


Try:

  =if(or(W3="YES",X3="YES",Y3="YES"),1,"NO")

You can replace each instance of "YES" with 'DATA VALIDATION'!B2 as in your original equation.



来源:https://stackoverflow.com/questions/29694465/if-and-google-sheets-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!