回覆列表
-
1 # 怕地理我就
-
2 # 使用者6725880180828
假設數字在A1
在B1輸入公式
=IF(OR(A1="",A1=0),"",TEXT(INT(A1),"[dbnum2]G/通用格式圓;負[dbnum2]G/通用格式圓;;")&TEXT(--RIGHT(INT(A1*10)),"[dbnum2]#角;;;")&TEXT(--RIGHT(INT(A1*100)),"[dbnum2]#分;;整;"))
或者
=SUBSTITUTE(IF(-RMB(A1),IF(A1>0,,"負")&TEXT(INT(ABS(A1)+0.5%),"[dbnum2]G/通用格式元;;")&TEXT(RIGHT(RMB(A1),2),"[>9][dbnum2]0角0分;"&IF(A1^2][dbnum2]0分;整"),),"零分","整")
就會在B1顯示成:壹佰貳拾伍元貳角陸分
怎麼A1中不輸入文字時,B2不會顯示0,讓B2空白著
選單欄,工具-選項-檢視,取消“零值”的勾
=SUBSTITUTE(SUBSTITUTE(IF(A2<0,"負","")&TEXT(TRUNC(ABS(ROUND(A2,2))),"[DBNum2]")&"元"&IF(ISERR(FIND(".",ROUND(A2,2))),"",TEXT(RIGHT(TRUNC(ROUND(A2,2)*10)),"[DBNum2]"))&IF(ISERR(FIND(".0",TEXT(A2,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A2,2),3))=".",TEXT(RIGHT(ROUND(A2,2)),"[DBNum2]")&"分",IF(ROUND(A2,2)=0,"","整")),"零元零",""),"零元","零")A2為數字所在單元格! 這公式是當出現負值是大寫前面寫“負”,如果想改為無效數值的話,公式需要修改為:=IF(ROUND(A2,2)<0,"無效數值",IF(ROUND(A2,2)=0,"零",IF(ROUND(A2,2)<1,"",TEXT(INT(ROUND(A2,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A2,2)*10)-INT(ROUND(A2,2))*10=0,IF(INT(ROUND(A2,2))*(INT(ROUND(A2,2)*100)-INT(ROUND(A2,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A2,2)*10)-INT(ROUND(A2,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A2,2)*100)-INT(ROUND(A2,2)*10)*10)=0,"整",TEXT((INT(ROUND(A2,2)*100)-INT(ROUND(A2,2)*10)*10),"[dbnum2]")&"分")))上述兩公式均來自於網友提供,並非本人原創,借花獻佛,不好意思!