当前位置:网站首页>Excel method is commonly used in text function 5
Excel method is commonly used in text function 5
2022-08-08 08:34:00 【The sensible meow~~】
As a data developer, in the process of work, although the database is used in most cases, the operation of Excel is unavoidable.The text() function has powerful functions. I will share more scenes encountered in my work below, enjoy~~
I. Meaning
Excel's text function is to format the content of the selected cell through the format code, and then display it in different display methods. It is a function that converts the content into text
Second, grammar
=TEXT (value, format code)
Parameter definition:
The first parameter value is the selected cell, which is the content that you want to format as text. The content of this cell can be numeric or characterString etc.
The second parameter is the target format you want to format.
III. Common usage scenarios
1, the value display is filled with 0
Format: =TEXT(cell,"000000")
Interpretation: Fill the content of the cell with 0 in front of the six digits, for example, 100 will be formatted as 000100
Extension: If you want to display two digits after the decimal point, the less than 2 digits are filled with 0s, and more than 2 digits are filled with 0.2-digit rounding, the formula is: =TEXT(cell, "00.00").For example, 21 is formatted as 21.00; 15.135 is formatted as 15.14.
2, extract date of birth based on ID number
Format: =TEXT(MID(cell,7,8),"00-00-00")
3, standard three-segment format for phone numbers
Format: =TEXT(cell,"000-0000-0000")
4, convert a numeric date to a specific date format
(1) 00/00/0000
Format: =TEXT(cell, "00/00/0000")
(2) 0000-00-00
Format: =TEXT(cell, "0000-00-00")
(3) full name of the day of the week
Format: =TEXT(TEXT(cell,"0000-00-00"),"aaaa")
(4) Abbreviated day of the week
Format: =TEXT(TEXT(cell,"0000-00-00"),"aaa")
(5) Year of extraction
Format: =TEXT(TEXT(cell, "0000-00-00"), "yyyy")
(6) Month of withdrawal
Format: =TEXT(TEXT(cell,"0000-00-00"),"mm")
(7) Pickup Day
Format: =TEXT(TEXT(cell,"0000-00-00"),"dd")
5, conditional section judgment
Condition section, you can choose the default, two, three, four sections, or can be customized
(1) Default condition section
Three sections are used more often, of course, you can also modify it to other sections according to your needs.
Format: [>0];[<0];[=0]
(2) Custom Condition Section
Format: [Condition 1];[Condition 2];[Other parts that do not meet the condition];[Text]
The above is the common way we use the text function in Excel, I am Meow~~, I hope everyone can communicate and learn together!
边栏推荐
猜你喜欢
图数据科学和机器学习图数据科学GDS概览
goroutine 调度
Techwiz OLED:偏振片的发射特性
Spark2 struct SQL processing
手机APP测试流程规范和方法你知道多少?
lvm creates logical volumes
【回归预测】基于GPML工具箱的高斯过程回归附matlab代码
The industry's first "Causal Inference Whole Process" Challenge!WAIC 2022 · Hackathon invites global developer elites to challenge
攻防世界——web2
你真的了解IP地址吗?
随机推荐
浏览器中输入URL后到底发生了什么?
要写脚本,编程不好不要紧--浅谈CTF中脚本的编写方法
面试官:工作中用过锁么?说说乐观锁和悲观锁的优劣势和使用场景
包含漏洞-读写文件以及执行命令
文献学习(part33)--Clustering by fast search and find of density peaks
ACWing 198. Antiprime Problem Solution
数据智能正当时,九章云极DataCanvas公司荣获“最具投资价值公司”
两个联动的可扩展收起的textView的简单实现
【office】word
golang-channel-一个基础channel并行操作的简单函数
生成密码字典的方法
mysql-cdc 换2.2.x 版本 怎么读不到 数据 咋回事
PhpStudy 2016搭建-DVWA靶场
攻防世界——leaking
【收藏】3. 壁纸收藏
goroutine 调度
Offensive and defensive world - ics-05
网安学习-应急响应2
我的MySQL安装这样了怎么解决也
BLOB, TEXT, GEOMETRY or JSON column ‘xxxx‘ can‘t have a default value