本帖最后由 wshcw 于 2015-1-1 13:53 编辑
公式经过刀砍斧削,终于打破了170字符. 168个字符 =SUBSTITUTE(IF(-RMB(A2),IF(A2>0,,"负")&TEXT(INT(ABS(A2)+0.5%),"[dbnum2]G/通用格式元;;")&TEXT(RIGHT(RMB(A2),2),"[>9][dbnum2]0角0分;"&IF(A2^2<1,,0)&"[>][dbnum2]0分;整"),),"零分","整") 167个字符 =SUBSTITUTE(SUBSTITUTE(IF(-RMB(A2),IF(A2>0,,"负")&TEXT(INT(ABS(A2)+0.5%),"[dbnum2]G/通用格式元;;")&TEXT(RIGHT(RMB(A2),2),"[dbnum2]0角0分;;整"),),"零角",IF(A2^2<1,,"零")),"零分","整")
W3pZL9HF.rar
(153.08 KB, 下载次数: 1362)
金额分列公式:
=IF($A2,LEFT(RIGHT(" ¥"&$A2/1%,13-COLUMN())),"")
这个是通用于负值和0值,公式也是最短的,只有48字.
注:17楼公式更完善请查看.
http://club.excelhome.net/viewthread.php?tid=337492&replyID=1495284&skin=1
VBA法参考:
http://club.excelhome.net/viewthread.php?tid=337509&page=6#pid2210353 Function dx(M) dx = Replace(Replace(Replace(Join(Application.Text(Split(Format(M, " 0. 0 0;负 0. 0 0; ")), ["[DBnum2]"&{0,"","圆0角;;圆零","0分;;整"}]), a), "零圆零", a), "零圆", a), "零整", "整") '163字符A 无缺陷 负数显示 “负” 负伍圆陆角伍分 End Function ====================================================== 与用友一致的大写公式: =SUBSTITUTE(SUBSTITUTE(IF(-RMB(A2),IF(A2>0,,"(负)")&TEXT(INT(ABS(A2)+0.5%),"[dbnum2]G/通用格式元;;")&TEXT(RIGHT(RMB(A2),2),"[>9][dbnum2]"&IF(MOD(ABS(A2),10)<1,0,)&"0角0分;"&IF(A2^2<1,,0)&"[>][dbnum2]0分;整"),),"万",IF((MOD(ABS(A2%%),10)<1)*(MOD(ABS(A2%%),10)>=0.1),"万零","万")),"零分","整") |