成果文案函数.pdfVIP

  • 2
  • 0
  • 约1.16千字
  • 约 2页
  • 2025-05-17 发布于北京
  • 举报

Tch函数

Tch提成xsh销售额

比如用if…then…else…endif语句实现计算提成的自定义函数

if…then…else…endif语句实现对给定条件进行判断,当条件为真(假)时,分别执行不

同的语句

例1:比如销售额大于100万有提成,销售额小于100万无提成

Functiontch(xsh)

Ifxsh=100then

Tch=”有”

Else

Tch=””

Endif

Endfunction

例2:根据销售额确定业绩的五个等级(多重逻辑判断):A(200万),B(150万),C(100万),D(60

万),E(60万)

Functiontch(xsh)

Ifxsh=200then

Tch=”A”

Elseifxsh=150then

Tch=”B”

Elseifxsh=100then

Tch=”C”

Elseifxsh=60then

Tch=”D”

Else

Tch=”E”

Endif

Endfunction

例3:根据销售额100万按0.1的系数提成

Functiontch(xsh)

Ifxsh=100then

Tch=0.1*xsh

Else

Tch=0

Endif

Endfunction

例4:根据销售额五个等级分别计算提成额(多重逻辑判断):销售额200万按0.12的系数提

成,销售额150万按0.11的系数提成,销售额100万按0.1的系数提成,销售额60万按0.3的

额度提成,销售额100万按0.1的额度提成

Functiontch(xsh)

Ifxsh=200then

Tch=0.12*xsh

Elseifxsh=150then

Tch=0.11*xsh

Elseifxsh=100then

Tch=0.1*xsh

Elseifxsh=60then

Tch=0.3

Else

Tch=0.1

Endif

Endfunction

根据单一表达式来执行多种可能的动作时,SelectCase更为有用。比如利用selectcase…

case…endselect语句来编制计算个人所得税的函数

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档