如果a1是数字,b1输入:
=IF(A1=0,"",IF(INT(A1),TEXT(TRUNC(A1),"[dbnum2]")&"元","")&IF(MOD(A1,1)=0,"整",IF(TRUNC(A1,1),IF(A1=TRUNC(A1,1),TEXT(LEFT(RIGHT(A1*100,2)),"[dbnum2]0角整"),TEXT(RIGHT(A1*100,2),"[dbnum2]0"&IF(LEFT(RIGHT(A1*100,2))="0","","角")&"0分")),TEXT(A1*100,"[dbnum2]0分"))))
即可
祝你成功!
=IF(ROUND(K5,2)<0,"无效数值",IF(ROUND(K5,2)=0,"零元整",IF(ROUND(K5,2)<1,"",TEXT(INT(ROUND(K5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(K5,2)*10)-INT(ROUND(K5,2))*10=0,IF(INT(ROUND(K5,2))*(INT(ROUND(K5,2)*100)-INT(ROUND(K5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(K5,2)*10)-INT(ROUND(K5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(K5,2)*100)-INT(ROUND(K5,2)*10)*10)=0,"整",TEXT((INT(ROUND(K5,2)*100)-INT(ROUND(K5,2)*10)*10),"[dbnum2]")&"分")))
K5表示单元格,把需要转换的数字填在K5就可以
如果有小数点要变换成"点"字可有难度了.详细答案一会儿给你吧.
本来想用定义名称来做,但小数点不好做.2楼的就能用.下面给个公式你看看,是否能满足要求.
A1是你的数据,B1中写入:
=IF(INT(A1)=A1,TEXT(A1,"[dbnum1]")&"整",TEXT(A1,"[dbnum1]"))
"人民币"&SUBSTITUTE(SUBSTITUTE(TEXT(TRUNC(FIXED(E9)),"[>0][dbnum2];[<0]负[dbnum2];;")&TEXT(RIGHT(FIXED(E9),2),"元[dbnum2]0角0分;;"&IF(ABS(E9)>1%,"元整",)),"零角",IF(ABS(E9)<1,,"零")),"零分","整")
E9是引用单元格