Formula Library

Excel Formula To Extract Query Param Ref From Url In Crm Export Text

Extract query parameter ref from URLs in crm export text with a ready-to-use formula for Excel, Google Sheets, and WPS.

Quick answer

Extract query param ref from url in crm export text.

Unified formula

ExcelWPS
=LET(q,IFERROR(TEXTAFTER(A2,"?"),""),pairs,TEXTSPLIT(q,"&"),m,FILTER(pairs,LEFT(pairs,LEN("ref="))="ref="),IFERROR(TEXTAFTER(INDEX(m,1),"="),""))
View platform differences

Google Sheets

=IFERROR(REGEXEXTRACT(A2, "(?:[?&])ref=([^&#]+)"), "")

How it works

Need a custom version?

Related formulas