双击B1单元格,编写
=IF(A1=1,6,IF(A1=2,7,IF(A1=3,"A",IF(A1=4,"B",IF(A1=5,"D","")))))
"问题补充"里的公式
双击B1单元格,编写
=IF(OR(A1=1,A1=2,A1=3,A1=4,A1=5),"D",IF(OR(A1=6,A1=7,A1=8,A1=9,A1=10),"X",""))
=LOOKUP(A1,{1,2,3,4,5},{"6","7","A","B","D"})
但是如果A1不是1,2,3,4,5的时候,结果就乱了
B1输入
=IF(AND(A1>=1,A1<=5),LOOKUP(A1,{1,2,3,4,5},{6,7,"A","B","D"}),"")
第二问
=IF(AND(A1>=1,A1<=5),"D",IF(AND(A1>=6,A1<=10),"X",""))
或者
=LOOKUP(INT(A1/5.1),{0,1},{"D","X"}),"')
=LOOKUP(A1,{1,2,3,4,5},{"6","7","A","B","D"})
=CHOOSE($A$1,6,7,"A","B","D")