SheetMagicSheetMagic

Time Content to Search Peaks with Google Trends in Sheets

Type =GTRENDS("coffee") to pull Google Trends interest over time into Google Sheets, so you can publish and plan stock before demand peaks instead of after. =GTRENDING("US") shows what is trending now. The function reference lists 3 scraping credits per call.

Phil Nguyen · 6 min read

To get Google Trends data into Google Sheets, type =GTRENDS("coffee") in a cell and SheetMagic writes a Google Trends interest-over-time table with SearchTerm, Date and Value columns into a results tab in your sheet. Seeing when interest in a topic rises each year lets you publish and promote before the peak instead of after it, and =GTRENDING("US") shows what is trending in a country right now.

Say you plan content and promotions for an online coffee shop and track 20 topics. On the Google Trends site, that is one search, one CSV download and one paste per term. If each one takes you about 2 minutes (an example figure, not a measurement), that is 40 minutes every time you refresh, and the numbers still sit in 20 separate files.

=GTRENDS("coffee")
=GTRENDING("US")

Both are SheetMagic custom functions, so the numbers land in cells you can chart, filter and compare, without downloading a CSV from the Google Trends site for every term.

What does =GTRENDS() return?

=GTRENDS() returns the interest-over-time timeline for one search term. Each row is one date with a relative interest value on a 0 to 100 scale across the date range and country you picked.

ColumnWhat it holds
SearchTermThe term you asked about
DateThe date of the data point
ValueRelative interest, 0 to 100

How do I change the country and time range in GTRENDS?

The full syntax is:

=GTRENDS(searchTerm, [geo], [date], [category])
  • geo: a two-letter uppercase country code such as "US" or "GB". Leave it blank for worldwide data.
  • date: one of "now 1-H", "today 1-m", "today 3-m", "today 12-m" or "today 5-y". If you leave it out, the last 3 months ("today 3-m") is used.
  • category: an optional Google Trends category ID. Common values are 3 for Arts, 5 for Computers, 7 for Finance, 20 for Sports, 71 for Food and 174 for Science. Leave it out, or use 0, for all categories.

For example, US interest in "cold brew" over the last 12 months:

=GTRENDS("cold brew", "US", "today 12-m")

=GTRENDS() takes one term per call, so compare terms by giving each one its own formula. Put your terms in column A, then in B2 enter this and drag it down:

=GTRENDS(A2, "US", "today 12-m")

The rows land in a tab named Google Trends Results, and drag-filled copies of the same formula share that tab. Column A (Source) names the cell that asked for each row and column B holds the SearchTerm, so you can filter the tab to one term at a time. Keep the same geo and date for every term so the dates line up, then chart each term's Value line. Each call scales its own timeline from 0 to 100, so compare the shape and timing of each line rather than reading the raw values as one shared scale.

Use =GTRENDING() for the currently trending searches in a country:

=GTRENDING(geo, [hours], [category], [sort])
  • geo is required: a two-letter uppercase country code such as "US" or "GB".
  • hours sets the look-back window: 4, 24 (the default), 48 or 168.
  • category is an optional Google Trends category ID filter.
  • sort is "relevance" (the default), "search_volume", "recency" or "title".

The table has these columns: Title, SearchVolume, GrowthPercent, Status, StartedAt, EndedAt, RelatedQueries, Categories and TrendURL. For the biggest searches of the past week in the UK:

=GTRENDING("GB", 168, , "search_volume")

Why does the cell say it is scraping first?

Trends functions run in the background. The cell shows "⏳ Scraping..." while a worker makes the Google Trends request, and then the rows are written to a results tab (Google Trends Results for =GTRENDS()). With Keep Formula on, which is the default, the cell then keeps your formula frozen as text; with Keep Formula off, it changes to a status such as ✅ N results → Google Trends Results.

The function reference lists 3 scraping credits per call for both =GTRENDS() and =GTRENDING(). Treat that as the estimate: the actual deduction is worked out from the request cost scrape.do reports for that call, and a request scrape.do does not charge for costs you nothing.

The Free plan comes with 100 scraping credits, and Solo includes 10,000 scraping credits a month. Scraping functions run for any account with an active SheetMagic license. See AI tokens vs scraping credits for how scraping credits and AI tokens are counted.

  • Publish before the peak, not after it. Five years of =GTRENDS() data per topic shows which months interest climbs. Schedule posts and emails a few weeks ahead so they are live when people search, instead of finding the peak in your analytics once it has passed. The workflow below builds this calendar.
  • Plan stock and spend for the busy months. The same peak months tell you when to order more of a seasonal product and when to put ad budget behind it, so you are not out of stock or paying for clicks in a quiet month.
  • Drop topics that are fading. Compare the shape of each term's five-year line. A topic that falls year after year is a weaker bet for a new article than one that keeps rising.
  • Catch a trend the day it starts. =GTRENDING("US", 24, , "search_volume") lists the biggest searches of the last 24 hours, so you can spot a topic that fits your audience while it is still rising.

For the 20-topic example above, 20 =GTRENDS() formulas are 20 calls, or 60 scraping credits at the 3 credits per call the function reference lists, and refreshing them is re-entering the formulas instead of 40 minutes of downloads.

  1. List your topics in column A, one per row.
  2. In B2, enter =GTRENDS(A2, "US", "today 5-y") and drag it down to get five years of interest for every topic in the Google Trends Results tab.
  3. Summarize the peaks with AI. Point =AITEXT() at one topic's Date and Value columns (C and D in the results tab), for example in C2 of your topic sheet:
=AITEXT("Which months does interest peak in? Answer with month names only.", FILTER('Google Trends Results'!C2:D, 'Google Trends Results'!B2:B=A2))

The range you pass as context is joined into text and added to your prompt, so the AI reads the whole timeline. Use the answers to schedule posts a few weeks before each peak. For more ideas, see SEO workflows, data analysis in Google Sheets, AI SEO in Google Sheets and SERP scraping. The web scraping guide covers the rest of SheetMagic's scraping functions.

Questions? Email support@sheetmagic.ai and we will help.

Text and scraping formulas run on the free allowance. Install from the Google Workspace Marketplace, no card, no expiry.

Install free for Google Sheets

About the author

Phil NguyenPhil builds SheetMagic, the Google Sheets add-on that brings AI and web scraping into the spreadsheet, used by 6,300+ people. He writes these guides from the formulas he runs on his own sheets.