This article brings you relevant knowledge about excel, which mainly introduces related issues about the text function. The TEXT function is one of the most frequently used text functions. Let’s talk about it together. Let’s take a look at the common uses of this function. I hope it will be helpful to everyone.
Related learning recommendations: excel tutorial
The TEXT function is one of the most frequently used text functions. She has only two Parameters, parameter 1 is the number to be processed, parameter 2 is used to specify the format code, which is basically the same as most of the codes in cell number format.
Next, let’s take a look at the common uses of the TEXT function:
1. Simple conditional judgment
The following figure shows part of the employee evaluation form of a certain unit. It needs to be evaluated based on the assessment scores. A score of 85 or above is considered good, a score of 76 to 85 is considered qualified, and a score of 75 or less is considered unqualified.
Enter the following formula in cell C2 and copy it down.
=TEXT(B2,"[>85]Good;[>75]Qualified; Unqualified")
The formula used is Three-section format code containing custom conditions. The usage of format codes is almost exactly the same as custom formats.
2. Connect formatted content
As shown in the figure below, you need to connect the name in column A and the date of birth in column B.
Enter the following formula in cell C2 and copy it down.
=A2&TEXT(B2," y year m month d day")
First use the TEXT function to change the date in column B into a specific style string, and then concatenate it with the name in column A, it becomes the final required style.
3. Convert date format
As shown in the figure below, the date format in column B needs to be converted into the month in Chinese format.
Enter the following formula in cell C2 and copy it down.
=TEXT(B2,"[DBnum1]m month")
The format code "m" is used to extract the month in cell B2, and then Use the format code [DBnum1] to convert it to Chinese lowercase number format.
4. Rounded interval hours
Calculate the hours interval between two times, and discard the part that is less than one hour.
Enter the following formula in cell D2 and copy it down:
=TEXT(C2-B2,"[h]")
Use [h] in the format code , represents the hour after rounding.
5. Extract the date of birth
As shown in the figure below, the date of birth must be extracted based on the ID number in column B.
Enter the following formula in cell C2 and copy it down:
=--TEXT(MID(B2,7,8),"0-00-00")
The MID function is used to extract a specific number of strings starting from a specified position in the string.
MID(B2,7,8) starts from the 7th digit of cell B2 and extracts 8 digits. The result is:
20020718
Then use the TEXT function , change this string into the pattern of "0-00-00", and the result is "2002-07-18".
At this time, the date already looks like it, but it is still text type, so two negative signs are added, which is to calculate the negative number of the negative number. After such a toss, it becomes a real date. Sequenced.
6. Simplified formula judgment
As shown in the figure below, the difference in changes must be judged based on the two years of data in columns B~C.
Enter the following formula in cell D2:
=TEXT(C2-B2,"0 yuan more than the previous year; 0 yuan less than the previous year; the same as the previous year")
The second parameter of the TEXT function uses "0 yuan more than the previous year; 0 yuan less than the previous year; the same as the previous year", which means:
If C2-B2 If the result is greater than 0, it shows "n yuan more than the previous year."
If the result of C2-B2 is less than 0, it will display "n yuan less than the previous year".
If the result of C2-B2 is equal to 0, it will display "Same as the previous year".
The 0 in the TEXT function format code has a special meaning, usually indicating the value of the first parameter itself.
7. Quickly extract characters
As shown in the figure below, all numbers before the minus sign must be extracted based on the numbers in column A.
Enter the following formula in cell B2 and copy it down:
=TEXT(,"[$"&A2&"]")
If you think this formula is still too long, you can try the following formula:
=IMREAL(A2&"i")
Related learning recommendations: excel tutorial
The above is the detailed content of How to use Excel's TEXT function?. For more information, please follow other related articles on the PHP Chinese website!

本篇文章给大家带来了关于excel的相关知识,其中主要介绍了关于折叠表格的相关问题,就是分类汇总的功能,这样查看数据会非常的方便,下面一起来看一下,希望对大家有帮助。

在之前的文章《实用Excel技巧分享:利用 数据透视表 来汇总业绩》中,我们学习了下Excel数据透视表,了解了利用数据透视表来汇总业绩的方法。而今天我们来聊聊怎么计算时间差(年数差、月数差、周数差),希望对大家有所帮助!

本篇文章给大家带来了关于excel的相关知识,其中主要介绍了关于AGGREGATE函数的相关内容,该函数用法与SUBTOTAL函数类似,但在功能上比SUBTOTAL函数更加强大,下面一起来看一下,希望对大家有帮助。

在之前的文章《实用Word技巧分享:聊聊你没用过的“行号”功能》中,我们了解了Word中你肯定没用过的"行号”功能。今天继续实用Word技巧分享,看看Excel表格怎么借用Word进行分栏打印,快来收藏使用吧!

本篇文章给大家带来了关于excel的相关知识,其中主要介绍了关于zenmm制作倒计时牌的相关内容,使用Excel中的日期函数结合按指定时间刷新的VBA代码,即可制作出倒计时牌,下面一起来看一下,希望对大家有帮助。

在之前的文章《实用Excel技巧分享:原来“定位功能”这么有用!》中,我们了解了定位功能的妙用。而今天我们聊聊合并后的单元格如何实现筛选功能,分享一种复制粘贴和方法解决这个问题,另外还会给大家分享一种合并单元格的不错的替代方式。

本篇文章给大家带来了关于excel的相关知识,其中主要介绍了关于如何使用函数寻找总和为某个值的组合的问题,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于Excel的相关知识,其中主要介绍了关于XLOOKUP函数的相关知识,包括了常规查询、逆向查询、返回多列、自动除错以及近似查找等内容,下面一起来看一下,希望对大家有帮助。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
