Did the campaign work, or does it just look that way?
If you work in marketing, CRM, pricing, operations or finance, you are asked to judge whether something “worked” all the time. Did the loyalty programme increase spending? Did the new store layout lift sales? Did the discount bring customers back? The data you have is almost never a clean experiment. It is a record of what happened, shaped by decisions people made: who was targeted, which stores went first, which customers opted in. Comparing the people who got the treatment with the people who did not is the obvious first step, and it is the step that most often gives the wrong answer.
Causal inference is the set of methods that tries to answer the real question: what would have happened without the action? You can never observe that directly for the same customers at the same time, so every method in this field is a way of building a fair stand-in. This course covers the methods that are practical in Excel: stratification, randomised experiments, difference-in-differences, matching, propensity weighting, regression discontinuity and instrumental variables.
This free first lesson starts with the problem that makes all of them necessary: confounding, and its most surprising symptom, Simpson’s paradox. We use the same fictional retailer as the lab above, Ashcombe Market, and its spring 2026 win-back coupon. All numbers are illustrative and invented for learning.

The core idea: counterfactuals and confounders
For each customer who received the coupon, there is an outcome we see (did they buy again within 30 days?) and an outcome we can never see: whether they would have bought without the coupon. That unseen outcome is the counterfactual. The causal effect is the difference between the two. Since we only ever see one of them per customer, we estimate the average effect by comparing groups, and the comparison is only fair if the groups are alike in everything that matters except the treatment.
A confounder is a variable that influences both who gets the treatment and the outcome. At Ashcombe Market the CRM team sent the win-back coupon mostly to lapsed customers, people who had not bought for a while. Lapsed customers also buy far less often than active ones, coupon or not. So customer segment affects both sides: it decides who gets the coupon and it drives the buy rate. Comparing coupon customers with everyone else therefore mixes two things, the effect of the coupon and the fact that coupon customers were mostly lapsed to begin with.
The remedy in this lesson is stratification: compare coupon and no-coupon customers within each segment, where the confounder is held fixed, and then combine the segment differences into one number with a weighted average. That is the simplest form of “adjusting for a confounder”, and it is the same logic that regression controls, matching and propensity weighting extend to many variables at once.
Worked example: the Ashcombe Market win-back coupon
The lab sheet has two segments. Here are the inputs and the rates you calculate, rounded for display:
| Segment | Coupon customers | Coupon buyers | Coupon buy rate (D) | No-coupon customers | No-coupon buyers | No-coupon buy rate (G) | Difference (H) |
|---|---|---|---|---|---|---|---|
| Active | 300 | 198 | 66.0% | 2,200 | 1,320 | 60.0% | +6.00 pts |
| Lapsed | 1,200 | 228 | 19.0% | 300 | 42 | 14.0% | +5.00 pts |
| All customers | 1,500 | 426 | 28.4% | 2,500 | 1,362 | 54.5% | -26.08 pts |
Read the table row by row. Among active customers, 66.0% of coupon recipients bought again, against 60.0% of the others: the coupon is ahead by 6 percentage points. Among lapsed customers, 19.0% against 14.0%: ahead by 5 points. Now look at the total. Only 28.4% of all coupon customers bought again, against 54.5% of the rest. The naive comparison says the coupon reduced the buy rate by about 26 points.
Both statements are arithmetically correct. The total is dragged down because 1,200 of the 1,500 coupon customers (80%) are lapsed, while only 300 of the 2,500 no-coupon customers (12%) are. The coupon group is mostly made of people with a low baseline, so its total rate looks poor even though the coupon helps in each segment. When the total and every segment point in opposite directions, you are looking at Simpson’s paradox.
To get one adjusted number, weight each segment’s difference by the number of customers in that segment: 2,500 active (300 + 2,200) and 1,500 lapsed (1,200 + 300).
Adjusted effect = (6.0 × 2,500 + 5.0 × 1,500) ÷ 4,000 = 5.625 percentage points.
| Cell | Meaning | Formula | Result |
|---|---|---|---|
| D2 (copy to D4) | Coupon buy rate | =C2/B2 | 66.0%, 19.0%, 28.4% |
| G2 (copy to G4) | No-coupon buy rate | =F2/E2 | 60.0%, 14.0%, 54.5% |
| B6 | Naive difference, all customers | =D4-G4 | -26.08 pts |
| H2 (copy to H3) | Effect within each segment | =D2-G2 | +6.0 pts, +5.0 pts |
| B7 | Adjusted effect, weighted by segment size | =SUMPRODUCT(H2:H3,B2:B3+E2:E3)/(B4+E4) | +5.625 pts |
| B8 | Simpson’s paradox? | compare the sign of B6 with H2 and H3 | Yes |
So, adjusted for segment, the coupon raised the 30-day buy rate by about 5.6 points, rather than lowering it by 26. The weights matter. Weighting by all customers answers “what if we sent the coupon to the whole base?”. Weighting by coupon customers only, (6.0 × 300 + 5.0 × 1,200) ÷ 1,500 = 5.2 points, answers “what did the coupon do for the people who actually got it?”. Both are legitimate, but they are different questions, and a report should say which one it answers.
Percentage points become more tangible as customers. Using the effect on the people who got the coupon, about 5.2 points × 1,500 coupon customers ≈ 78 extra customers who bought again within 30 days. If you know the margin per order and the cost of each redeemed coupon, those 78 customers are the starting point of a return-on-investment estimate, for example to decide whether the coupon is worth sending again. The naive figure would have told you to stop a campaign that, on these numbers, was working.
Four questions that reveal a confounded comparison
You will rarely be told that a comparison is confounded. You have to look for it. Before you report any “treated versus untreated” number, work through these four questions. They take a few minutes and catch most of the problems that make campaign reports misleading.
- How was the treatment assigned? Ask the people who ran it. “Everyone whose last purchase was more than 90 days ago”, “the stores the regional managers volunteered” and “customers who opted in” are all assignment rules that create differences between the groups. Only a lottery, such as a random split in the e-mail tool, creates groups that are alike on average.
- Do the groups look alike before the treatment? Put the treated and untreated groups side by side on things measured beforehand: segment, past spend, region, tenure. At Ashcombe Market a simple PivotTable of segment by coupon shows 80% lapsed in one group and 12% in the other, which is enough to distrust the total.
- Does the result survive a split? Recalculate the difference within each level of the variable that differs most. If the segment differences are similar to the total, confounding by that variable is probably small. If they differ a lot, or even change sign as here, the total is not a usable estimate.
- What could I not measure? Write down the plausible reasons for being treated that are not in the data. If there are important ones, say so next to the number, and consider one of the designs from the later lessons instead of simple adjustment.
This checklist also explains why the paradox is not a curiosity of textbooks. Targeting is the whole point of most business actions: you send win-back coupons to customers who are drifting away, you train the stores that struggle, you offer discounts to price-sensitive buyers. Every one of those sensible decisions builds a treated group that differs from the untreated one in a way that is linked to the outcome. The better the targeting, the stronger the confounding, and the more a naive comparison can mislead. Good targeting and honest measurement are therefore two separate jobs, and the second one needs either a control group built in from the start or a careful adjustment afterwards.
How to do it in Excel, step by step
These steps reproduce the lab on your own campaign data. They work in any recent Excel version and in Google Sheets.
- Start from a customer list with at least three columns: segment (or any suspected confounder), treatment flag (got the coupon: 1/0) and outcome flag (bought again: 1/0).
- Choose Insert › PivotTable. Put Segment in Rows, the treatment flag in Columns, and add the customer ID as Count and the outcome flag as Sum in Values. You now have customers and buyers per segment and group.
- Copy the numbers into a layout like the lab: one row per segment, with coupon customers and buyers in B:C and no-coupon customers and buyers in E:F. Add an “All customers” row with
=SUM(B2:B3)and fill right. - In
D2type=C2/B2, selectD2:D4and press Ctrl+D. Do the same inG2:G4with=F2/E2. Format both with Ctrl+Shift+%. - In
B6compute the naive difference:=D4-G4. - In
H2type=D2-G2and copy toH3: the effect within each segment. - In
B7compute the weighted average of the segment effects:=SUMPRODUCT(H2:H3,B2:B3+E2:E3)/(B4+E4). SUMPRODUCT multiplies each effect by its segment size and adds the products. - Compare the signs of B6 and B7. If they differ, you have Simpson’s paradox. An automatic flag:
=IF(SIGN(B6)<>SIGN(B7),"Yes","No"). - Add a clustered column chart (Insert › Charts › Clustered Column) of D2:D4 and G2:G4. A chart like the one above makes the paradox obvious to readers who do not want to read a table.
Common mistakes and how to spot them
- Trusting the total. A comparison of all treated against all untreated customers is only fair if treatment was assigned at random. Spot it: the two groups differ in obvious ways, for example in segment mix, region or past spend.
- Averaging the segment differences without weights.
=AVERAGE(H2:H3)gives 5.5 points and treats a tiny segment like a huge one. Spot it: the result does not change when you double the size of one segment. - Averaging the rates instead of the differences. Taking the average buy rate per group across segments and subtracting mixes up weights. Compute the difference within each segment first, then weight.
- Reversing the sign. Always subtract the control from the treatment (coupon minus no coupon), so a positive number means the coupon helped. Spot it: a “negative effect” where every segment rate is higher with the coupon.
- Adjusting for something the treatment caused. If you split by “redeemed the coupon” or “visited the store in the following week”, you adjust for an outcome of the treatment and distort the effect. Only adjust for variables fixed before the treatment.
- Calling the adjusted number causal without caveats. It is only as good as the list of confounders. Spot it: ask “how were people chosen for the treatment, and is all of that in my table?”
Quick reference: functions and shortcuts used
| Function or shortcut | What it does here | Example |
|---|---|---|
| Division and relative references | A rate per row that you copy down | =C2/B2 |
| SUM | Totals for the “All customers” row | =SUM(B2:B3) |
| SUMPRODUCT | Weighted average of the segment effects | =SUMPRODUCT(H2:H3,B2:B3+E2:E3)/(B4+E4) |
| SIGN and IF | Flags Simpson’s paradox automatically | =IF(SIGN(B6)<>SIGN(B7),"Yes","No") |
| PivotTable | Builds the segment × coupon table from a customer list | Insert › PivotTable |
| Ctrl+D | Copies the formula in the top cell down the selection | Select D2:D4, press Ctrl+D |
| Ctrl+Shift+% | Formats rates as percentages | Select D2:H4 |
| Alt+H, 0 | Adds a decimal place (Home › Increase Decimal) | Select B6:B7 |
Real-world uses
- Marketing campaigns: evaluate targeted coupons, e-mails or ads, where the targeting rule itself is the confounder, by comparing within targeting segments.
- Loyalty programmes: members spend more, but loyal customers are also the ones who join. Stratify by pre-joining spend before crediting the programme.
- Operations and training: stores that received a new process are often the ones managers picked as ready. Compare within store size or region bands.
- Pricing and discounts: discounted orders may look less profitable simply because discounts go to price-sensitive customers. Compare within customer type.
- HR and management reporting: a department with a higher overall sick-leave rate can be lower in every age band once you account for its age mix, the same Simpson pattern.
What you will build in the rest of this course
This first lesson is free. The lessons below form the full course, unlocked with a one-time payment of $9.90. Each has its own interactive lab with instant feedback, and each method handles a situation where simple stratification is not enough.
The Gold Standard: Randomised Experiment & Average Treatment Effect. You analyse a randomised test of a new store layout, check that the groups are balanced and see why a before-and-after change score makes the estimate more precise.
Difference-in-Differences: The 2×2 Table and the Regression. You estimate the effect of Sunday opening by comparing the change in treated stores with the change in other stores, then confirm it with a LINEST regression with an interaction term.
Checking Parallel Trends: Pre-Period Slopes, a Placebo Test & a Trend Chart. You test the assumption every difference-in-differences result depends on, with pre-period trends, a placebo test and a chart, and estimate the effect month by month.
Matching: Nearest-Neighbour Controls with MIN, MATCH & INDEX. You pair each trained store with its most similar untrained twin and estimate the effect of training on the stores that were actually trained.
Propensity Scores & Inverse Probability Weighting (IPW). You turn propensity scores into weights that rebalance the groups and estimate the effect of the mobile app on annual spend.
Regression Discontinuity: The Jump at the Gold-Status Cutoff. You fit a line on each side of a 1,000-point loyalty threshold and measure the jump in next-year spend that the status itself causes.
Instrumental Variables: The Wald Estimator from a Randomised Nudge. You use a randomised reminder e-mail as an instrument and estimate the app’s effect for the customers who adopted it because of the reminder.
Summary
A plain comparison of treated and untreated customers measures the effect of the treatment plus every difference in how the groups were chosen. At Ashcombe Market the coupon looks harmful in total (-26.1 points) but helps in both segments (+6 and +5 points), because coupons went mostly to lapsed customers. Comparing within segments and weighting by segment size gives an adjusted effect of about +5.6 points. Whenever the total and the segments disagree, trust the comparison that holds the confounder fixed, and keep asking which confounders you have not measured.
Now scroll back up to the lab and work through the buy rates, the naive difference, the segment effects and the adjusted effect yourself. The Coach checks every step and explains common slips such as reversed signs or unweighted averages. It takes about 15 minutes.
Frequently asked questions
What is a confounder?
A confounder is a variable that affects both who receives a treatment and the outcome. If you do not account for it, the comparison between treated and untreated groups mixes the treatment effect with the effect of the confounder.
What is Simpson’s paradox in simple terms?
It is when a trend that appears in every subgroup reverses or disappears when the groups are combined. It happens when the groups being compared have very different mixes of the subgroups.
How do I adjust for a confounder in Excel?
Compute the treatment-minus-control difference within each level of the confounder, then take a weighted average of those differences with SUMPRODUCT, using the number of customers in each level as weights.
Is correlation ever enough to prove causation?
Only when the treatment was assigned at random, as in a well-run experiment. Otherwise you need a design or adjustment that rules out confounders, and you should state which ones you could not measure.
Should I weight segments by all customers or only treated customers?
Weighting by all customers estimates the effect if everyone were treated. Weighting by treated customers estimates the effect on those who actually received the treatment. Choose the one that matches your business question and say which you used.
Can I do causal inference in Excel?
Yes, for many practical designs. Stratification, randomised tests, difference-in-differences, matching, inverse probability weighting, regression discontinuity and simple instrumental variables can all be built with standard Excel functions.
Keep going: Causal Inference for Business: Difference-in-Differences, Matching & Natural Experiments
This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time $9.90.
- The Gold Standard: Randomised Experiment & Average Treatment Effect
- Difference-in-Differences: The 2×2 Table and the Regression
- Checking Parallel Trends: Pre-Period Slopes, a Placebo Test & a Trend Chart
- Matching: Nearest-Neighbour Controls with MIN, MATCH & INDEX
- Propensity Scores & Inverse Probability Weighting (IPW)
- Regression Discontinuity: The Jump at the Gold-Status Cutoff
- Instrumental Variables: The Wald Estimator from a Randomised Nudge
- Regression Adjustment & Omitted-Variable Bias: What a Missing Confounder Does to the Effect
- Covariate Balance: Standardised Mean Differences Before and After Matching
- Overlap & Extreme Weights: Common Support, Trimming and Effective Sample Size
- Stratifying on the Propensity Score: Four Blocks and a Weighted Effect
- Staggered Rollouts: Cohort DiD and the Already-Treated Control Trap
- Synthetic Control: Building a Weighted Twin from Donor Regions
- Interrupted Time Series: Extending the Pre-Trend When There Is No Control Group
- RD Robustness: Bandwidth Choice and a Bunching Check at the Free-Delivery Threshold
- Two-Stage Least Squares by Hand: First Stage, Fitted Values & a Weak-Instrument Check
- Who Should Get the Offer? Segment Uplift and Targeting Profit
- How Strong Would a Hidden Confounder Need to Be? E-Values and a Bias Factor
- Final Project: A Causal Impact Readout for the Loyalty App Pilot