Microsoft Excel - 如果,AND&或声明

时间:2018-01-06 22:42:16

标签: excel excel-formula

您好我正在尝试编写宗地大小计算,以确定在Microsoft Excel中包裹是“小”,“中”,大还是“太大”。

与MyHermes网站(https://www.myhermes.co.uk/help/parcel-size.html

底部非常相似

这是我的代码。

谢谢 布赖恩

=IF(OR(B4<=45) AND (C4<=35) AND (D4<=16) AND (E4<=2), ”SMALL”,

IF(OR(B4>45 AND <61) AND (C4>35 AND <47) AND (D4>16 AND >47) AND(E4>2 AND <21),”MEDIUM”,

IF(OR(B4>60 AND <101) AND (C4>46 AND <101) AND (D4>46 AND >101) AND(E4>20 AND <31),”LARGE”,"TOO BIG",)))

1 个答案:

答案 0 :(得分:2)

B4>45 AND <61是多余的;更改为B4<=61和所有其他人。你的AND / OR语法格式不正确。

=IF(and(B4<=45, C4<=35, D4<=16, E4<=2), "SMALL",
 IF(and(b4<=61, C4<=47, D4<=47, E4<=21), "MEDIUM",
 IF(and(B4<=101, C4<=101, D4<=101, E4<=31), "LARGE", "TOO BIG")))