If we see the structure of URL we see that along with the domain name there are some other metrics associated in it.To do some analysis e.g. get the domain name from the URL, we have to extract it just before the question mark in excel.
Let’s see how we could extract the URL part before the question mark “?” character in excel.
We will see a simple formula to extract the URL using some text functions in excel.
Below is the data which has the entire URL of a given page and we are interested in extracting only the URL part before the question mark as shown in column B.
Enter the formula below in cell B2
=IF(LEN(SUBSTITUTE(A2,”?”,””))=LEN(A2),A2,LEFT(A2,FIND(“?”,A2)-1))
Now drag the formula till where your data is available in column A.
Hope this helped.