因為A列內的數值是價錢,一般不過再大過100內,所以 X 15後,不會大於1500,+10-20% 只是運費!!
感謝!!!作者: victorl 時間: 2010-6-12 20:09
自訂函數如何
Function fare(x As Double) As Double
If x <= 33.33 Then '少於500
fare = 500
ElseIf x <= 40 Then '介於501-600
fare = x * 15 * 1.1
ElseIf x <= 66.67 Then '介於601-1000
fare = x * 15 * 1.15
Else '大於1001
fare = x * 15 * 1.2
End If
End Function