Как извлечь параметр в URL в Excel?

1286
Nick R

У меня есть следующий URL в моих строках листа Excel:

www.test.com/folder1/?tagid=1234567

Как извлечь значение tagid в отдельный столбец, чтобы у меня просто было «1234567».

Спасибо!

1

2 ответа на вопрос

2
Mr. Smythe

It is probably not the cleanest solution, but it works:

=RIGHT(A1, LEN(A1)-FIND("tagid=",A1)-LEN("tagid=")+1) 
1
kevininspace

I like to use the MID function because I can then modify the last parameter (length) in case my strings change in the future.

=MID(A1,SEARCH("=",A1)+1,999) 

It looks for the equal sign, then takes 999 characters to the right of that.

In the future, if you add another parameter (e.g. ?tagid=1234567&userid=5555), you can simply replace the "999" for a second search condition.

Похожие вопросы