|
【原创】
Q:求票据的出票日期中文大写转换最简的公式?
A:153字符
=TEXT(B7,"yyyy[dbnum2]年")&IF(OR(MONTH(B7)<3,MONTH(B7)=10),"零",)&TEXT(B7,"m[dbnum2]月")&IF(OR(DAY(B7)<11,DAY(B7)=20,DAY(B7)=30),"零",)&TEXT(B7,"d日[dbnum2]")
131字符
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(B7,"yyyy年mm月dd日[dbnum2]"),"壹拾月","零壹拾月"),"壹拾日","零壹拾日"),"贰拾日","零贰拾日"),"叁拾日","零叁拾日")
119字符- =TEXT(B7,"yyyy年"&IF(OR(MONTH(B7)<3,MONTH(B7)=10),"零",)&"m月"&IF(OR(DAY(B7)<11,DAY(B7)=20,DAY(B7)=30),"零",)&"d日[dbnum2]")
复制代码 116字符(方便套打)- =TEXT(B8,"e "&IF(OR(MONTH(B8)<3,MONTH(B8)=10),"零",)&"m "&IF(OR(DAY(B8)<11,DAY(B8)=20,DAY(B8)=30),"零",)&"d [dbnum2]")
复制代码 106字符(方便套打)- =TEXT(B8,"e "&IF(OR(MONTH(B8)<3,MONTH(B8)=10),"零",)&"m "&IF(OR(DAY(B8)=20,DAY(B8)=30),"零",)&"dd [dbnum2]")
复制代码 96字符,进一步简化,终于闯过100字符大关!- =TEXT(B8,"e年[dbnum2]"&IF(OR(MONTH(B8)<3,MONTH(B8)=10),"零",)&"m月"&IF(MOD(DAY(B8),10),,"零")&"dd日")
复制代码 90字符,进一步简化,用数组又减去6个字符!- =TEXT(B8,"e年[dbnum2]"&IF(OR(MONTH(B8)={1,2,10}),"零",)&"m月"&IF(MOD(DAY(B8),10),,"零")&"dd日")
复制代码 谢谢斑竹鼓励!
80字符,进一步简化,1-10月前面都加零,又减去10个字符!- =TEXT(B1,"e年[dbnum2]"&IF(MONTH(B1)=10,"零",)&"mm月"&IF(MOD(DAY(B1),10),,"零")&"dd日")
复制代码 请版主、各位大师测试、修正、简化、指教!!!
[ 本帖最后由 一指禅 于 2011-4-20 11:48 编辑 ] |
评分
-
1
查看全部评分
-
|