IF函数 =IF(B190,NUMBERSTING(B19,2)& "元“,”“)&IF(AND(D19=0,F19=0),"",IF(B190,IF(D190,NUMBERSTRING(D19,2)&"角”,“零”),IF(D190,NUMBERSTRING(D19,2)&"角“,”“)))&IF(F190,NUMBERSTRING(F19,2)&"分”,IF(AND(B19=0,D19=0),""
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 11:55:35
IF函数 =IF(B190,NUMBERSTING(B19,2)& "元“,”“)&IF(AND(D19=0,F19=0),"",IF(B190,IF(D190,NUMBERSTRING(D19,2)&"角”,“零”),IF(D190,NUMBERSTRING(D19,2)&"角“,”“)))&IF(F190,NUMBERSTRING(F19,2)&"分”,IF(AND(B19=0,D19=0),""
IF函数
=IF(B190,NUMBERSTING(B19,2)& "元“,”“)&IF(AND(D19=0,F19=0),"",IF(B190,IF(D190,NUMBERSTRING(D19,2)&"角”,“零”),IF(D190,NUMBERSTRING(D19,2)&"角“,”“)))&IF(F190,NUMBERSTRING(F19,2)&"分”,IF(AND(B19=0,D19=0),"","整))“
IF函数 =IF(B190,NUMBERSTING(B19,2)& "元“,”“)&IF(AND(D19=0,F19=0),"",IF(B190,IF(D190,NUMBERSTRING(D19,2)&"角”,“零”),IF(D190,NUMBERSTRING(D19,2)&"角“,”“)))&IF(F190,NUMBERSTRING(F19,2)&"分”,IF(AND(B19=0,D19=0),""
第一部分
IF(B190,NUMBERSTING(B19,2)& "元“,”“)
B19等于0,返回B19数字的中文大写&“元”(比如B19是12,返回拾贰元),否则返回“”.
第二部分
IF(AND(D19=0,F19=0),"",IF(B190,IF(D190,NUMBERSTRING(D19,2)&"角”,“零”),IF(D190,NUMBERSTRING(D19,2)&"角“,”“)))
拆分来看,如果D19,F19都等于零,返回“”.否则返回IF(B190,IF(D190,NUMBERSTRING(D19,2)&"角”,“零”),IF(D190,NUMBERSTRING(D19,2)&"角“,”“))的结果.这段代码的意思是如果B19不等于零,返回IF(D190,NUMBERSTRING(D19,2)&"角”,“零”)的结果,否则返回IF(D190,NUMBERSTRING(D19,2)&"角“,”“))的结果.
第三部分
IF(F190,NUMBERSTRING(F19,2)&"分”,IF(AND(B19=0,D19=0),"","整))
如果F19不等于0,返回F19数字中文大写+分,否则返回“整”.
这个就是根据单元格的值判断一下把对应的数字转换成中问大写.在加上元角分,没有角分的情况,显示**元整.