0

I am trying to pass the value of a URL parameter into a cell in Google Sheets - e.g: https://docs.google.com/spreadsheets/d/3dfedsfc--sdfwefwefewe/edit#gid=29034359&team=frogs

I would like to get the value of the teams parameter and have it outputted into a cell on the sheet. Is there any way of doing this please?

1
  • Welcome to Web Applications. Google Sheets doesn't include a way to do this. If you need further help, please show what you tried and add a brief description of your search efforts as is suggested in How to Ask.
    – Rubén
    Oct 11 at 15:00
0

Applying the answer by @NickReed in How to Extract a Custom URL Parameter in Google Data Studio? on StackOverflow.

I am pretty sure that this can be further simplified, but it at least answers the specific question.

=regexextract(A1, "&team=([^\s&]*)")


screenshot


In the event that you have a column of URLs and you want to apply the formula to every instance. You could use the answer by @JPV to Regex to extract particular query parameter value from URL in Google Sheets, also on StackOverflow.

=Arrayformula(if(len(A3:A), regexextract(A3:A, "&team=([^\s&]*)"),))

arrayformula

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.