The specific method of using Excel's replace function to sensitize people's names

王林
Release: 2024-04-25 11:50:18
forward
926 people have browsed it

In daily operations, we often need to process Excel data containing personal information, in which name information needs to be sensitized. PHP editor Xigua today will introduce a simple method using the Excel replace function to help you easily replace name information with anonymous characters.

1. Organize the original excel list information, such as name information or bank card number information.

The specific method of using Excels replace function to sensitize peoples names

2. Our requirement is to process the name column in excel so that only the first character of the name is retained, and all subsequent names are replaced with *, so in C2 Enter =REPLACE(B19,2,2,"**") in the cell, and the replacement result displays Li**. Double-click the lower right corner of C2 and all values in column B will be replaced.

The specific method of using Excels replace function to sensitize peoples namesThe specific method of using Excels replace function to sensitize peoples names

#3. If you don’t want to display ** when the name has two characters, you can simply optimize the function and simply distinguish between three characters and two characters. . =IF(LEN(B2)=3,REPLACE(B2,2,2,"**"),REPLACE(B2,2,1,"*")).

The specific method of using Excels replace function to sensitize peoples namesThe specific method of using Excels replace function to sensitize peoples names

4. At this point, my needs are perfectly solved through the replace function. In addition, the usage of the replace function is as follows:

REPLACE(parameter 1, parameter 2, parameter 3 ,Parameter 4)

Parameter 1 is the text whose characters are to be replaced.

Parameter 2 is the starting position of the characters in parameter 1 to be replaced with parameter 4.

Parameter 3 is the character that REPLACE wants REPLACE to use parameter 4 to replace the characters in parameter 1 starting from parameter 2 number.

Parameter 4 is the text to be used to replace the characters in parameter 1.

For example: =REPLACE(A3,3,2,"zifu") Use zifu to replace the 2 characters starting from the 3rd digit of A3.

The above is the detailed content of The specific method of using Excel's replace function to sensitize people's names. For more information, please follow other related articles on the PHP Chinese website!

source:zol.com.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!