if的使用方法如下:
1、单条件判断返回值(基础条件判断)
=IF(A1>20,"完成任务","未完成")
=IF(A1>B1,"完成任务","未完成")
2、多重条件判断
=IF(A1="101","现金",IF(A1="1121","应收票据",IF(A1=1403,"原材料")))
注:多条件判断时,注意括号的位置,右括号都在最后,有几个IF就输入几个右括号。
3、多区间判断
=IF(A1<60,"不及格",IF(A1<80,"良好","优秀"))
=IF(A1>=80,"优秀",IF(A1>=60,"良好","不及格"))
注:IF在进行区间判断时,数字一定要按顺序判断,要么升要不降。
4、多条件并列判断
=IF(AND(A1>60,B1<100),"合格","不合格")
=IF(OR(A1>60 B1<100) "合格" "不合格")
5、嵌套
=IF(C1-B1>0,"优秀",IF(C1-B1>-100,"良好","合格")