[英]Extract String Beetwen 2 Character in Excel
I want the string in column A to be extracted to each column, where the position of the string taken between "d /" and "/ search".我希望将 A 列中的字符串提取到每一列,其中字符串的位置在“d /”和“/search”之间。
Based on the formula I made, it only extracts it in one column.根据我制作的公式,它只在一列中提取它。
In Cell B2, you already have the formula as:在单元格 B2 中,您已经有了如下公式:
=MID(A2,FIND("d/",A2)+2,FIND("/search",A2)-FIND("d/",A2)-2)
You are really close, you only needed to add the starting position as an argument for the following formulas, so it will start searching after the previously found string as below.您真的很接近,您只需要添加起始位置作为以下公式的参数,因此它将在先前找到的字符串之后开始搜索,如下所示。
In C2 add the following:在 C2 中添加以下内容:
=MID(A2,FIND("d/",A2,FIND(B2,A2))+2,FIND("/search",A2)-FIND("d/",A2)-2)
And in D2 the following:在 D2 中:
=MID(A2,FIND("d/",A2,FIND(C2,A2))+2,FIND("/search",A2)-FIND("d/",A2)-2)
If you have Office 365 Excel it can be done with one formula:如果您有 Office 365 Excel,则可以使用一个公式完成:
=CONCAT(IF(TRIM(MID(SUBSTITUTE(SUBSTITUTE($A2,"d/","|/",COLUMN(A:A)),"/",REPT(" ",99)),ROW($1:$100)*99,99))="|",TRIM(MID(SUBSTITUTE($A2,"/",REPT(" ",99)),ROW($2:$101)*99,99)),""))
this is an array formula, it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.这是一个数组公式,退出编辑模式时需要使用 Ctrl-Shift-Enter 而不是 Enter 确认。
Another way, Try this.另一种方法,试试这个。
Apply the below formula in Cell B2在单元格 B2 中应用以下公式
=TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," ")," ",REPT(" ",LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," ")))), (2-1)*LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," "))+1, LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," "))))&", "&TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," ")," ",REPT(" ",LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," ")))), (4-1)*LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," "))+1, LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," "))))&", "&TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," ")," ",REPT(" ",LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," ")))), (6-1)*LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," "))+1, LEN(SUBSTITUTE(SUBSTITUTE(A2,"d/"," "),"/search?"," "))))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.