Level 3REGEXPractice, 4 min

REGEXEXTRACT: pull the campaign out of a URL

The task

In B2, pull the utm_campaign value out of every landing page URL with one formula. Some URLs have no campaign tag; show (none) for those.

The data

The starting sheet. Cells outlined in green are where your formulas go.

AB
1Landing pageCampaign
2https://shop.example.com/boots?utm_source=google&utm_medium=cpc&utm_campaign=fall_boots
3https://shop.example.com/?utm_campaign=brand_search&utm_source=google
4https://shop.example.com/sale?utm_source=meta&utm_campaign=bf_preview&utm_content=video
5https://shop.example.com/socks
6https://shop.example.com/boots?utm_campaign=fall_boots&gclid=abc123
7https://shop.example.com/?utm_source=newsletter&utm_campaign=weekly_42