excel數(shù)字小寫轉大寫公式的教程
excel數(shù)字小寫轉大寫公式的教程
用Excel辦公中,辦公員為了方便錄入通常都把數(shù)字用小寫錄入就得了,但卻需要轉化成大寫模式,所以需要利用Excel中的轉化公式,下面是學習啦小編整理的excel 數(shù)字小寫轉大寫公式的教程,以供大家閱讀。
excel 數(shù)字小寫轉大寫公式的教程1
通過函數(shù)嵌套實現(xiàn)
數(shù)字轉人民幣大寫形式的公式是:
=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]")&"分")
數(shù)字轉人民幣大寫形式的公式是:
="大寫金額:"&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]")&"分","整")))
excel 數(shù)字小寫轉大寫公式的教程2
通過宏VBA自定義函數(shù)實現(xiàn)第一步:按下ALT+F11組合鍵,或者是單擊工具——宏——Visual Basic編輯器,進入Visual Basic編程環(huán)境,單擊“插入” 菜單——模塊,復制下面代碼,保存,退出關閉。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單元格的數(shù)字轉為人民幣大寫,然后向下復制公式即可將全部的數(shù)字轉為人民幣大寫。