结合AND和OR语句

时间:2017-10-13 14:08:20

标签: excel

NA  NA  NA  88  88  99  NA
NA  NA  1   88  88  0   Y
NA  NA  1   88  88  0   Y
NA  NA  1   88  88  0   Y

我有上面的专栏。我使用以下公式进行过滤:

=IF(AND(A1="NA", C1="NA"), "NA", IF(OR(A1>3, C1>3), "Y", "N"))

该公式似乎适用于第1行,但是对于第2,3,4行我在G列中输出错误:G1应该是NA,但G2,G3,G4应该是" N&#34 ;假设C2,C3和C4中的值小于4。

1 个答案:

答案 0 :(得分:1)

proc import file="C:\Data\employeeID.xlsx" out=employees dbms=xlsx replace; run; %macro get_employee(store=, employeeID=, empCat=); %let path="C:\Data\variationstring\empcat&empcat.\person&store._&employeeID.\persondata_empcat&empcat._&store."; libname test "&path"; proc import datafile="&path\Accouns_&store..xls" out=mydata sheet="thefile"; getnames=no; run; %mend get_employee; proc sql; *this generates macro calls, look at output to see what the macro variable contains; select cats('%get_employee(employeeid=',employeeID,',store=',store,',empcat=',empcat,')') into :get_emp_list separated by ' ' from employees; quit; &get_emp_list.; *This actually runs all those macro calls; 的{​​{1}}是NA,因此>为真,并返回“Y”

要到处走动,您需要添加一个数字检查:

A1>3