Get startedGet started for free

Aggregate campaign cost using REGEXMATCH

The digital marketing director was so impressed with the speed at which you got the filtered campaigns to them that they decided to give you another task. This time, they are asking on behalf of the client for a quick rundown of the total spend for both the DataCamp Brand and Python Brand campaign.

Once again, FILTER() combined with REGEXMATCH() is the answer, but not the full answer. In this exercise, you will need to also apply a SUM() function in order to aggregate the total spend (Cost) of the two campaigns of interest.

This exercise is part of the course

Marketing Analytics in Google Sheets

View Course

Exercise instructions

  • Add a regular expression in cell H4 that will match the respective campaign listed in the cell G4 (i.e. Python campaigns).
  • In cell I4, write a filter for the Cost column, with the condition for the filter using the regex in cell H4. Don't forget to use REGEXMATCH()!
  • Wrap the filter with a SUM() to find the total cost for the DataCamp Brand campaign.

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise