【问题标题】:Earlier working nested if statement formula no longer working in Google New Sheet早期工作的嵌套 if 语句公式不再在 Google 新工作表中工作
【发布时间】:2017-08-30 01:16:43
【问题描述】:

有一个公式(用于将数字金额转换为文字金额)在早期版本的 Google 表格中运行良好。在新工作表中,它不再工作并给出以下错误:

错误:函数 CHOOSE 参数 1 的值为 0。有效值介于 1 和 19 之间。

公式有点大和复杂(多个if函数)-请看下面的链接查看公式-(在单元格B2中)-

https://docs.google.com/spreadsheets/d/1XdcKbxKvIOSFK37zwULZns6giE9ounHPS5iHrRFkvIk/edit#gid=882895877

=arrayFormula(concatenate(if(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0}))<100,"",choose(int(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0}))/100)," One"," Two"," Three"," Four"," Five"," Six"," Seven"," Eight"," Nine") & " Hundred") & if(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100)<>0,if(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0}))>100," and",if(A2>power(10,{11,9,7,5,3}),choose({1,2,3,4,5},"","","",""," and"),"")),"") & if(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100)=0,"",if(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100)<20,choose(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100)," One"," Two"," Three"," Four"," Five"," Six"," Seven"," Eight"," Nine"," Ten"," Eleven"," Twelve"," Thirteen"," Fourteen"," Fifteen"," Sixteen"," Seventeen"," Eighteen"," Nineteen"),choose(int(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100)/10),""," Twenty"," Thirty"," Forty"," Fifty"," Sixty"," Seventy"," Eighty"," Ninety") & if(mod(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100),10)=0,""," " & choose(mod(mod(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0})),100),10),"One","Two","Three","Four","Five","Six","Seven","Eight","Nine")))) & if(trunc(mod(A2,power(10,{11,9,7,5,3}))/power(10,{9,7,5,3,0}))=0,"",choose({1,2,3,4,5}," Arab"," Crore"," Lakh"," Thousand","")))) & " only"

【问题讨论】:

    标签: if-statement google-sheets spreadsheet


    【解决方案1】:

    根据CHOOSE Function Documentation 如果索引为零、负数或大于提供的选项数,#VALUE!返回错误。

    话虽如此,我认为您只需计算数字,然后通过使用一系列 =RIGHT() 函数隔离您的数字来选择每个数字的单词版本即可完成此任务。

    【讨论】:

    • 嗨@Jacob!谢谢你的回答!对不起,我是这个电子表格世界的新手,并没有明白使用一系列 =Right() 函数隔离数字是什么意思。请你再解释一下。非常感谢!
    • 类似这样的东西:=IF(LEN(A1)>3,IFERROR(CHOOSE(LEFT(RIGHT(A1,4),1),"One","Two","Three", "四","五","六","七","八","九"),""),"")
    猜你喜欢
    • 2020-05-03
    • 2023-03-16
    • 1970-01-01
    • 1970-01-01
    • 2019-01-19
    • 1970-01-01
    • 1970-01-01
    • 2022-11-25
    • 2019-04-19
    相关资源
    最近更新 更多