EXCEL表格,将小写金额数值转换为大写中文数字(美元),在转换的同时会四舍五入

2022-08-11 体育 134阅读
刚刚回答了一样的问题,不会是同一个人吧。

如果只有两种货币。
=IF(A3="HKD",IF(ROUND(A1,2)<0,"金额为负无效",IF(ROUND(A1,2)=0,"零元",IF(ROUND(A1,2)<1,"",TEXT(INT(ROUND(A1,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A1,2)*10)-INT(ROUND(A1,2))*10=0,IF(INT(ROUND(A1,2))*(INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A1,2)*10)-INT(ROUND(A1,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10)=0,"整",TEXT((INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10),"[dbnum2]")&"分"))),IF(A1<0,"金额为负无效",IF(OR(A1=0,A1=""),"零美元",IF(A1-TRUNC(A1)=0,NUMBERSTRING(TRUNC(ROUND(A1,1),0),2)&"美元整",NUMBERSTRING(TRUNC(A1,0),2)&"美元"&TEXT(INT(ROUND(A1,2)*100)-INT(ROUND(A1,2))*100,"[dbnum2]")&"美分"))))

如果只是以美分为单位:
=IF(A3="HKD",IF(ROUND(A1,2)<0,"金额为负无效",IF(ROUND(A1,2)=0,"零元",IF(ROUND(A1,2)<1,"",TEXT(INT(ROUND(A1,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A1,2)*10)-INT(ROUND(A1,2))*10=0,IF(INT(ROUND(A1,2))*(INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A1,2)*10)-INT(ROUND(A1,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10)=0,"整",TEXT((INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10),"[dbnum2]")&"分"))),IF(A1<0,"金额为负无效",IF(OR(A1=0,A1=""),"零美元",NUMBERSTRING(ROUND(A1,2)*100,2)&"美分")))
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com