如:A1单元格为235.2,公式如下:
=IF(A1<0,"负","")&TEXT(TRUNC(ABS(ROUND(A1,2))),"[DBNum2]")&"圆"&IF(ISERR(FIND(".",ROUND(A1,2))),"",TEXT(RIGHT(TRUNC(ROUND(A1,2)*10)),"[DBNum2]"))&IF(ISERR(FIND(".0",TEXT(A1,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A1,2),3))=".",TEXT(RIGHT(ROUND(A1,2)),"[DBNum2]")&"分","整")
若a1只是数字235.2,则放结果的单元格=IF(A1<=0,"",TEXT(INT(A1),"[dbnum2];;")&IF(INT(A1)=0,"",IF(INT(A1)=A1,"元整","元"))&IF(INT(A1)=A1,"",IF(INT(A1)<>A1,TEXT(--RIGHT(INT(A1*10)),"[=0]零;[>0][dbnum2]#角"),""))&TEXT(--RIGHT(INT(A1*100)),"[dbnum2]#分;;"))
两种方法:
1、直接对单元格进行设置。选定单元格,在其上点鼠标右键——“设置单元格格式”,点“数字”标签——“自定义”,在“类型”中输入[dbnum2],确定。
2、用TEXT函数进行设置。假定原数据在A1单元格,示例公式=text(a1,"[dbnum2]")