如何将if语句转换为单个Excel嵌套语句

时间:2018-03-12 20:51:03

标签: sql excel if-statement

我正在尝试创建一个包含以下IF语句的Excel IF函数:

If Date_Time_of_Request <= Authorization_Start_Date then REVIEW_TYPE = 'Prospective';
Else If Authorization_Start_Date <= Date_Time_of_Request <= Discharge_Date then REVIEW_TYPE = 'Concurrent';
Else If Date_Time_of_Request > = Discharge_Date then REVIEW_TYPE = 'Retrospective';
Else If Date_Time_of_Request > = Authorization_End_Date then REVIEW_TYPE = 'Retrospective';

我的尝试是:=IF(AS2 <= J2, "PROSPECTIVE", IF(AND(AS2 >= J2,AS2 <= V2),"CONCURRENT",IF(OR(AS2 > V2,AS2 > H2),"RETROSPECTIVE","UNKNOWN")))

但是,V2在大多数行中都是空白的,如果V2为空,我需要它进入下一个语句。如目前所述,AS2> V2在大多数情况下都是真的(即使它是空白的)。

1 个答案:

答案 0 :(得分:0)

类似的东西:

and(AS2>V2,LEN(V2)>0)