excel中如何将一列中含有某些特定的符号的词组筛选出来,并放到某一列去 20
“excel中将一列中含有某些特定的符号的词组筛选出来,并放到某一列去”的操作步骤是:
1、打开Excel工作表;
2、由题意可知,在A列中,将包含"GX"的字段提取出来,放到对应的B列,而A列的字符串中存在着空格,可通过查找“GX”前存在多少空格,并将空格替换为100空格,然后取对应空格后数的方式进行;
3、在B2单元格输入以下公式,然后向下填充公式
=IFERROR(TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",100)),(LEN(LEFT(A2,FIND("GX",A2)))-LEN(SUBSTITUTE(LEFT(A2,FIND("GX",A2))," ","")))*100,100)),"")
公式中:
SUBSTITUTE(A2," ",REPT(" ",100))实现将A2中的一个空格替换为100个空格;
LEN(LEFT(A2,FIND("GX",A2)))返回A2单元格中GX前的字符个数;
LEN(SUBSTITUTE(LEFT(A2,FIND("GX",A2))," ","")返回A2单元格中将GX前的空格替换为无时的字符个数;
LEN(LEFT(A2,FIND("GX",A2)))-LEN(SUBSTITUTE(LEFT(A2,FIND("GX",A2))," ",""))得到“GX”前的空格个数;
MID(SUBSTITUTE(A2," ",REPT(" ",100)),(LEN(LEFT(A2,FIND("GX",A2)))-LEN(SUBSTITUTE(LEFT(A2,FIND("GX",A2))," ","")))*100,100)表示:将A2单元格的一个空格替换为100个空格后,从GX前的空格个数乘以100字符位置起,截取100个字符;
TRIM将截取的字符前后无效的空格替换为空;
IFERROR将不包含“GX”的单元格返回的错误值以空格显示。
=IF(COUNTIF(F1,"*GX*")=1,F:F,"")