假设你输入的47在A1,那么在B1输入
=if(A1<50,"5级-差",if(a1<60,"4级-欠佳",if(a1<75,"3级-关注",if(a1<85,"2级-般","1级-良好"))))
用IF进行嵌套可以实现。
=IF(A1>85,"1级—良好",IF(AND(A1>75,A1<=85),"2级—一般",IF(AND(A1>60,A1<=75),"3级—关注",IF(AND(A1>50,A1<=60),"4级—欠佳","5级—差"))))
关于临界的条件设定如果不合适你再相应修改吧。
假设你输入的47在A1,那么在B1输入
=if(A1<50,"5级-差",if(a1<60,"4级-欠佳",if(a1<75,"3级-关注",if(a1<85,"2级-般","1级-良好"))))
用lookup来实现
如数据在A列中,在B1输入公式
=lookup(a1,{0,50,60,75,85},},{"5级,差","4级,欠佳","3级,关注","2级,一般","1级,良好"})
int score;
scanf("%d",&score);
if(score>=85&&scoe<=100){
printf("1级,良好");}
else if(score>=75&&score<85){
printf("2级,一般");
}
else if(score>=60&&score<75){
printf("3级,关注");
}
else if(score>=50&&score<60){
printf("4级,欠佳");
}
else if(score<50){
printf("5级,差");
}
这个可以用lookup来实现
如数据在A列中,在B1输入公式
=lookup(a1,{0,50,60,75,85},{"5级,差","4级,欠佳","3级,关注","2级,一般","1级,良好"})