Excel common text cleaning function

1.=LEFT(text,[num_chars])

RIGHT function having similar functions

例如选出K列中,从左数前一个字符:= LEFT(k2,1)

2.=FIND(find_text,within_text,[start_num])

If the length of the data to be extracted inconsistent, using only LEFT function can not be solved, for example, you want to get in front of the numbers k

You can first use the FIND function, where k derive position and then reuse function LEFT

使用FIND函数在T列得到"k"的位置:=FIND("k",S2,1)
使用结合得到的"k"的位置,LEFT函数:=LEFT(S2,T2-1)
由于不包含"k",所有使用T2-1
如果有些是"K"(大写),有些是"k"(小写),可以先进行替换
此外替换还具有删除的功能,在“替换为”中输入空

3.=CONCATENATE(text1[,text2],[text3])

Text (or text in a few cells) splicing

对上面的得到的U列中的每个数字后加上''元'':=CONCATENATE(U2,"元")
可以使用:=U2&"元"

4.=REPLACE(old_text,start_num,num_chars,new_text)

Text Replacement

将“宠物”改为“生活”:=REPLACE(U13,1,2,"生活")

5.=SUBSTITUTE(text,old_text,new_text,[instance_num])

将S列中的ABC删除掉:可以先使用:=RIGHT(s2,3) (手动输入ABC也行)得到其中要替换的字符(old_text)
=SUBSTITUTE(S2,T2,"")

6.=TRIM(text)

Go to the ends of the space character

7 = LEN (text)

Get the character length

8.=MID(text,start_num,num_chars)

Taken intermediate string literals

For example: in FIG taken S column numbers (numbers are in front of the first character "B")

1.先获取“B”的位置:=FIND("B",S2,1)
2.获取“C”的位置(等于文本长度):=LEN(S2)
3.使用MID函数:=MID(S2,T2+1,U2-T2-1)

Guess you like

Origin www.cnblogs.com/notfind/p/11613115.html