Improve Churn Rate in Google Sheets Without the Prediction API

by Nedim Talovic · Updated

Improve Churn Rate in Google Sheets Without the Prediction API

This tutorial no longer works. It was written in 2016 for the Google Prediction API and its Smart Autofill add-on for Google Sheets. Google shut the Prediction API down on April 30, 2018, and the add-on, which ran on it, went with it. We have replaced the old steps with a way to spot customers at risk in Google Sheets using simple rules, with no prediction service needed.

Predicting future events has never been easier, thanks to machine learning concept. It does predictions based on historical data.

Let’s take a look at sas.com machine learning definition:

“Machine learning is a method of data analysis that automates analytical model building. Using algorithms that iteratively learn from data, machine learning allows computers to find hidden insights without being explicitly programmed where to look.”

Yes, machine learning is behind all these cool stuff we use:

  • Self-driving cars (near future)
  • Recommendation systems you see at Amazon and Netflix
  • Fraud Detection
  • Spam Detection
  • Estimating credit risk
  • Google Translate
  • Upsell opportunities

It finds you patterns that exist in places you would never consider.

You don’t need to do anything. Big shots like Google, Amazon, Microsoft, BigML and others, have invented the algorithms for you. That’s why it’s affordable to anyone.

Basically, your job is to prepare the data and use the API.

What Happened to the Google Prediction API

Google deprecated the Cloud Prediction API and shut it down on April 30, 2018. From May 1, 2018, applications could no longer reach its prediction or training services, and Google pointed users to Cloud Machine Learning Engine instead (Google's end-of-life FAQ, archived copy). The Smart Autofill add-on ran on the same API, so the steps this article used to describe, with the Orange Telecom sample data, can no longer be followed.

You can still build a churn model with today's machine learning services, but it needs clean history, someone to build it and regular upkeep. For most online stores, a few rules on order dates are the better first step: anyone on the team can check them, and they tell you who to contact this week.

How to Spot Customers at Risk in Google Sheets

Customers of an online store rarely cancel anything. They just stop ordering. So instead of predicting a cancellation, measure how late each customer is compared with how your customers usually buy.

Step 1: Export your orders

Most store platforms can export orders as a CSV file. You need three columns: the customer's email, the order date and the order total. Leave out cancelled and fully refunded orders.

Import the file into a sheet called Orders, with the email in column A, the date in column B and the total in column C. Check that the dates import as dates, not as text. The sheet holds customer data, so keep it private.

Step 2: Build one row per customer

In a second sheet called Customers, enter these formulas in row 2 and copy columns B to F down for every customer:

Column Formula What it shows
A =UNIQUE(FILTER(Orders!A2:A, Orders!A2:A<>"")) Each customer once
B =MINIFS(Orders!B:B, Orders!A:A, A2) First order date
C =MAXIFS(Orders!B:B, Orders!A:A, A2) Last order date
D =COUNTIF(Orders!A:A, A2) Number of orders
E =TODAY()-C2 Days since the last order
F =IF(D2>=2, SMALL(FILTER(Orders!B:B, Orders!A:A=A2), 2)-B2, "") Days from the first to the second order

Format columns B and C as dates, and E and F as plain numbers.

Step 3: Find your store's usual gap

In cell H1, work out how long repeat customers usually take to come back:

=MEDIAN(F2:F)

This is the median number of days between a first and a second order. A coffee or pet food store may see a few weeks, a furniture store a year or more. That is why the thresholds come from your own orders and not from a fixed number.

Step 4: Label each customer

In G2, give every customer a status, and copy it down:

=IF(D2=1, IF(E2>$H$1, "One-time, past the usual gap", "New"), IF(E2>2*$H$1, "Lapsed", IF(E2>$H$1, "At risk", "Active")))

  • Active: a repeat customer who ordered within the usual gap. Your normal campaigns are enough.
  • At risk: a repeat customer past the usual gap. A reminder of what they usually buy often works before any discount.
  • Lapsed: a repeat customer past twice the usual gap. They need a win-back series.
  • One-time, past the usual gap: a customer who never came back for a second order. A second-purchase email fits them better than win-back.

One and two times the usual gap are starting points, not rules. If most at-risk customers come back on their own, move the line later. If lapsed customers rarely respond, contact them sooner.

Step 5: Add the signals you already have

  • A regular who slows down: fewer orders, or smaller ones, than their own history.
  • An open return, refund or complaint: sort it out before you send any marketing.
  • No email clicks for 90 days: use clicks, not opens, because Apple Mail Privacy Protection can mark emails as opened when nobody read them.

Turn the List Into Action

Refresh the order export every week or month. The day counts update by themselves, because the formulas use today's date.

Send each group something different, and measure whether they order again: the share of at-risk customers who order within 30 days, compared with a small group you leave out. The customer retention rate calculator turns the same order data into your retention and churn rate.

In an email platform, the same rules become segments that update themselves, so a customer gets the reminder when they cross the line, not when someone opens the sheet. The lapsing customer segment and the inactive customer segment show thresholds to start from, and the win-back automation template covers the emails that follow. Jellyreach works the same way: its segments use order counts and days since the last order, and it does not predict churn or score customers.

Conclusion

The service this tutorial was built on is gone, but the question it answered is not. Rules on your own order dates take an afternoon in a spreadsheet, are easy to explain to your team and tell you who to contact this week. Once the sheet becomes a weekly chore, move the same rules into segments in your email platform.