A/B Test in Excel: Compare Conversion Rates and Significance
By ExcelReady TeamUpdated 6 min read
The short answer
To analyse an A/B test in Excel, count visitors and conversions for each version with COUNTIFS and divide to get the conversion rates. Lift is (rate B - rate A) / rate A. For significance, run a two-proportion z-test: pool the rates, find the standard error with SQRT, divide the gap by it, and turn z into a p-value with NORM.S.DIST.
Key takeaways
- Conversion rate is conversions divided by visitors; COUNTIFS gets both counts from raw data.
- Report the gap in percentage points and as relative lift, so readers see both sizes.
- A two-proportion z-test needs only SQRT and NORM.S.DIST; CHISQ.TEST on the 2×2 counts gives the same p-value.
- A p-value of 0.02 means a gap this large would be unusual if A and B truly converted equally; it is not a 98% chance that B is better.
- Fix the sample size before the test and don't stop early when the result first looks significant.
On this page+
An A/B test in Excel comes down to three numbers: the conversion rate of each version, the lift of B over A, and a p-value that tells you whether the gap is bigger than chance would usually produce. COUNTIFS gets the counts, simple division gives the rates, and a two-proportion z-test with SQRT and NORM.S.DIST gives the significance. This guide works through one example, for marketers, product analysts and anyone preparing for a data analyst interview.
What an A/B test measures#
In an A/B test, visitors are randomly split between two versions of a page, email or offer. Version A is usually the current one, called the control. Version B is the change. A conversion is the action you want, such as a sign-up or a purchase.
You compare the conversion rate, conversions divided by visitors, of the two versions. The question is whether B's rate is really different, or whether the gap could easily be random noise from which visitors happened to land in each group.
The example below uses these counts, which are made up for illustration:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Version | Visitors | Conversions | Rate |
| 2 | A | 4,000 | 200 | 5.0% |
| 3 | B | 4,000 | 248 | 6.2% |
Count visitors and conversions with COUNTIFS#
If your data is one row per visitor, COUNTIFS builds the summary table. With the version in column B and "Yes" or "No" in column C of a raw data sheet:
| Cell | Formula | What it counts |
|---|---|---|
| B2 | =COUNTIFS(Data!B:B,"A") | Visitors who saw A |
| C2 | =COUNTIFS(Data!B:B,"A",Data!C:C,"Yes") | Visitors who saw A and converted |
| D2 | =C2/B2 | A's conversion rate |
Fill down for B, changing "A" to "B", or put the version names in column A and use A2 instead of typing them. Format column D as a percentage. A is 5.0% (200 / 4,000) and B is 6.2% (248 / 4,000).
Count people, not page views. If one visitor can appear many times, remove the duplicates first. The COUNTIFS function guide and our article on COUNTIFS and SUMIFS cover the criteria, and COUNTIF as a percentage shows the same count-and-divide pattern.
Calculate the difference and the lift#
Report the gap two ways. The absolute difference is B's rate minus A's: 6.2% − 5.0% = 1.2 percentage points. The relative lift compares that gap with the control:
=(D3-D2)/D2The result is 24%: B converted 24% more often than A. Lift is a percent change, so the percent change lesson and our guide to percentage formulas apply directly. Always say which you mean, because "up 1.2%" and "up 24%" describe the same result.
Test significance with a two-proportion z-test#
A two-proportion z-test asks how many standard errors apart the two rates are. Build it in four cells:
| Cell | Label | Formula | Result |
|---|---|---|---|
| G2 | Pooled rate | =(C2+C3)/(B2+B3) | 0.056 |
| G3 | Standard error | =SQRT(G2*(1-G2)*(1/B2+1/B3)) | 0.00514 |
| G4 | z | =(D3-D2)/G3 | 2.33 |
| G5 | p-value (two-sided) | =2*(1-NORM.S.DIST(ABS(G4),TRUE)) | 0.020 |
- The pooled rate treats both groups as one, because the test starts by assuming A and B convert at the same rate.
- The standard error is how much the gap between two rates would normally wobble by chance at these sample sizes. It uses the same idea as standard deviation.
- z is the gap measured in standard errors. Here the 1.2-point gap is about 2.33 standard errors.
- NORM.S.DIST with TRUE gives the area under the normal curve below z.
1-that, doubled, is the chance of a gap at least this large in either direction, if there were no real difference.
NORM.S.DIST needs Excel 2010 or later. The z-test relies on a normal approximation, so it works best with reasonably large groups. A common rule of thumb is at least 10 conversions and 10 non-conversions in each version.
The same answer with CHISQ.TEST#
You can also put the counts in a 2×2 table of converted and not converted (200 and 3,800 for A; 248 and 3,752 for B), build the expected counts (224 and 3,776 for each), and use =CHISQ.TEST(observed,expected). It returns the same 0.020, because for a 2×2 table the chi-square test and the two-sided z-test are equivalent. Our guide to the chi-square test in Excel shows how to build the expected table.
How to read the p-value#
The p-value is 0.020. That means: if A and B truly had the same conversion rate, a gap of 1.2 points or more would show up in only about 2% of tests this size. If you set 0.05 as your cut-off before the test, this result counts as statistically significant.
Be careful what you claim:
- It is not a 98% chance that B is better. A p-value is about the data, assuming no real difference.
- It does not say the lift is exactly 24%. A 95% confidence interval for the gap is roughly 0.2 to 2.2 percentage points, so the true improvement could be small. See confidence intervals in Excel for the method.
- Significant isn't the same as important. Ask whether the gap is big enough to matter for the business.
Sample size changes everything. With the same rates but only 1,000 visitors per version (50 and 62 conversions), z falls to about 1.17 and the p-value rises to about 0.24. The gap looks identical, but there is too little data to tell it apart from chance.
Common A/B testing mistakes#
These mistakes make a result look more certain than it is:
- Stopping as soon as it looks significant. Checking every day and stopping at the first p below 0.05 raises the false-positive rate. Decide the sample size or test length in advance.
- Testing many metrics or versions. With 20 comparisons, about one may cross 0.05 by chance alone. Pick one main metric before you start.
- Uneven splits. If a 50/50 test ends at 4,000 against 3,500 visitors, check the setup before trusting the result.
- Counting sessions instead of people. Repeat visits break the assumption that each row is independent.
- Running too short a test. A few days may miss weekday and weekend differences.
A/B test questions are common in analyst interviews. The data analyst Excel test guide covers the other skills they check, and the data analyst mock test lets you try a timed version.
Practise it#
Try the exercise on this page to calculate a conversion rate from raw rows with COUNTIFS. Then practise COUNTIFS and SUMIFS in a live spreadsheet, and practise percent change so lift calculations become automatic. Each lesson checks your formula as soon as you press Enter.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Each row is one visitor, with the version they saw (B) and whether they converted (C). In F2, calculate the conversion rate for version B: conversions divided by visitors. Use COUNTIFS.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Converted | ||||||
| 2 | Yes | Rate B | |||||
| 3 | No | ||||||
| 4 | No | ||||||
| 5 | Yes | ||||||
| 6 | No | ||||||
| 7 | Yes | ||||||
| 8 | No | ||||||
| 9 | Yes | ||||||
| 10 | |||||||
| 11 | |||||||
| 12 |
Tip: The top COUNTIFS needs two conditions (version B and Yes); the bottom one needs only version B.
Practise this in a lesson
Frequently asked questions
How do I calculate statistical significance for an A/B test in Excel?
Use a two-proportion z-test. Compute the pooled rate, the standard error =SQRT(p*(1-p)(1/n1+1/n2)), and z = (rate B - rate A) / standard error. The two-sided p-value is =2(1-NORM.S.DIST(ABS(z),TRUE)).
What p-value is significant for an A/B test?
Many teams use 0.05 as the cut-off, but it is a convention you choose before the test, not a rule. A p-value below your cut-off means the gap would be unlikely if both versions truly performed the same.
Can I use CHISQ.TEST for an A/B test in Excel?
Yes. Put the conversions and non-conversions for A and B in a 2 by 2 table, build the expected counts, and use =CHISQ.TEST(observed,expected). For a 2 by 2 table it gives the same p-value as the two-sided z-test.
How do I calculate lift in Excel?
Divide the difference in conversion rates by the control's rate: =(D3-D2)/D2. With 5.0% for A and 6.2% for B, the lift is 24%.
Does Excel have an A/B test function?
No single function does it all. You combine COUNTIFS for the counts, simple division for the rates, and SQRT with NORM.S.DIST, or CHISQ.TEST, for the p-value.