问题
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