EXCEL TIPS From Webs

Extract the string B starting from "." from the A string, you can use the find function to locate the first occurrence of ".", which is similar to the indexOf function in various languages, and find searches from left to right, There is no right-to-left search in EXCEL, similar to the lastIndexOf function.
If you want to cut characters from right to left in EXCEL, you can use the formula =TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",LEN( A1))), LEN(A1))).
Example: A1=http://www.163.com/sports/Arsenal.html is known
to get the Arsenal.html string.
Formula=TRIM(RIGHT(SUBSTITUTE(A1) ,"/",REPT(" ",LEN(A1))),LEN(A1))).
Explanation:
1.REPT(" ",LEN(A1)) means to get a space string with the length of A1 Length.
The REPT function can repeat the actual text according to the defined number of times, which is equivalent to copying the text.
2.SUBSTITUTE(A1,"/",REPT(" ",LEN(A1)))
uses the character "/" in A1 to use multiple A space string (obtained in step 1) is replaced. At this time, the available text is:
http: www.163.com sports Arsenal.html


The SUBSTITUTE(text, old_text, new_text, instance_num)
function replaces old_text with new_text in the text string.
3. After replacing all separators with the specified space string, you can use the Right function to take substrings from right to left. That is
=RIGHT(SUBSTITUTE(A2,"/",REPT(" ",LEN(A2))),LEN(A2))
The string obtained at this time is such as:
                         Arsenal.html
4. Finally, use the Trim function to delete the spaces, you can Get the result: Arsenal.html
=TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",LEN(A2))),LEN(A2)))

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325482926&siteId=291194637