Back to Snowflake Basic in Excel
SheetXAI logo
Snowflake Basic logo
Snowflake Basic · Excel Guide

Run a Cohort Retention Analysis in Snowflake and Import the Matrix Into an Excel workbook

2026-05-14
5 min read

The Scenario

Investor pitch is in two weeks. One of the slides is a cohort retention table — signup cohorts as rows, months-since-signup as columns, percentage of users who were still active. Your head of growth built this in Snowflake six months ago. The query exists. Nobody has refreshed the output since February.

You're the growth analyst who owns the slide deck. You need the full 12-month retention matrix in an Excel workbook, formatted correctly, ready for the deck.

The bad version:

  • Find the saved query in Snowflake worksheets, figure out which one is the current version (there are four with similar names), run it, and wait for the 2-minute query to complete.
  • Export the result as a CSV, import it into Excel, fix the date columns that came in wrong, and transpose the output because the CSV came out with months as rows and you need cohorts as rows.
  • Recheck that the percentages are formatted as percentages and not decimals, manually add the M1–M12 column headers, and discover the row for the March cohort is missing because the query had a filter bug you didn't notice.

The matrix itself is not complex. Getting it into the workbook cleanly is where the time goes.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Excel workbook. It can run complex Snowflake SQL — including cohort window functions and CTEs — and write the full matrix into the workbook with the right orientation and headers.

Paste this into the SheetXAI sidebar:

Run a Snowflake cohort retention query in database PROD schema ANALYTICS that groups users by signup month (last 12 months) and calculates what percentage were active in each of months 1–12 after signup — write the full matrix into this sheet with cohort months as rows and M1–M12 as column headers

What You Get

  • Row 1 with headers: cohort_month, M1, M2, … M12
  • One row per signup cohort (the 12 most recent months), identified by the cohort month in column A
  • Retention percentages as decimal values (e.g., 0.72 for 72%) or formatted as percentages depending on your workbook's column format
  • Cells where the cohort hasn't reached that month yet left blank, not zero
  • Any SQL error from Snowflake returned in cell A1 so you see it immediately

What If the Data Is Not Quite Ready

The percentages need to be rounded and shown as whole numbers

Run the 12-month cohort retention query in Snowflake PROD.ANALYTICS, round all percentages to the nearest whole number (e.g., 72 not 0.72), and write the matrix into this sheet with cohort_month in column A and M1–M12 in columns B–M with headers in row 1

The query needs to filter to a specific product line

Run a cohort retention query in Snowflake PROD.ANALYTICS that filters to users whose plan_type = 'PRO' — group by signup month for the last 12 months, calculate M1–M12 retention, and write the full matrix into the Retention-Pro worksheet starting at A1 with headers

You need revenue retention instead of user retention

Query Snowflake database PROD schema PUBLIC to build a revenue retention cohort table: group customers by first purchase month for all of 2025 and calculate the percentage who made a repeat purchase in each subsequent month — write the matrix into the Revenue Retention worksheet with cohort months as rows and M1–M12 as columns

You need the full retention matrix, a summary row with averages per month, and annotations for months with below-30% retention — all in one pass

Run the 12-month user cohort retention query in Snowflake PROD.ANALYTICS — write the full matrix into this sheet with cohort_month in column A and M1–M12 in columns B–M, then add an AVERAGE row at the bottom with the mean retention for each month, and flag any individual cell below 30% by adding an asterisk (*) after the value

The full analysis, the summary row, and the annotations — one prompt handles all three.

Try It

Get the 7-day free trial of SheetXAI and open the Excel workbook where your investor retention slide output lives, then ask it to run the cohort query and write the full 12-month matrix into the workbook. You can also explore running an analytical SQL query or return to the Snowflake overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more