请教一个if用法的问题,急!!!

来源:百度知道 编辑:UC知道 时间:2024/06/08 01:57:19
如果D3在2000和500之间,就是D3*0.2,否则就是D3*0.5,请问怎么设,急,谢谢
我是在excel表格里输入计算公式,不在编程状态,谢谢

楼上写错了哦!

if(D3<=2000&&D3>=500)
r=D3*0.2;
else
r=D3*0.5;

if(D3>=2000&&D3<=500)
r=D3*0.2;
else
r=D3*0.5;

if(d3<500,D3*0.5,if(d3>2000,D3*0.5,D3*0.2))

whether和if的用法分析

一、相同之处。
1.whether和if都能引导宾语从句,常置于see,ask,learn,tell,wonder,doubt,find out等动词之后。
如:He asked me whether/is I could help him. I want to know whether/if he lives there.
2.whether和if都可用it作形式主语从句中。如: it's uncertain whether/if he'll come this evening.
3.在be uncertain/doubtful之后,常用whether引导宾语从句,有时也可以用if,如: We are uncertain whether/if Mary will come.
二、不同之处。
1.whether可置于句首引导主语从句,而if不能。如: ___the 2000 Olympic Games will be in Beijing is not known yet. A.whether B.If C.Whether D.That 答案是C。
2.whether可用在介词之后,引导宾语从句,而If则不能。如: Success depends on whether we make evough effort.
3.whether可引导表语从句,if则不能。如: The puestion is whether it is not worth doing.
4.在名词之后引导同位语从句时,用whether而