TL;DR: Put the population in cell A2 and the margin of error as a decimal in cell B2, then use =A2/(1+A2*POWER(B2,2)). For a population of 1,000 and a 5% margin of error, that gives 285.7 — round it up with =ROUNDUP(A2/(1+A2*POWER(B2,2)),0) to get 286 people. The most common mistake is typing 5 instead of 0.05 for the margin of error.
Slovin's formula is simple enough to do on a calculator, but most people need it more than once: different population sizes, different margins of error, a table of results for a report. That is where Excel earns its place. Set it up once, and you can change the population or the margin of error and watch the sample size update instantly — no retyping the arithmetic, and no risk of a slip in the middle of a long division.
This guide builds the spreadsheet from scratch: the exact formula, a worked example you can check by hand, rounding up to whole people, a ready-made table of common values, and the mistakes that trip almost everyone up the first time. If you would rather skip the spreadsheet entirely, our free Slovin's Formula Calculator gives the same answer in seconds.
The Excel formula for Slovin's formula
Slovin's formula is n = N / (1 + N × e²), where N is the population size, e is the margin of error as a decimal, and n is the sample size. In Excel, that becomes a single formula using cell references instead of fixed numbers, so the sheet stays reusable:
=A2/(1+A2*POWER(B2,2))
Here, cell A2 holds the population (N) and cell B2 holds the margin of error (e) as a decimal — 0.05 for a 5% margin of error. POWER(B2,2) squares the margin of error, which is the e² part of the formula. You could also write B2^2 instead of POWER(B2,2); both do exactly the same thing in Excel, and POWER is simply easier to read when you come back to the sheet later.
Set up the sheet like this. Type the labels in column A and the values in column B, or lay it out as a small table — the layout does not matter, as long as the formula points at the right cells:
| Cell | What to type | Example value |
|---|---|---|
| A2 | Population (N) | 1000 |
| B2 | Margin of error (e) as a decimal | 0.05 |
| C2 | =A2/(1+A2*POWER(B2,2)) | 285.7 |
If you are new to Slovin's formula itself, read our guide on what Slovin's formula is first — it explains what each letter means and when the formula is the right tool.
Step-by-step worked example: N = 1,000, e = 5%
Let us walk through the example a school survey planner would actually face: a school with 1,000 students, and a 5% margin of error.
- Enter the population. Click cell A2 and type
1000. - Enter the margin of error. Click cell B2 and type
0.05— the decimal form of 5%, not the number 5. - Enter the formula. Click cell C2 and type
=A2/(1+A2*POWER(B2,2)), then press Enter. - Read the answer. Excel shows 285.714..., which is 1,000 divided by 3.5.
- Round up. Replace the formula in C2 with
=ROUNDUP(A2/(1+A2*POWER(B2,2)),0). Excel now shows 286.
That matches the hand calculation exactly: e² = 0.05 × 0.05 = 0.0025; N × e² = 1,000 × 0.0025 = 2.5; the denominator is 1 + 2.5 = 3.5; and 1,000 / 3.5 = 285.7. The spreadsheet agrees with the arithmetic, which is exactly the check you want before trusting the sheet with other numbers.
Now change B2 to 0.03 and watch C2 jump to 527, or change A2 to 5,000 and watch it become 371. That instant feedback is the whole point of doing this in Excel: you can test how sensitive your sample size is to each input before committing to a survey plan.
Always round up to whole people
Excel returns a decimal — 285.7, not 286 — because the formula is pure arithmetic and knows nothing about people. But you cannot survey 0.7 of a person, and 285 responses would fall just short of the sample size the formula asks for. So the answer must always be rounded up, never down and never to the nearest whole number.
Excel's ROUNDUP function does this in one step. ROUNDUP takes two arguments: the value to round, and the number of decimal places to keep. With 0 decimal places, =ROUNDUP(285.7,0) gives 286. Applied to the whole formula it looks like this:
=ROUNDUP(A2/(1+A2*POWER(B2,2)),0)
Do not use ROUND instead: ROUND(285.7,0) also gives 286 here, but ROUND(285.2,0) would give 285, which is short. And never use ROUNDDOWN or INT for a sample size — both round down by design. ROUNDUP is the only rounding function that always gives you at least the number the formula asks for, which is the safe side for a survey.
Sample sizes for common populations and margins of error
The table below shows the sample sizes Slovin's formula gives for the combinations people look up most often. Every value is rounded up to a whole person, exactly as the ROUNDUP formula above produces. Use it to check your own spreadsheet: if your sheet disagrees with a value here, one of your inputs is wrong — most likely the margin of error.
| Population (N) | 10% margin of error | 5% margin of error | 3% margin of error |
|---|---|---|---|
| 100 | 50 | 80 | 92 |
| 500 | 84 | 223 | 345 |
| 1,000 | 91 | 286 | 527 |
| 5,000 | 99 | 371 | 910 |
The table also shows two useful patterns. First, a smaller margin of error is expensive: for 1,000 people, tightening the margin of error from 5% to 3% nearly doubles the sample, from 286 to 527. Second, the sample size levels off as the population grows: at a 5% margin of error, a population of 5,000 needs only 371 people, not five times the 286 needed for 1,000. Both patterns are worth knowing before you promise a sample size to anyone.
Common mistakes (and how to fix them)
Typing 5 instead of 0.05. This is by far the most common error. Slovin's formula needs the margin of error as a decimal, so 5% must be entered as 0.05. If you type 5, Excel squares it to 25, and a population of 1,000 gives 1,000 / (1 + 25,000) — an answer of about 0.04, which is obviously nonsense. If your answer is a tiny fraction, this is the first thing to check.
Forgetting to square the margin of error. The formula needs e², not e. Writing =A2/(1+A2*B2) instead of =A2/(1+A2*POWER(B2,2)) gives 1,000 / 51 = 19.6 for our example — far too small, and wrong in a way that is easy to miss because the answer still looks plausible. Always check that POWER(B2,2) or B2^2 is in the formula.
Rounding down instead of up. As covered above, ROUND or ROUNDDOWN can return a sample smaller than the formula requires. Use ROUNDUP with 0 decimal places, every time.
Typing the numbers into the formula instead of using cell references. A formula like =1000/(1+1000*POWER(0.05,2)) works, but it is frozen: to try a different population you must rewrite it. Cell references keep the sheet reusable and make mistakes easier to spot, because the inputs sit in plain view.
Using a percentage-formatted cell the wrong way. If B2 is formatted as a percentage, typing 5% stores 0.05 and everything works. But if B2 is formatted as General, typing 5 stores 5, and the answer collapses as described above. Pick one approach — decimal values in a General cell, or percentage values in a percentage cell — and stay consistent.
Once your spreadsheet is set up and checked against the table above, it will serve for every survey you plan. And if you ever need a confidence level as well as a margin of error, Slovin's formula in Excel is not the right tool — use our sample size calculator instead, which handles confidence levels properly. For the difference between the two approaches, see our comparison of Slovin's formula vs Cochran's formula.
Frequently Asked Questions
What is the Excel formula for Slovin's formula?
With the population in cell A2 and the margin of error as a decimal in cell B2, the formula is =A2/(1+A2*POWER(B2,2)). It returns the sample size. Wrap it in ROUNDUP to get a whole number of people: =ROUNDUP(A2/(1+A2*POWER(B2,2)),0).
Why does my Excel answer for Slovin's formula look wrong?
The most common cause is entering the margin of error as 5 instead of 0.05. Slovin's formula needs the margin of error as a decimal, so a 5% margin of error must be 0.05. Entering 5 makes Excel square it to 25, and the answer collapses to almost 1.
Should I round the sample size up or down in Excel?
Always round up. A sample of 285.7 people is not enough — you cannot survey 0.7 of a person, and 285 responses fall just short of what the formula asks for. Use ROUNDUP(...,0) to round up to the next whole person.
Can I type the margin of error as a percentage in Excel?
Yes, if the cell is formatted as a percentage. Typing 5% into a percentage-formatted cell stores 0.05, which is exactly what the formula needs. But if the cell is formatted as General, typing 5 stores 5, and the answer will be wrong.
What happens in Excel when the population is very large?
The answer stops growing and settles near 1 divided by the margin of error squared. At a 5% margin of error the sample size approaches 400 no matter how large the population is, so a population of 100,000 and a population of 10 million need almost the same sample.
References
- Weisstein, Eric W. "Slovin's Formula." MathWorld, Wolfram Research. Source
- Yamane, Taro (1967). Elementary Sampling Theory. Prentice-Hall. Source
- Ryan, Thomas P. (2013). Sample Size Determination and Power. Wiley. Source
The formula is commonly attributed to Slovin (1960); no 1960 publication by Slovin can be verified — Yamane (1967) is the oldest published source of the identical formula.