我发现这个公式可以将金额转换为单词,但它不能 100% 起作用。每当金额以 20,30, 40 等结尾时,都会出现错误。例如 1020 会出错,但 1019 和 1021 可以正常工作。我试图自己解决这个问题,但没有运气。它必须是公式(与之交互的软件(Google Docs)无法处理 VBA 脚本。
这是公式:
=IF(H53<10^12,
IF(INT(H53/10^9)>0,
IF(INT(H53/10^11)>0,
INDEX(
{"One ","Two ","Three","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(INT(H53/10^11),{1,2,3,4,5,6,7,8,9})
)&"Hundred ",
"")&
IF(MOD(INT(H53/10^9),100)<20,
INDEX(
{"","One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine ","Ten ",
"Eleven ","Twelve","Thirteen","Fourteen ","Fifteen","Sixteen","Seventeen","Eighteen ","Nineteen"},
MATCH(MOD(INT(H53/10^9),100),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
),
INDEX(
{"","Twenty ","Thirty ","Fourty ","Fifty ","Sixty ","Seventy ","Eighty ","Ninety "},
MATCH(INT(MOD(INT(H53/10^9),100)/10),{1,2,3,4,5,6,7,8,9})
)&
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(MOD(INT(H53/10^9),10),{1,2,3,4,5,6,7,8,9})
)
)&" Billion ",
""
)&
IF(MOD(INT(H53/10^6),10^3)>0,
IF(INT(MOD(INT(H53/10^6),10^3)/100)>0,
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(INT(MOD(INT(H53/10^6),10^3)/100),{1,2,3,4,5,6,7,8,9})
)&"Hundred ",
"")&
IF(MOD(INT(H53/10^6),100)<20,
INDEX(
{"","One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine ","Ten ",
"Eleven ","Twelve","Thirteen","Fourteen ","Fifteen ","Sixteen","Seventeen","Eighteen ","Nineteen"},
MATCH(MOD(INT(H53/10^6),100),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
),
INDEX(
{"","Twenty ","Thirty ","Fourty ","Fifty ","Sixty ","Seventy ","Eighty ","Ninety "},
MATCH(INT(MOD(INT(H53/10^6),100)/10),{1,2,3,4,5,6,7,8,9})
)&
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(MOD(INT(H53/10^6),10),{1,2,3,4,5,6,7,8,9})
)
)&" Million ",
""
)&
IF(MOD(INT(H53/10^3),10^3)>0,
IF(INT(MOD(INT(H53/10^3),10^3)/100)>0,
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(INT(MOD(INT(H53/10^3),10^3)/100),{1,2,3,4,5,6,7,8,9})
)&"Hundred ",
"")&
IF(MOD(INT(H53/10^3),100)<20,
INDEX(
{"","One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine ","Ten ",
"Eleven ","Twelve","Thirteen","Fourteen ","Fifteen ","Sixteen","Seventeen","Eighteen ","Nineteen"},
MATCH(MOD(INT(H53/10^3),100),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
),
INDEX(
{"","Twenty ","Thirty ","Fourty ","Fifty ","Sixty ","Seventy ","Eighty ","Ninety "},
MATCH(INT(MOD(INT(H53/10^3),100)/10),{1,2,3,4,5,6,7,8,9})
)&
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(MOD(INT(H53/10^3),10),{1,2,3,4,5,6,7,8,9})
)
)&" Thousand ",
""
)&
IF(MOD(MOD(H53,10^4),10^3)>0,
IF(INT(MOD(MOD(H53,10^4),10^3)/100)>0,
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(INT(MOD(MOD(H53,10^4),10^3)/100),{1,2,3,4,5,6,7,8,9})
)&"Hundred ",
""
)&
IF(MOD(MOD(MOD(H53,10^4),10^3),100)<20,
INDEX(
{"","One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine ","Ten ",
"Eleven ","Twelve","Thirteen","Fourteen ","Fifteen ","Sixteen","Seventeen","Eighteen ","Nineteen"},
MATCH(MOD(MOD(MOD(H53,10^4),10^3),100),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19})
),
INDEX(
{"","Twenty ","Thirty ","Fourty ","Fifty ","Sixty ","Seventy ","Eighty ","Ninety "},
MATCH(INT(MOD(MOD(MOD(H53,10^4),10^3),100)/10),{1,2,3,4,5,6,7,8,9})
)&
INDEX(
{"One ","Two ","Three ","Four ","Five ","Six ","Seven ","Eight ","Nine "},
MATCH(MOD(MOD(MOD(H53,10^4),10^3),10),{1,2,3,4,5,6,7,8,9})
)
),
""
),
""
) & " Rands"