开始使用免费开始使用

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.

本练习是课程的一部分

在 Google Sheets 中进行营销分析

查看课程

练习说明

  • 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.

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习