在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
在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