|
本帖最后由 myexjx123 于 2014-4-19 12:58 编辑
近期在论坛上看了不少类似函数,总有不如意的地方,于是自己动手写了一个,支持负数,感觉还满意。拿出来分享一下。
=SUBSTITUTE(SUBSTITUTE(IF(A1=0,"",IF(TRUNC(A1)=0,"",IF(A1-TRUNC(A1)=0,TEXT(TRUNC(A1),"[DBNum2]")&"元整",TEXT(TRUNC(A1),"[DBNum2]")&"元")))&IF(TRUNC(A1*10)-TRUNC(A1*10,-1)<>0,TEXT(TRUNC(A1*10)-TRUNC(A1*10,-1),"[DBNum2]")&"角",IF(TRUNC(A1*100)-TRUNC(A1*100,-1)=0,"",IF(AND(TRUNC(A1)<>0,TRUNC(A1*100)-TRUNC(A1*100,-1)<>0),TEXT(TRUNC(A1*10)-TRUNC(A1*10,-1),"[DBNum2]"),"")))&IF(TRUNC(A1*100)-TRUNC(A1*100,-1)=0,"",TEXT(TRUNC(A1*100)-TRUNC(A1*100,-1),"[DBNum2]")&"分"),"-","负",1),"-","")
|
|