ComeçarComece de graça

Create campaign IDs using REGEXEXTRACT()

After much thought, and testing different naming conventions, the digital marketing director and the social media team have finally settled on a naming convention. They have decided to simply create campaign IDs.

These IDs will contain information about the source and campaign. For instance, the test IDs you create will be in the following format: the first letter from the Source, followed by an underscore, then the full Campaign Name. For example, the campaign ID for the source Yahoo with a campaign Spreadsheets would be: Y_Spreadsheets.

Recall that a begin anchor is ^. For example, ^f will match the f in flying. However, in this exercise you will need to be able to match the first letter from any word.

Este exercício faz parte do curso

Marketing Analytics in Google Sheets

Ver curso

Instruções do exercício

  • In cell I2, write a regular expression that will extract only the first character in a string.
  • In cell F2, write a formula to create the new test IDs:
    • Use REGEXEXTRACT() to pull the first letter from cell A2 using your pattern in I2 (as an absolute reference).
    • In the same cell, use t& characters to add a "_" and the campaign name (in cell B2).
  • Apply this formula to the remainder of the cells in the column, F3:F29.

Exercício interativo prático

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

Começar o exercício