# Excel数字 转 人民币 繁体大写

1. 第一种方法：通过函数嵌套实现

=IF(B1<0,"金额为负无效",
(IF(OR(B1=0,B1=""),"(人民币)零元",
IF(B1<1,"(人民币)",
TEXT(INT(B1),"[dbnum2](人民币)G/通用格式")&"元"))))&
IF(
(INT(B1*10)-INT(B1)*10)=0,
IF(INT(B1*100)-INT(B1*10)*10=0,"","零"),
(TEXT(INT(B1*10)-INT(B1)*10,"[dbnum2]")&"角"))
&IF(
(INT(B1*100)-INT(B1*10)*10)=0,
"整",
TEXT((INT(B1*100)-INT(B1*10)*10),"[dbnum2]")&"分")

="大写金额："&IF(TRIM(B1)="","",IF(B1=0,"","人民币"&IF(B1<0,"负",)&IF(INT(B1),TEXT(INT(ABS(B1)),"[dbnum2]")&"元",)&IF(INT(ABS(B1)*10)-INT(ABS(B1))*10,TEXT(INT(ABS(B1)*10)-INT(ABS(B1))*10,"[dbnum2]")&"角",IF(INT(ABS(B1))=ABS(B1),,IF(ABS(B1)<0.1,,"零")))&IF(ROUND(ABS(B1)*100-INT(ABS(B1)*10)*10,),TEXT(ROUND(ABS(B1)*100-INT(ABS(B1)*10)*10,),"[dbnum2]")&"分","整")))

1. 第二种方法：通过宏VBA自定义函数实现第一步：按下ALT+F11组合键，或者是单击工具——宏——Visual Basic编辑器，进入Visual Basic编程环境，单击“插入” 菜单——模块，复制下面代码，保存，退出关闭。Function N2RMB(M)
y = Int(Round(100 * Abs(M)) / 100)
j = Round(100 * Abs(M) + 0.00001) - y * 100
f = (j / 10 - Int(j / 10)) * 10
A = IIf(y < 1, "", Application.Text(y, "[DBNum2]") & "元")
b = IIf(j > 9.5, Application.Text(Int(j / 10), "[DBNum2]") & "角", IIf(y < 1, "", IIf(f > 1, "零", "")))
c = IIf(f < 1, "整", Application.Text(Round(f, 0), "[DBNum2]") & "分")
N2RMB = IIf(Abs(M) < 0.005, "", IIf(M < 0, "负" & A & b & c, A & b & c))
End Function
第二步：返回excel操作界面，在B1单元格输入：= N2RMB (A1)，就可以将A1单元格的数字转为人民币大写，然后向下复制公式即可将全部的数字转为人民币大写。