在Excel函数公式里面怎么把一个数字变成大写的
时间:2022-11-18 10:51:50
方法一:
Function 大写金额(N)
'数字转为大写金额,仅一个参数。
Application.Volatile
大写金额 = Replace(Application.Text(Round(N + 0.00000001, 2), "[DBnum2]"), ".", "元")
大写金额 = IIf(Left(Right(大写金额, 3), 1) = "元", Left(大写金额, Len(大写金额) - 1) & "角" & Right(大写金额, 1) & "分", IIf(Left(Right(大写金额, 2), 1) = "元", 大写金额 & "角整", IIf(大写金额 = "零", "", 大写金额 & "元整")))
大写金额 = Replace(Replace(Replace(Replace(大写金额, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
将上面的自定义函数作为加载宏加载到你的EXCEL程序中,再插入函数“大写金额(N)”即可
方法二:
B1输入=IF(ROUND(A1,2)<0,"无效数值",IF(ROUND(A1,2)=0,"零",IF(ROUND(A1,2)<1,"",TEXT(INT(ROUND(A1,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A1,2)*10)-INT(ROUND(A1,2))*10=0,IF(INT(ROUND(A1,2))*(INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A1,2)*10)-INT(ROUND(A1,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10)=0,"整",TEXT((INT(ROUND(A1,2)*100)-INT(ROUND(A1,2)*10)*10),"[dbnum2]")&"分")))
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10个性化软件窗口显示不全怎么操作?
![](https://img.aspxhome.com/file/2023/7/49137_0s.png)
Word如何快速批量地删除多余空行?
![](https://img.aspxhome.com/file/2023/1/23461_0s.jpg)
怎样修改word的默认目录格式
编辑Word文档出现的不同下划线的含义
运行word宏出现"子过程或函数未定义"怎么办
![](https://img.aspxhome.com/file/2023/0/21010_0s.jpg)
Word2013怎么修改文字样式
![](https://img.aspxhome.com/file/2023/2/18352_0s.jpg)
excel表格公式失灵怎么办
![](https://img.aspxhome.com/file/2023/2/36412_0s.jpg)
word 标尺的使用方法 word标尺不见了如何找出来,word标尺的度量单位等等
![](https://img.aspxhome.com/file/2023/9/33349_0s.gif)
Word如何给图片添加立体效果
word怎么设置字体格式?
![](https://img.aspxhome.com/file/2023/6/17936_0s.jpg)
创建用户在Word2007中填写的窗体
![](https://img.aspxhome.com/file/2023/8/20658_0s.jpg)
Word插入直线波浪线等分隔线方法
![](https://img.aspxhome.com/file/2023/4/24374_0s.jpg)
Word软件中怎么对文字添加标题样式的方法分享
![](https://img.aspxhome.com/file/2023/0/30990_0s.png)
iOS 16 小技巧:锁屏通知有三种显示方式可选
![](https://img.aspxhome.com/file/2023/7/44837_0s.png)
如何在wps创建图形链接
![](https://img.aspxhome.com/file/2023/6/53426_0s.jpg)
在WORD中插入带圈数字11至20的序号的方法
Word2013中首字下沉如何设置
![](https://img.aspxhome.com/file/2023/2/18152_0s.jpg)
win10日历怎么显示农历?win10日历显示农历的方法
![](https://img.aspxhome.com/file/2023/5/47745_0s.png)
Word有很多页怎么只打印其中一页
![](https://img.aspxhome.com/file/2023/1/34131_0s.png)
Excel转置表格出错怎么办
![](https://img.aspxhome.com/file/2023/6/36216_0s.jpg)