Excel函数公式应用:小写数字转换成人民币大写9种方法
Excel函数公式应用:小写数字转换成人民币大写9种方法
方法1
=IF(TRUNC(H16)=H16,TEXT(H16,"[DBNum2]G/通用格式")&"元整",TEXT(TRUNC(H16),"[DBNum2]G/通用格式"&"元"))&IF(AND(TRUNC(H16)<>H16,RIGHT(TRUNC(H16*10))<>"0"),TEXT(TRUNC(MOD(H16*10,10)),"[DBNum2]G/通用格式")&"角","")&IF(AND(RIGHT(TRUNC(H16*10))="0",TRUNC(H16)<>H16),"零","")&IF(TRUNC(H16*10)<>H16,TRUNC(H16*10)=H16*10),"整","")
方法2
=IF(F10=0,"",CONCATENATE(IF(INT(F10)=0,"",TEXT(INT(F10),"[DBNum2]G/通用格式元")),IF(INT(MID(RIGHT(FIXED(F10,2,1),2),1,1))=0,IF(INT(MID(RIGHT(FIXED(F10,2,1),1),1,1))=0,"",IF(INT(F10)=0,"","零")),TEXT(INT(MID(RIGHT(FIXED(F10,2,1),2),1,1)),"[DBNum2]G/通用格式角")),IF(INT(MID(RIGHT(FIXED(F10,2,1),1),1,1))=0,"整",TEXT(INT(MID(RIGHT(FIXED(F10,2,1),1),1,1)),"[DBNum2]G/通用格式分"))))
方法3
人民币大写的函数公式,可正负,最多两位小数。
=IF(A1<0,"负","")&IF(TRUNC(A1)=A1,TEXT(IF(A1<0,-A1,A1),"[DBNum2]")&"元整",IF(TRUNC(A1*10)=A1*10,TEXT(TRUNC(IF(A1<0,-A1,A1)),"[DBNum2]")&"元"&TEXT(RIGHT(A1),"[DBNum2]")&"角整",TEXT(TRUNC(A1),"[DBNum2]")&"元"&IF(ISNUMBER(FIND(".0",A1)),"零",TEXT(LEFT(RIGHT(A1,2)),"[DBNum2]")&"角")&TEXT(RIGHT(A1),"[DBNum2]")&"分"))
方法4
修改一下4:根据剑魔兄的测试,发现有一个问题,如-100.05,现修正如下:
=IF(A1<0,"负","")&IF(TRUNC(A1)=A1,TEXT(IF(A1<0,-A1,A1),"[DBNum2]")&"元整",IF(TRUNC(A1*10)=A1*10,TEXT(TRUNC(IF(A1<0,-A1,A1)),"[DBNum2]")&"元"&TEXT(RIGHT(A1),"[DBNum2]")&"角整",TEXT(TRUNC(IF(A1<0,-A1,A1)),"[DBNum2]")&"元"&IF(ISNUMBER(FIND(".0",A1)),"零",TEXT(LEFT(RIGHT(A1,2)),"[DBNum2]")&"角")&TEXT(RIGHT(A1),"[DBNum2]")&"分"))
方法5
=IF(A1<0,"负",)&TEXT(TRUNC(ABS(A1)),"[DBNum2]G/通用格式")&"元"&IF(ROUND(A1,3)=ROUND(A1,),"整",TEXT(RIGHT(TRUNC(A1*10),1),"[DBNum2]G/通用格式")&"角"&IF(ROUND(A1,3)=ROUND(A1,1),"整",TEXT(RIGHT(ROUND((A1*100),),1),"[DBNum2]G/通用格式")&"分"))
方法6
无条件舍去:=CONCATENATE(IF(A1<0,"负",""),TEXT(IF(TRUNC(A1)=0,"零",TRUNC(ABS(A1))),"[DBNum2]")&"元",IF(OR(AND(ABS(A1)<0.1,TRUNC(A1)=A1),RIGHT(INT(ABS(A1)*100),2)="00"),"",TEXT(RIGHT(TRUNC(A1*10),1),"[DBNum2]")),IF(RIGHT(TRUNC(A1*10),1)="0","","角"),IF(OR(TRUNC(A1*10)-(A1*10)=0,RIGHT(TRUNC(A1*100),1)="0"),"整",TEXT(RIGHT(TRUNC(A1*100),1),"[DBNum2]")&"分"))
小数点后两位四舍五入:=CONCATENATE(IF(A1<0,"负",""),TEXT(IF(TRUNC(ROUND(A1,2))=0,"零",TRUNC(ABS(ROUND(A1,2)))),"[DBNum2]")&"元",IF(TRUNC(ROUND(A1,2))=ROUND(A1,2),"",TEXT(RIGHT(TRUNC(ROUND(A1,2)*10),1),"[DBNum2]")),IF(RIGHT(TRUNC(ROUND(A1,2)*10),1)="0","","角"),IF(OR(TRUNC(ROUND(A1,2)*10)-(ROUND(A1,2)*10)=0,RIGHT(ROUND(A1,2),1)="0",TRUNC(ROUND(A1,2))=ROUND(A1,2)),"整",TEXT(RIGHT(ROUND(A1,2),1),"[DBNum2]")&"分"))
方法7
无条件舍去:=IF(A1<0,"负","")&SUBSTITUTE(TEXT(TRUNC(A1),"[DBNum2]")&"元"&IF(ISNUMBER(FIND(".",TRUNC(A1,2))),TEXT(RIGHT(TRUNC(A1*10)),"[DBNum2]")&IF(ISNUMBER(FIND(".0",A1)),"","角"),"")&IF(LEFT(RIGHT(TRUNC(A1,2),3),1)=".",TEXT(RIGHT(TRUNC(A1,2)),"[DBNum2]")&"分","整"),"-",)
小数点后两位四舍五入:=IF(A1<0,"负","")&SUBSTITUTE(TEXT(TRUNC(ROUND(A1,2)),"[DBNum2]")&"元"&IF(ISNUMBER(FIND(".",ROUND(A1,2))),TEXT(RIGHT(TRUNC(ROUND(A1,2)*10)),"[DBNum2]")&IF(ISNUMBER(FIND(".0",ROUND(A1,2))),"","角"),"")&IF(LEFT(RIGHT(TRUNC(ROUND(A1,2),2),3),1)=".",TEXT(RIGHT(ROUND(A1,2)),"[DBNum2]")&"分","整"),"-",)
方法8
再简化如后,请大家试试。
无条件舍去:
=IF(A1<0,"负","")&TEXT(TRUNC(ABS(A1)),"[DBNum2]")&"元"&IF(ISERR(FIND(".",TRUNC(A1,2))),"",TEXT(RIGHT(TRUNC(A1*10)),"[DBNum2]"))&IF(RIGHT(TRUNC(A1*10))="0","","角")&IF(LEFT(RIGHT(TRUNC(A1,2),3))=".",TEXT(RIGHT(TRUNC(A1,2)),"[DBNum2]")&"分","整")
小数点后两位四舍五入:
=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]")&"分","整")
方法9
=IF(ISTEXT(C2),"","人民币:"&TEXT(INT(C2),"[dbnum2]")&"元"&IF(INT(C2*10)-INT(C2)*10=0,"",TEXT(INT(C2*10)-INT(C2)*10,"[dbnum2]")&"角")&IF(INT(C2*100)-INT(C2*10)*10=0,"整",TEXT(INT(C2*100)-INT(C2*10)*10,"[dbnum2]")&"分"))
相关内容
-
Excel 2016教程: 停止对数字自动套用格式
Excel 2016教程: 停止对数字自动套用格式,格式,数字,教程,文...
-
Excel 2016教程: 将一个数字增加或减少一个百分
Excel 2016教程: 将一个数字增加或减少一个百分点,百分点,数...
-
Excel 2016教程: 仅复制单元格值、单元格格式或
Excel 2016教程: 仅复制单元格值、单元格格式或公式,格式,教...
-
Excel 2016教程: 查找或替换工作表上的文本和数
Excel 2016教程: 查找或替换工作表上的文本和数字,查找,替换,...
-
Excel日期时间函数:TIMEVALUE时间按一天计算的小
Excel日期时间函数:TIMEVALUE时间按一天计算的小数形式,计算,...
-
Excel日期时间函数:WORKDAY计算指定天数前后的日
Excel日期时间函数:WORKDAY计算指定天数前后的日期,日期,计算,...
-
Excel数据库函数:DAVERAGE所选数据库条目的平均
Excel数据库函数:DAVERAGE所选数据库条目的平均值,区域,类型,...
-
Excel数据库函数:DSTDEV样本估算标准偏差
Excel数据库函数:DSTDEV样本估算标准偏差,样本,数据库函数,标...
-
Excel日期时间函数:WEEKNUM显示特定日期的周数
Excel日期时间函数:WEEKNUM显示特定日期的周数,日期,显示,时间...
-
Excel数据库函数:VARP数据库条目的样本总体计算
Excel数据库函数:VARP数据库条目的样本总体计算方差,计算,方差...
-
Excel日期时间函数:NETWORKDAYS两个日期间的工作
Excel日期时间函数:NETWORKDAYS两个日期间的工作日数,日期,时...
-
Excel数据库函数:DPRODUCT满足指定条件的数值的
Excel数据库函数:DPRODUCT满足指定条件的数值的乘积,条件,数据...
-
Excel工程函数:BESSELI修正的贝赛耳函数 In(x)
Excel工程函数:BESSELI修正的贝赛耳函数 In(x),函数,修正,参数...
-
Excel信息函数:NA显示错误值 #N/A
Excel信息函数:NA显示错误值 #N/A,错误,显示,函数,格中,单元,...
-
Excel工程函数:IMPOWER复数的整数幂
Excel工程函数:IMPOWER复数的整数幂,函数,复合,语法,文本格式,...