大小写转换公式
EXCEK中阿拉伯数字日期转换为中文大写方法
---------------------------------------------------------------最新资料推荐------------------------------------------------------ EXCEK中阿拉伯数字日期转换为中文大写方法EXCEK 中阿拉伯数字日期转换为中文大写方法OFFICE 2019-02-14 19:53:53 阅读 58 评论 0 字号:大中小订阅一、日期转换为中文大写 1、日期中年中文大写的公式设置在表示年的单元格输入:=TEXT(MID(A5,1,1),[DBNUM2])TEXT(MID(A5,2,1),[DBNUM2])TEXT(M ID(A5,3,1),[DBNUM2])TEXT(MID(A5,4,1),[DBNUM2]) MID 函数是提取字符函数,公式中MID(A5,1,1),表示从 A5 单元格数字左第一个字符起提取一个字符,结果是 2 。
TEXT函数将阿拉伯数字转换为中文大写,公式中TEXT(MID(A5,1,1),[DBNUM2])表示将2转换为贰。
整个公式由四个文本连接符号连接而成,结果是贰零零叁。
不能直接利用TEXT函数将2003转换为中文大写,因为TEXT(2003,[DBNUM2])的结果是贰仟零叁,所以需将2003逐个数字转换为中文大写。
2、日期中月中文大写的公式设置在表示月的单元格输入:=IF(B511,零TEXT(B5,[DBNUM2]),TEXT(B5,[DBNUM2])) IF 函数是一个条件判断函数,整个公式可以表述为:如果 B5 单元格月份数为 1-10 之间数字,则将该数字转换为中文大写的同时,在前面加零,如当前是 5 月,则结果是零伍,否则1/ 11直接将 B5中月份数字转换为中文大写,如当前是 11 月,则结果是壹拾壹。
3、日期中日中文大写公式设置在表示日的单元格输入:=IF(OR(C511,C5=20,C5=30),零TEXT(C5,[DBNUM2]),TEXT(C5,[DBNUM2])) 公式中OR(C511,C5=20,C5=30)表示C5 或者小于 11,或者等于 20,或者等于 30。
人民币大小写转换函数
12056.56壹万贰仟零伍拾陆元伍角陆分壹万贰仟零伍拾陆元伍角陆分壹万贰仟零伍拾陆元伍角陆分壹万贰仟零伍拾陆元伍角陆分壹万贰仟零伍拾陆元伍角陆分近来转了转几个EXCEL相关论坛,发现有部分网友在寻求数字金额转换为人民币大写的方法。
出于好奇,我在网上搜索了一番,什么VBA、加载宏,公式函数各式方法争相亮相,应有尽有。
但我的习惯是,只要能用公式解决的问题,坚决不使用VBA。
所以我就特别地关注使用公式来生成的方法,结果是用公式的方法可谓是更加地灿烂缤纷,使人眼花缭乱。
通过分析我收集到的二十几个公式,发现比较牛,适合我口味的公式有三个,在此我将其列出。
公式一:SUBSTITUTE(SUBSTITUTE(IF(A1<0,"负","")&TEXT(TRUNC(ABS(ROUND(A1,2))),"[DBNum2]")&"元"&IF(ISERR(FIND(".",ROUND(A1,2))),"",TEXT(RIGHT(TRUNC(ROU ND(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]")&"分",IF(ROUND(A1,2)=0,"","整")),"零元零",""),"零元","")公式二:CONCATENATE(IF(A1<0,"负",""),TEXT(IF(TRUNC(A1)=0,"",TRUNC(ABS(A1))),"[DBNum2]"), IF(INT(TRUNC(A1))=0,"","元"),TEXT(IF(OR(ABS(A1)<0.1,TRUNC(A1)=A1),"",RIGHT(TRUNC(A1 *10),1)),"[DBNum2]"),IF(RIGHT(TRUNC(A1*10),1)="0","","角"),TEXT(IF(RIGHT(TRUNC(A1*100),1)="0","",RIGHT(TRUNC(A1*1 00),1)),"[DBNum2]"),IF(RIGHT(TRUNC(A1*100),1)="0","","分"))公式三:IF(ROUND(A1,2)=0,"",IF(ROUND(ABS(A1),2)>=1,TEXT(INT(ROUND (ABS(A1),2)),"[DBNum2]")&"元","")&IF(RIGHT(TEXT(A1,".00"),2)*1=0,"整",IF(RIGHT(TEXT(A1,".00"),4)*1>=1,IF(RIGHT(TEXT(A1,".00") ,2)*1>9,"","零"),IF(ROUND(ABS(A1),2)>=1,"零",""))&IF(RIGHT(TEXT(A1,".00"),2)*1>9,TEXT(LEFT(RIGHT(TEX T(A1,".00"),2)),"[DBNum2]")&"角","")&IF(RIGHT(TEXT(A1,".00"))*1>0,TEXT(RIGHT(TEXT(A1,".0 0")),"[DBNum2]")&"分","整"))) 我用不同的数值对这三个公式进行了一番测试,都达到了我的要求,至少到目前为止还没有发现上述公式存在着什么错误。
excel文本计算公式用法
文本计算公式在Excel中常用于对文本数据进行处理和计算。
以下是一些常见的文本计算公式及其用法:1. 文本连接:使用“&”符号可以将多个文本字符串连接起来。
例如,=B2&" "&C2 可以将单元格B2和C2中的文本连接起来,中间用空格分隔。
2. 文本提取:使用LEFT、MID和RIGHT函数可以从文本字符串中提取特定部分。
例如,=LEFT(A1,5) 可以提取单元格A1中最左边的5个字符。
3. 文本替换:使用SUBSTITUTE函数可以将文本字符串中的特定文本替换为另一个文本。
例如,=SUBSTITUTE(A1,"hello","world") 可以将单元格A1中的“hello”替换为“world”。
4. 文本大小写转换:使用LOWER、UPPER和PROPER函数可以将文本字符串转换为小写、大写或首字母大写。
例如,=LOWER(A1) 可以将单元格A1中的文本转换为小写。
5. 文本分割:使用TEXTSPLIT函数可以将文本字符串分割成多个单元格。
例如,=TEXTSPLIT(A1,",") 可以将单元格A1中的文本按照逗号进行分割,每个部分放到一个新的单元格中。
6. 文本转数值:使用VALUE函数可以将以文本形式存储的数据转换为值。
例如,=VALUE(A1) 可以将单元格A1中的文本转换为数值。
7. 计算文本长度:使用LEN函数可以计算单元格中的文本长度。
例如,=LEN(A1) 可以返回单元格A1中文本的长度。
以上是一些常见的Excel文本计算公式的用法,但不限于这些例子。
根据具体需求,还可以使用其他函数和公式对文本数据进行处理和计算。
大小写转换公式
IF(ROUND(A1,2)=0,"",IF(ROUND(ABS(A1),2)>=1,TEXT(INT(ROUND(ABS(A1),2)),"[DBNum2]")&"元","")&IF(RIGHT(TEXT(A1,".00"),2)*1=0,"整",IF(RIGHT(TEXT(A1,".00"),4)*1>=1,IF(RIGHT(TEXT(A1,".00"),2)*1>9,"","零"),IF(ROUND(ABS(A1),2)>=1,"零",""))&IF(RIGHT(TEXT(A1,".00"),2)*1>9,TEXT(LEFT(RIGHT(TEXT(A1,".00"),2)),"[DBNum2]")&"角","")&IF(RIGHT(TEXT(A1,".00"))*1>0,TEXT(RIGHT(TEXT(A1,".00")),"[DBNum2]")&"分","整")))公式的含义是:如果(IF)当前日期(B1)是星期“7”(WEEKDAY(B1,2)=7),则在F1单元格中显示“日”,否则,直接显示出星期的数值(WEEKDAY(B1,2))。
[DBNum2]:是格式函数, 就是将数字转换成中文大写TEXT函数是将一数值转换为按指定格式表示的文本的函数,也就是把数字转换成文本格式。
小写转换大写
小写转换大写EXCEL文本函数-数字小写换大写/英文大小写互换2007年10月17日星期三 13:04在大小写中英文互换公式中我们先假设每个表都有表头,且数字在第二行,在A2单元格内注意:公式可以随意拖动至任意指定单元格,公式内对象不变;可复制(待鼠标变成黑色十字再拖);也可利用查找-替换-全部替换单元格如A2---全部换成F15EXCEL中数字小写换大写方法一:在单元格A2中输入小写数字123.12B2处输入以下公式=SUBSTITUTE(SUBSTITUTE(IF(A2<0,"负","")&TEXT(TRUNC(ABS(ROUND(A2,2))),"[DBNum2]")&"元"&IF(ISERR(FIND(".",ROUND(A2,2))),"",TEXT(RIGHT(TRUNC(ROUND(A2,2)*10)),"[DBNum2 ]"))&IF(ISERR(FIND(".0",TEXT(A2,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A2,2),3))=".",TEXT(RIGHT(ROUND(A2,2)),"[DBNum2]")&"分",IF(ROUND(A2,2)=0,"","整")),"零元零",""),"零元","")EXCEL中数字小写换大写方法二:在单元格A2中输入小写数字123.12B2处输入以下公式=IF((INT(A2*10)-INT(A2)*10)=0,TEXT(INT(A2),"[DBNum2]G/通用格式")&"元"&IF((INT(A2*100)-INT((A2)*10)*10)=0,"整","零"&TEXT(INT(A2*100)-INT(A2*10)*10,"[DBNum2]G/通用格式")&"分"),TEXT(INT(A2),"[DBNum2]G/通用格式")&"元"&IF((INT(A2*100)-INT((A2)*10)*10)=0,TEXT((INT(A2*10)-INT(A2)*10),"[DBNum2]G/通用格式")&"角整",TEXT((INT(A2*10)-INT(A2)*10),"[DBNum2]G/通用格式")&"角"&TEXT(INT(A2*100)-INT(A2*10)*10,"[DBNum2]G/通用格式")&"分"))EXCEL中数字小写换大写方法三:=IF(A2-INT(A2)=0,TEXT(INT(A2),"[DBNum2]G/通用格式")&"圆整",TEXT(INT(A2),"[DBNum2]G/通用格式")&"圆"&TEXT(INT((A2-INT(A2))*10),"[DBNum2]G/通用格式")&"角"&TEXT(INT((A2*10-INT(A2*10))*10),"[DBNum2]G/通用格式")&"分")EXCEL中数字小写换大写方法四:=IF((A2-INT(A2))=0,TEXT(A2,"[DBNUM2]")&"元整",IF(INT(A2*10)-A2*10=0,TEXT(INT(A2),"[DBNUM2]")&"元"&TEXT((INT(A2*10)-INT(A2)*10),"[DBNUM2]")&"角整",TEXT(INT(A2),"[DBNUM2]")&"元"&IF(INT(A2*10)-INT(A2)*10=0,"零",TEXT(INT(A2*10)-INT(A2)*10,"[DBNUM2]")&"角")&TEXT(RIGHT(A2,1),"[DBNUM2]")&"分"))看看结果是不是出现了你想要的?应该有你需要的大写金额了公式的由来:仟分位公式如下:=TEXT(IF(LEN(INT($A1))>=4,MID($A1,LEN(INT($A1))-3,1),""),"[DBNum2]")佰分位公式如下:=TEXT(IF(LEN(INT($A1))>=3,MID($A1,LEN(INT($A1))-2,1),""),"[DBNum2]")第一位小数的公式:=TEXT(MID($A1,FIND(".",$A1)+1,1),"[DBNum2]")第二位小数的公式:=TEXT(MID(TEXT($A1,"0.00"),FIND(".",$A1)+2,1),"[DBNum2]") 其他依此类推^^^^^^^^^^^^^^^^用Excel函数将货币数值由阿拉伯数字自动生成为中文大写格式如图是全部用Excel函数自编农业银行转帐支票套打工具,图中内容是需要打印到转帐支票上内容,其中A-D列为支票存根部分,我们利用Excel函数对要填写大部分内容建立公式后,只要输入支票存根部分的三项基本信息(A6-A8单元格):收款单位、金额、用途,其他内容全部自动生成。
EXCEL金额大小写转换公式大全
EXCEL金额大小写转换公式大全2007-12-15 16:08先选中需要转换的单元格,在格式(或者右击设置单元格格式中)——单元格格式——数据——特殊——右边类型:中文小写、中文大写=NUMBER STRIN G($A$1,1)1=IF(A5=0,"",CONCATENA TE(IF(INT(A5)=0,"",TEXT(INT(A5),"[DBNum2]G/通用格式元")),IF(INT(MID(RIGHT(FIXED(A5,2,1),2),1,1))=0,IF(INT(MID(RIGHT(FIXED(A5,2,1),1),1,1))=0,"",IF(INT(A5)=0,"","零")),TEXT(INT(MID(RIGHT(FIXED(A5,2,1),2),1,1)),"[DBNum2]G/通用格式角")),IF(INT(MID(RIGHT(FIXED(A5,2,1),1),1,1))=0,"整",TEXT(INT(MID(RIGHT(FIXED(A5,2,1),1),1,1)),"[DBNum2]G/通用格式分"))))2=IF(A5<0,"負","")&IF(ABS(A5)>1,TEXT(TRUNC(ABS(ROUND(A5,2))),"[DBNum2]")&"元","")&IF(ISERR(FIND(".",ROUND(A5,2))),"",TEXT(RIGHT(TRUNC(ROUND(A5,2)*10)),"[DBNum2]"))&IF(ISERR(FIND(".0",TEXT(A5,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A5,2),3))=".",TEXT(RIGHT(ROUND(A5,2)),"[DBNum2]")&"分","整")3=IF(A5<0,"负","")&IF(TRUNC(ROUND(A5,2))=0,"",TEXT(TRUNC(ABS(ROUND(A5,2))),"[DBNum2]")&"元")&IF(ISERR(FIND(".",ROUND(A5,2))),"",TEXT(RIGHT(TRUNC(ROUND(A5,2)*10)),"[DBNum2]"))&IF(ISERR(FIND(".0",TEXT(A5,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A5,2),3))=".",TEXT(RIGHT(ROUND(A5,2)),"[DBNum2]")&"分","整")4=SUBSTITUTE(SUBSTITUTE(IF(A5<0,"負","")&TEXT(TRUNC(ABS(ROUND(A5,2))),"[DBNum2]")&"元"&IF(ISERR(FIND(".",ROUND(A5,2))),"",TEXT(RIGHT(TRUNC(ROUND(A5,2)*10)),"[DBNum2]"))&IF(ISERR(FIND(".0",TEXT(A5,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A5,2),3))=".",TEXT(RIGHT(ROUND(A5,2)),"[DBNum2]")&"分",IF(ROUND(A5,2)=0,"","整")),"零元零",""),"零元","")5=IF(ROUND(A5,2)<0,"无效数值",IF(ROUND(A5,2)=0,"零",IF(ROUND(A5,2)<1,"",TEXT(INT(ROUND(A5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10=0,IF(INT(ROUND(A5,2))*(INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"整",TEXT((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10),"[dbnum2]")&"分")))6=IF(ISNUMB ER(A5),IF(A5<0,"无效数值",IF(A5<0.005,"零",IF(A5<0.995,"",TEXT(INT(A5+0.005),"[dbnum2]")&"元")&IF(LEFT(RIGHT(FIXED(A5,2),2),1)="0",IF(RIGHT(FIXED(A5,2),1)="0","",IF(A5>0.995,"零","")),TEXT(LEFT(RIGHT(FIXED(A5,2),2),1),"[dbnum2]")&"角")&IF(RIGHT(FIXED(A5,2),1)="0","整",TEXT(RIGHT(FIXED(A5,2),1),"[dbnum2]")&"分"))),"非数值!")7=IF(ISNUMB ER(A5),IF(ROUND(A5,2)<0,"无效数值",IF(ROUND(A5,2)=0,"零",IF(ROUND(A5,2)<1,"",TEXT(INT(ROUND(A5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10=0,IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"整",TEXT((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10),"[dbnum2]")&"分"))),"非数值!!!")8=IF(ROUND(A5,2)<0,"无效数值",IF(ROUND(A5,2)=0,"零",IF(ROUND(A5,2)<1,"",TEXT(INT(ROUND(A5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10=0,IF(INT(ROUND(A5,2))*(INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"整",TEXT((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10),"[dbnum2]")&"分")))9=TEXT(INT(A5),"[dbnum2]")&"元"&IF(INT(A5*10)-INT(A5)*10=0,"",TEXT(INT(A5*10)-INT(A5)*10,"[dbnum2]")&"角")&IF(INT(A5*100)-INT(A5*10)*10=0,"整",TEXT(INT(A5*100)-INT(A5*10)*10,"[dbnum2]")&"分")10Functi on BAITUR MBDX(ByValn) As String 'n as Curren cyConst cNum As String = "零壹贰叁肆伍陆柒捌玖-万仟佰拾亿仟佰拾万仟佰拾元角分" Const cCha As String= "零仟零佰零拾零零零零零亿零万零元亿万零角零分零整-零零零零零亿万元亿零整整"Dim sNum As StringDim i As LongIf (n <> 0) And (Abs(n) < 10000000000000#) ThensNum = Trim(Str(Int(Abs(n) * 100)))For i = 1 To Len(sNum) '逐位转换BAITUR MBDX= BAITUR MBDX+ Mid(cNum, (Mid(sNum, i, 1)) + 1, 1) + Mid(cNum, 26 - Len(sNum) + i, 1)NextFor i = 0 To 11 '去掉多余的零BAITUR MBDX= Replac e(BAITUR MBDX, Mid(cCha, i * 2 + 1, 2), Mid(cCha, i + 26, 1)) NextIf n < 0 Then BAITURMBDX= "(负)" + BAITURMBDXElseBAITURMBDX= IIf(n = 0, "零元", "溢出")End IfEnd Functi on11Functi on UpperN um(n) 'n as single '数字大写函数If n < 0 Then正负判断= "负"n = -nEnd Ifn = n + 0.0001If Int(n * 1000) - Int(n * 100) * 10 > 4 Thenn = (Int(n * 100) + 1) / 100 + 0.001Elsen = Int(n * 100) / 100 + 0.001End IfSelect Case nC ase Is > 9999999999999.99UpperN um = "数据不符"MsgBox "金额不能大于9999999999999.99!", vbOKOnl y, "出错提示"Case ElseConst cNum = "零壹贰叁肆伍陆柒捌玖-万仟佰拾亿仟佰拾万仟佰拾元角分"Const cCha = "零仟零佰零拾零零零零零亿零万零元亿万零角零分零整-零零零零零亿万元亿零整整"UpperN um = ""sNum = ""s = Trim(Str(n))For i = 1 To Len(s) - 1If Mid(s, i, 1) <> "." Then sNum = sNum + Mid(s, i, 1)Next iFor i = 1 To Len(sNum) '逐位转换U pperN um = UpperN um + Mid(cNum, (Mid(sNum, i, 1)) + 1, 1) + Mid(cNum, 26 - Len(sNum) + i, 1)Next iFor i = 0 To 11 '去掉多余的零U pperN um = Replac e(UpperN um, Mid(cCha, i * 2 + 1, 2), Mid(cCha, i + 26, 1)) Next iEnd SelectIf 正负判断= "负" Then UpperN um = "负" & UpperN umEnd Functi on12Functi on JEZH(X As Range)If X >= 1 ThenIf Int(X) = X Or Round(X, 2) = Int(X) ThenJEZH = Applic ation.Worksh eetFu nctio n.Text(Int(X), "[DBNUM2]") & "元"ElseIf Int(X * 10) = X * 10 Or Int(X * 10) = Round(X, 2) * 10 ThenJEZH = Applic ation.Worksh eetFu nctio n.Text(Int(X), "[DBNUM2]") & "元" & Application.Worksh eetFu nctio n.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "角"ElseJEZH = Applic ation.Worksh eetFu nctio n.Text(Int(X), "[DBNUM2]") & "元" & Application.Worksh eetFu nctio n.Text(Left(Right(Round(X, 2), 2), 1), "[DBNUM2]") & "角" & Application.Worksh eetFu nctio n.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "分"End IfElseIf X = 0 ThenJEZH = Applic ation.Worksh eetFu nctio n.Text(Int(X), "[DBNUM2]") & "元"ElseIf X < 1 And X > 0 ThenIf Int(X * 10) = X * 10 ThenJEZH = Applic ation.Worksh eetFu nctio n.Text(Right(X, 1), "[DBNUM2]") & "角"ElseJEZH = Applic ation.Worksh eetFu nctio n.Text(Left(Right(Round(X, 2), 2), 1), "[DBNUM2]") & "角" & Applic ation.Worksh eetFu nctio n.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "分"End IfElseIf Int(X) = X Or Round(Abs(X), 2) = Int(Abs(X)) ThenJEZH = "负" & Applica tion.Worksh eetFu nctio n.Text(Int(Abs(X)), "[DBNUM2]") & "元"ElseIf Int(X * 10) = X * 10 ThenJEZH = "负" & Applic ation.Worksh eetFu nctio n.Text(Int(Abs(X)), "[DBNUM2]") & "元" & Applic ation.W orksh eetFu nctio n.Text(Right(X, 1), "[DBNUM2]") & "角"ElseJEZH = "负" & Applic ation.Worksh eetFu nctio n.Text(Int(Abs(X)), "[DBNUM2]") & "元" & Applica tion.Worksh eetFu nctio n.Text(Left(Right(Round(X, 2), 2), 1), "[DBNUM2]") & "角" & Applic ation.Worksh eetFu nctio n.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "分"End IfEnd IfEnd Functi on。
excel 转换文本函数
excel 转换文本函数Excel是一个功能强大的电子表格软件,它可以帮助用户进行各种数据处理和分析工作。
其中,文本函数是Excel中非常有用的一种函数,它可以帮助用户进行文本的格式转换、提取和处理等操作。
本文将重点介绍Excel中的文本函数之一——转换文本函数。
一、转换文本函数的概述转换文本函数是Excel中一类可以将指定文本按照一定规则进行转换的函数。
它可以实现文本大小写转换、半角转全角、删除指定字符、提取指定字符串等功能。
在处理文本数据时,转换文本函数可以帮助我们节省大量的时间和精力,并提高数据处理的准确度和效率。
二、转换文本函数的使用1、大写转换函数——UPPERUPPER函数可以将文本中的所有字符转换为大写字母。
其语法为:=UPPER(text)其中,text为要转换的文本。
例如,将单元格A1中的文本转换为大写字母,可以使用如下公式:=UPPER(A1)2、小写转换函数——LOWERLOWER函数可以将文本中的所有字符转换为小写字母。
其语法为:=LOWER(text)其中,text为要转换的文本。
例如,将单元格A1中的文本转换为小写字母,可以使用如下公式:=LOWER(A1)3、名称转换函数——PROPERPROPER函数可以将文本中每个单词的首字母转换为大写字母,其他字母为小写字母。
其语法为:=PROPER(text)其中,text为要转换的文本。
例如,将单元格A1中的文本转换为首字母大写格式,可以使用如下公式:=PROPER(A1)4、半角转全角函数——DBCDBC函数可以将文本中英文字母、数字、符号等字符转换为全角字符。
其语法为:=DBC(text)其中,text为要转换的文本。
例如,将单元格A1中的文本转换为全角字符格式,可以使用如下公式:=DBC(A1)5、全角转半角函数——SBCSBC函数可以将文本中全角字符转换为半角字符。
其语法为:=SBC(text)其中,text为要转换的文本。
大小写金额转换(Excel公式计算)
大写金额:(人民币)叁元柒角捌分 大写金额:(人民币)肆元陆角伍分 大写金额:(人民币) 大写金额:(人民币) 大写金额:(人民币) 大写金额:(人民币)叁佰贰拾伍元整 大写金额:(人民币)玖佰柒拾捌元整 大写金额:(人民币)贰拾元整 大写金额:(人民币)壹佰元整 大写金额:(人民币)壹万元整 大写金额:(人民币)壹元整 大写金额:(人民币)壹拾元整 大写金额:(人民币)壹仟元整 大写金额:(人民币)壹万元整 大写金额:(人民币)壹拾万元整 大写金额:(人民币)壹佰万元整 大写金额:(人民币)壹仟万元整 大写金额:(人民币)壹亿元整 大写金额:(人民币)壹拾亿元整 大写金额:(人民币)壹佰亿元整 大写金额:(人民币)壹仟亿元整 大写金额:(人民币)壹兆元整 大写金额:(人民币)壹拾兆元整 大写金额:(人民币)壹零零零零零零兆元整
0
大写金额:(人民币)负玖角玖分
0 玖分
#REF!
金额 ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ ¥ -0.99 1.25 1.05 0.90 3.25 4.68 -0.50 99.00 3.05 4.08 0.01 1.00 0.10 1.02 0.20 375.00 325.00 99,999,999,999,999.00 0.01 -0.01 325.00 9,786.59 0.99 -0.99 1.99 -1.99 0.25 0.20
大写 大写金额:(人民币)负玖角玖分 大写金额:(人民币)壹元贰角伍分 大写金额:(人民币)壹元零伍分 大写金额:(人民币)玖角整 大写金额:(人民币)叁元贰角伍分 大写金额:(人民币)肆元陆角捌分 大写金额:(人民币)负伍角整 大写金额:(人民币)玖拾玖元整 大写金额:(人民币)叁元零伍分 大写金额:(人民币)肆元零捌分 大写金额:(人民币)壹分 大写金额:(人民币)壹元整 大写金额:(人民币)壹角整 大写金额:(人民币)壹元零贰分 大写金额:(人民币)贰角整 大写金额:(人民币)叁佰柒拾伍元整 大写金额:(人民币)叁佰贰拾伍元整 大写金额:(人民币)玖拾玖兆玖仟玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖元整 大写金额:(人民币)壹分 大写金额:(人民币)负壹分 大写金额:(人民币)叁佰贰拾伍元整 大写金额:(人民币)玖仟柒佰捌拾陆元伍角玖分 大写金额:(人民币)玖角玖分 大写金额:(人民币)负玖角玖分 大写金额:(人民币)壹元玖角玖分 大写金额:(人民币)负壹元玖角玖分 大写金额:(人民币)贰角伍分 大写金额:(人民币)贰角整
Excel如何使用数字大小写转换函数
Excel如何使用数字大小写转换函数
在Excel表格中,将数字的大小写转换的方法有很多,其中有一种是可以使用函数公式来帮助我们自动实现大小写转换的。
下面就跟店铺一起看看吧。
Excel数字大小写转换函数的使用步骤
数字大小写转换函数
实际相当于函数=NUMBERSTRING(1234567890,3),参数为3时,输出结果直接为独立数字大写。
实际相当于函数=NUMBERSTRING(1234567890,2),参数为2时,输出结果直接为金额大写。
实际相当于函数=NUMBERSTRING(1234567890,1),参数为1时,输出结果直接为整个数字的大写。
value值用的是引用表格,和直接输入数字是一样。
EXCEL金额大小写转换公式大全
EXCEL金额大小写转换公式大全2007-12-15 16:08先选中需要转换的单元格,在格式(或者右击设置单元格格式中)——单元格格式——数据——特殊——右边类型:中文小写、中文大写=NUMBERSTRING($A$1,1)1=IF(A5=0,"",CONCATENA TE(IF(INT(A5)=0,"",TEXT(INT(A5),"[DBNum2]G/通用格式元")),IF(INT(MID(RIGHT(FIXED(A5,2,1),2),1,1))=0,IF(INT(MID(RIGHT(FIXED(A5,2,1),1),1,1) )=0,"",IF(INT(A5)=0,"","零")),TEXT(INT(MID(RIGHT(FIXED(A5,2,1),2),1,1)),"[DBNum2]G/通用格式角")),IF(INT(MID(RIGHT(FIXED(A5,2,1),1),1,1))=0,"整",TEXT(INT(MID(RIGHT(FIXED(A5,2,1),1),1,1)),"[DBNum2]G/通用格式分"))))2=IF(A5<0,"負","")&IF(ABS(A5)>1,TEXT(TRUNC(ABS(ROUND(A5,2))),"[DBNum2]")&"元","")&IF(ISERR(FIND(".",ROUND(A5,2))),"",TEXT(RIGHT(TRUNC(ROUND(A5,2)*10)),"[D BNum2]"))&IF(ISERR(FIND(".0",TEXT(A5,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A5,2),3))=".",TEXT(RIGHT(ROUND(A5,2)),"[DBNum2]")&"分","整")3=IF(A5<0,"负","")&IF(TRUNC(ROUND(A5,2))=0,"",TEXT(TRUNC(ABS(ROUND(A5,2))),"[DBNum2]")&"元")&IF(ISERR(FIND(".",ROUND(A5,2))),"",TEXT(RIGHT(TRUNC(ROUND(A5,2)*10)),"[DBN um2]"))&IF(ISERR(FIND(".0",TEXT(A5,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A5,2),3))=".",TEXT(RIGHT(ROUND(A5,2)),"[DBNum2]")&"分","整")4=SUBSTITUTE(SUBSTITUTE(IF(A5<0,"負","")&TEXT(TRUNC(ABS(ROUND(A5,2))),"[DBNum2]")&"元"&IF(ISERR(FIND(".",ROUND(A5,2))),"",TEXT(RIGHT(TRUNC(ROUND(A5,2)*10)),"[DBN um2]"))&IF(ISERR(FIND(".0",TEXT(A5,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A5,2),3))=".",TEXT(RIGHT(ROUND(A5,2)),"[DBNum2]")&"分",IF(ROUND(A5,2)=0,"","整")),"零元零",""),"零元","")=IF(ROUND(A5,2)<0,"无效数值",IF(ROUND(A5,2)=0,"零",IF(ROUND(A5,2)<1,"",TEXT(INT(ROUND(A5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10=0,IF(INT(ROUND(A5,2))*(INT(ROU ND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"整",TEXT((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10),"[dbnum2]")&"分")))6=IF(ISNUMBER(A5),IF(A5<0,"无效数值",IF(A5<0.005,"零",IF(A5<0.995,"",TEXT(INT(A5+0.005),"[dbnum2]")&"元")&IF(LEFT(RIGHT(FIXED(A5,2),2),1)="0",IF(RIGHT(FIXED(A5,2),1)="0","",IF(A5>0.995,"零","")),TEXT(LEFT(RIGHT(FIXED(A5,2),2),1),"[dbnum2]")&"角")&IF(RIGHT(FIXED(A5,2),1)="0","整",TEXT(RIGHT(FIXED(A5,2),1),"[dbnum2]")&"分"))),"非数值!")7=IF(ISNUMBER(A5),IF(ROUND(A5,2)<0,"无效数值",IF(ROUND(A5,2)=0,"零",IF(ROUND(A5,2)<1,"",TEXT(INT(ROUND(A5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10=0,IF((INT(ROUND(A5,2)*100)-INT(R OUND(A5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"整",TEXT((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10),"[dbnum2]")&"分"))),"非数值!!!")8=IF(ROUND(A5,2)<0,"无效数值",IF(ROUND(A5,2)=0,"零",IF(ROUND(A5,2)<1,"",TEXT(INT(ROUND(A5,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10=0,IF(INT(ROUND(A5,2))*(INT(ROU ND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"","零"),TEXT(INT(ROUND(A5,2)*10)-INT(ROUND(A5,2))*10,"[dbnum2]")&"角")&IF((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10)=0,"整",TEXT((INT(ROUND(A5,2)*100)-INT(ROUND(A5,2)*10)*10),"[dbnum2]")&"分")))9=TEXT(INT(A5),"[dbnum2]")&"元"&IF(INT(A5*10)-INT(A5)*10=0,"",TEXT(INT(A5*10)-INT(A5)*10,"[dbnum2]")&"角")&IF(INT(A5*100)-INT(A5*10)*10=0,"整",TEXT(INT(A5*100)-INT(A5*10)*10,"[dbnum2]")&"分")Function BAITURMBDX(ByVal n) As String 'n as CurrencyConst cNum As String = "零壹贰叁肆伍陆柒捌玖-万仟佰拾亿仟佰拾万仟佰拾元角分"Const cCha As String = "零仟零佰零拾零零零零零亿零万零元亿万零角零分零整-零零零零零亿万元亿零整整"Dim sNum As StringDim i As LongIf (n <> 0) And (Abs(n) < 10000000000000#) ThensNum = Trim(Str(Int(Abs(n) * 100)))For i = 1 To Len(sNum) '逐位转换BAITURMBDX = BAITURMBDX + Mid(cNum, (Mid(sNum, i, 1)) + 1, 1) + Mid(cNum, 26 - Len(sNum) + i, 1)NextFor i = 0 To 11 '去掉多余的零BAITURMBDX = Replace(BAITURMBDX, Mid(cCha, i * 2 + 1, 2), Mid(cCha, i + 26, 1))NextIf n < 0 Then BAITURMBDX = "(负)" + BAITURMBDXElseBAITURMBDX = IIf(n = 0, "零元", "溢出")End IfEnd Function11Function UpperNum(n) 'n as single '数字大写函数If n < 0 Then正负判断= "负"n = -nEnd Ifn = n + 0.0001If Int(n * 1000) - Int(n * 100) * 10 > 4 Thenn = (Int(n * 100) + 1) / 100 + 0.001Elsen = Int(n * 100) / 100 + 0.001End IfSelect Case nCase Is > 9999999999999.99UpperNum = "数据不符"MsgBox "金额不能大于9999999999999.99!", vbOKOnly, "出错提示"Case ElseConst cNum = "零壹贰叁肆伍陆柒捌玖-万仟佰拾亿仟佰拾万仟佰拾元角分"Const cCha = "零仟零佰零拾零零零零零亿零万零元亿万零角零分零整-零零零零零亿万元亿零整整"UpperNum = ""sNum = ""s = Trim(Str(n))For i = 1 To Len(s) - 1If Mid(s, i, 1) <> "." Then sNum = sNum + Mid(s, i, 1)Next iFor i = 1 To Len(sNum) '逐位转换UpperNum = UpperNum + Mid(cNum, (Mid(sNum, i, 1)) + 1, 1) + Mid(cNum, 26 - Len(sNum) + i, 1)Next iFor i = 0 To 11 '去掉多余的零UpperNum = Replace(UpperNum, Mid(cCha, i * 2 + 1, 2), Mid(cCha, i + 26, 1))Next iEnd SelectIf 正负判断= "负" Then UpperNum = "负" & UpperNumEnd Function12Function JEZH(X As Range)If X >= 1 ThenIf Int(X) = X Or Round(X, 2) = Int(X) ThenJEZH = Application.WorksheetFunction.Text(Int(X), "[DBNUM2]") & "元"ElseIf Int(X * 10) = X * 10 Or Int(X * 10) = Round(X, 2) * 10 ThenJEZH = Application.WorksheetFunction.Text(Int(X), "[DBNUM2]") & "元" & Application.WorksheetFunction.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "角"ElseJEZH = Application.WorksheetFunction.Text(Int(X), "[DBNUM2]") & "元" & Application.WorksheetFunction.Text(Left(Right(Round(X, 2), 2), 1), "[DBNUM2]") & "角" & Application.WorksheetFunction.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "分"End IfElseIf X = 0 ThenJEZH = Application.WorksheetFunction.Text(Int(X), "[DBNUM2]") & "元"ElseIf X < 1 And X > 0 ThenIf Int(X * 10) = X * 10 ThenJEZH = Application.WorksheetFunction.Text(Right(X, 1), "[DBNUM2]") & "角"ElseJEZH = Application.WorksheetFunction.Text(Left(Right(Round(X, 2), 2), 1), "[DBNUM2]") & "角" & Application.WorksheetFunction.Text(Right(Round(X, 2), 1),"[DBNUM2]") & "分"End IfElseIf Int(X) = X Or Round(Abs(X), 2) = Int(Abs(X)) ThenJEZH = "负" & Application.WorksheetFunction.Text(Int(Abs(X)), "[DBNUM2]") & "元"ElseIf Int(X * 10) = X * 10 ThenJEZH = "负" & Application.WorksheetFunction.Text(Int(Abs(X)), "[DBNUM2]") & "元" & Application.WorksheetFunction.Text(Right(X, 1), "[DBNUM2]") & "角"ElseJEZH = "负" & Application.WorksheetFunction.Text(Int(Abs(X)), "[DBNUM2]") & "元" & Application.WorksheetFunction.Text(Left(Right(Round(X, 2), 2), 1), "[DBNUM2]") & "角" & Application.WorksheetFunction.Text(Right(Round(X, 2), 1), "[DBNUM2]") & "分"End IfEnd IfEnd Function。
EXCEL中数字转换中文大写公式
EXCEL中数字转换中文大写公式EXCEL中数字转换中文大写公式=IF(G6<0,\负\通用格式元\角\分\EXCEL中数字小写换大写方法一:在单元格A2中输入小写数字123.12 B2处输入以下公式=SUBSTITUTE(SUBSTITUTE(IF(A2<0,\负\元\),\角%um2]\分\整\零元零\零元\EXCEL中数字小写换大写方法二:在单元格A2中输入小写数字123.12 B2处输入以下公式=IF((INT(A2*10)-INT(A2)*10)=0,TEXT(INT(A2),\通用格式\元\整\零\通用格式\分\通用格式\元\通用格式\角整\通用格式\角\通用格式\分\EXCEL中数字小写换大写方法三:=IF(A2-INT(A2)=0,TEXT(INT(A2),\通用格式\圆整\通用格式\圆\通用格式\角\通用格式\分\EXCEL中数字小写换大写方法四:=IF((A2-INT(A2))=0,TEXT(A2,\元整\元\角整\元\零\角\分\看看结果是不是出现了你想要的?应该有你需要的大写金额了公式的由来: 仟分位公式如下:=TEXT(IF(LEN(INT($A1))>=4,MID($A1,LEN(INT($A1))-3,1),\佰分位公式如下:=TEXT(IF(LEN(INT($A1))>=3,MID($A1,LEN(INT($A1))-2,1),\第一位小数的公式:=TEXT(MID($A1,FIND(\第二位小数的公式:=TEXT(MID(TEXT($A1,\其他依此类推^^^^^^^^^^^^^^^^用Excel函数将货币数值由阿拉伯数字自动生成为中文大写格式如图是全部用Excel函数自编农业银行转帐支票套打工具,图中内容是需要打印到转帐支票上内容,其中A-D列为支票存根部分,我们利用Excel函数对要填写大部分内容建立公式后,只要输入支票存根部分的三项基本信息(A6-A8单元格):收款单位、金额、用途,其他内容全部自动生成。
Excel中金额大小写转换(解决负数无法显示问题)
Excel中金额大小写转换(解决负数无法显示问题)一、Excel自动转换数字大小写具体的操作步骤如下:1. 启动excel。
按“alt+f11”快捷键打开“visual basic编辑器”。
2. 在“visual basic编辑器”中,单击“插入”菜单栏中的“模块”命令,插入一个模块。
双击左侧“工程”窗口中的“模块1”选项,在窗口右边展开“模块1(代码)”编辑窗口,然后输入如下代码:Function NtoC(n) 'n as singleConstcNum = "零壹贰叁肆伍陆柒捌玖-万仟佰拾亿仟佰拾万仟佰拾元角分"ConstcCha = "零仟零佰零拾零零零零零亿零万零元亿万零角零分零整-零零零零零亿万元亿零整整"NtoC = ""sNum = Trim(Str(Int(n * 100)))For i = 1 To Len(sNum) '逐位转换NtoC = NtoC + Mid(cNum, (Mid(sNum, i, 1)) + 1, 1) + Mid(cNum, 26 - Len(sNum) + i, 1)NextFor i = 0 To 11 '去掉多余的零NtoC = Replace(NtoC, Mid(cCha, i * 2 + 1, 2), Mid(cCha, i + 26, 1))NextEnd Function3.练习A1=-10135.33 A2=NTOC(ABS(A1))二、Excel中金额大小写转换公式公式1:“=IF(ROUND(E19,2)=0,"",IF(ROUND(ABS(E19),2)>=1,TEXT(INT(ROUND(ABS(E19),2)),"[DBNum2]" )&"元","")&IF(RIGHT(TEXT(E19,".00"),2)*1=0,"整",IF(RIGHT(TEXT(E19,".00"),4)*1>=1,IF(RIGHT(TEXT(E19,".00"),2)*1>9,"","零"),IF(ROUND(ABS(E19),2)>=1,"零",""))&IF(RIGHT(TEXT(E19,".00"),2)*1>9,TEXT(LEFT(RIGHT(TEXT(E19,".00"),2)),"[DBNum2]")&"角","")&IF(RIGHT(TEXT(E19,".00"))*1>0,TEXT(RIGHT(TEXT(E19,".00")),"[DBNum2]")&"分","整")))”公式2:“=IF(F4<1,IF(F4<0.1,TEXT(INT(F4*100),"[DBNum2]G/通用格式")&"分",IF((INT(F4*100)-INT(F4*10)*10=0),TEXT(INT(F4*10),"[DBNum2]G/通用格式")&"角整",TEXT(INT(F4*10),"[DBNum2]G/通用格式")&"角"&TEXT(INT(F4*100)-INT(F4*10)*10,"[DBNum2]G/通用格式")&"分")),TEXT(INT(F4),"[DBNum2]G/通用格式"&"元")&IF((INT(F4*10)-INT(F4)*10)=0,IF((INT(F4*100)-INT(F4*10)*10)=0,"","零"),IF((INT(F4*0.1)-INT(F4)*0.1)=0,"零","")&TEXT(INT(F4*10)-INT(F4)*10,"[DBNum2]G/通用格式")&"角")&IF((INT(F4*100)-INT(F4*10)*10)=0,"整",TEXT(INT(F4*100)-INT(F4*10)*10,"[DBNum2]G/通用格式")&"分"))”公式3:“=IF(B10<1,IF(B10<0.1,TEXT(INT(B10*100),"[DBNum2]G/通用格式")&"分",IF((INT(B10*100)-INT(B10*10)*10=0),TEXT(INT(B10*10),"[DBNum2]G/通用格式")&"角整",TEXT(INT(B10*10),"[DBNum2]G/通用格式")&"角"&TEXT(INT(B10*100)-INT(B10*10)*10,"[DBNum2]G/通用格式")&"分")),TEXT(INT(B10),"[DBNum2]G/通用格式"&"元")&IF((INT(B10*10)-INT(B10)*10)=0,IF((INT(B10*100)-INT(B10*10)*10)=0,"","零"),IF((INT(B10*0.1)-INT(B10)*0.1)=0,"零","")&TEXT(INT(B10*10)-INT(B10)*10,"[DBNum2]G/通用格式")&"角")&IF((INT(B10*100)-INT(B10*10)*10)=0,"整",TEXT(INT(B10*100)-INT(B10*10)*10,"[DBNum2]G/通用格式")&"分"))”。
excel金额大小写转换函数
excel金额大小写转换函数
Excel中有一个非常有用的函数,可以将数字金额转换为中文大写金额,这个函数就是“大写金额”函数。
该函数可以让你在Excel 中快速地将数字金额转换为大写的中文金额,并可以自动将结果显示在相应的单元格中。
使用该函数非常简单,只需要在需要转换的单元格中输入函数,然后按下回车键即可。
大写金额函数的基本语法如下:
=大写金额(数字)
其中“数字”参数是需要转换的金额,可以是一个单元格引用或直接输入的数值。
例如,如果要将1000元转换为大写金额,可以在单元格中输入以下公式:
=大写金额(1000)
Excel会自动计算并显示结果“壹仟元整”。
此外,大写金额函数还支持自定义数字和货币单位的方式,可以根据需要进行相应的设置。
例如,可以使用以下公式将数字和货币单位分别设置为单元格A1和B1中的值:
=大写金额(A1,B1)
这样就可以根据需要将转换结果显示为“一千美元整”或“壹仟元整”等。
总之,大写金额函数是Excel中非常实用的一个功能,可以帮助你快速、准确地将数字金额转换为中文大写金额,提高工作效率。
- 1 -。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Excel自动转换数字大小写具体的操作步骤如下:
1. 启动excel。
按“alt+f11”快捷键打开“visual basic编辑器”。
2. 在“visual basic编辑器”中,单击“插入”菜单栏中的“模块”命令,插入一个模块。
双击左侧“工程”窗口中的“模块1”选项,在窗口右边展开“模块1(代码)”编辑窗口,然后输入如下代码:
function dx(q)
dim cur as long,yuan as long
dim jiao as integer,fen as integer
dim cnyuan as string, cnjiao as string, cnfen as string
if q = "" then
dx = 0
exit function
end if
cur = round(q * 100)
yuan = int(cur / 100)
jiao = int(cur / 10) - yuan * 10
fen = cur - yuan * 100 - jiao * 10
cnyuan = application.worksheetfunction.text(yuan, "[dbnum2]") cnjiao = application.worksheetfunction.text(jiao, "[dbnum2]") cnfen = application.worksheetfunction.text(fen, "[dbnum2]")
dx = cnyuan & "元" & "整"
d1 = cnyuan & "元"
if fen <> 0 and jiao <> 0 then
dx = d1 & cnjiao & "角" & cnfen & "分"
if yuan = 0 then
dx = cnjiao & "角" & cnfen & "分"
end if
end if
if fen = 0 and jiao <> 0 then
dx = d1 & cnjiao & "角" & "整"
if yuan = 0 then
dx = cnjiao & "角" & "整"
end if
end if
if fen <> 0 and jiao = 0 then
dx = d1 & cnjiao & cnfen & "分"
if yuan = 0 then
dx = cnfen & "分"
end if
end if
end function
输入完成后,关闭“visual basic编辑器”返回工作表。
现在,我们可测试一下这个函数。
首先,在a1单元格中输入一个小写数字的金额,例如123456.78,然后,在a2单元格中输入公式:=dx(a1),确认后即可将a1所表示的小写数字金额转换为大写的数字金额,并在a2单元格中显示出来。
怎么样,方便吧?。