在B1中输入以下公式:然后按住B1的小黑叉 向下填充就可以了
=IF(A1="A","5",IF(A1="B","4",IF(A1="C","3",IF(A1="D","2",IF(A1="E","1")))))
字母是属于文本 也就是字符,要加引号的
用VBE 编个自定义函数也可以
------------------------代码如下--------------------------
Function test(m As Variant) As Variant
Select Case m
Case "A":test = 5
Case "B":test = 4
Case "C":test = 3
Case "D":test = 2
Case "E":test = 1
End Select
End Function
End Function