金额不超过0至9的估计值

时间:2014-04-02 23:07:23

标签: excel excel-vba excel-2007 excel-2010 vba

如何使金额不超过0到9的估计

示例

A1:A2 = A3 

if A3 is 10   ... HOW TO MAKE IT TO RETURN 0 
if A3 is 11 return to 1 
if A3 is 12 return to 2 
if A3 is 13 return to 3 
if A3 is 18 return to 8

1 个答案:

答案 0 :(得分:1)

USE MOD,如以下VBA代码

11 MOD 10 = 1
18 MOD 10 = 8
10 MOD 10 = 0

正如Brad所指出的,工作表版本是

=MOD(A1,10)