ComeçarComece de graça

Extract brand campaign names using REGEXEXTRACT()

After some discussions with the social media marketing team, the digital marketing director decided to simply remove the terms Brand or Branded from each of the campaign names.

This is where you come in. You know how to replace using regex but, this time, you will be using REGEXEXTRACT() to pull all the characters not equal to Brand. For example, after the extraction, DataCamp Brand will become DataCamp.

To perform this extraction, you will need to write a new regular expression. As an example, the regex (.*).Expressions extracts any number of characters preceding the text and period, (i.e. Regular would be extracted from Regular Expressions).

Este exercício faz parte do curso

Marketing Analytics in Google Sheets

Ver curso

Instruções do exercício

  • A regular expression in cell I2 that will match any branded campaign (i.e. containing Brand) is already written for you in cell I2.
  • In cell I3, write another regular expression to extract the group of characters not equal to Brand. Refer to the example above for a starting point!
  • Modify the current IF() statement in cell F2 by replacing the second argument, "REGEXEXTRACT", with a REGEXEXTRACT() function.
    • The function should contain two arguments: the input text (in this case, B2), and the cell of your extract pattern.
  • Apply the formula to the remainder of the cells, F3:F29. Make sure that your pattern (I3) is an absolute reference!

Exercício interativo prático

Transforme a teoria em ação com um de nossos exercícios interativos

Começar o exercício