Rearrange Formula Calculator

This rearrange formula calculator solves common statistics formulas for any variable, with each algebra step and the numeric answer.

Checks on your data

  • Use the one-letter symbols shown in the variables table. Where a symbol is written differently in textbooks, such as μ or σ, the table says which letter to type.
  • A sample size should be rounded up to the next whole number.

Results

n =
138.2976
Rearranged formula
n = (z·s / E)²
Original formula
n = (z·s / E)²
Formula name
Sample size for a margin of error
Variables in Sample size for a margin of error
SymbolMeaningValue
nsample size138.298 (solved)
zcritical value1.96
sstandard deviation12
Emargin of error2
Show step-by-step solution
  1. Start with n = (z·s / E)².
  2. Already solved for n.
  3. Substitute z = 1.96, s = 12, E = 2.
  4. n = 138.2976.
Formulasz, margin, SE, n, t, mean, CV, % change
Inputname=number
OutputRearranged formula + value
RuleDo the same to both sides

What Is Rearrange Formula?

Rearranging a formula means isolating the variable you need on one side of the equals sign. In statistics this is how you get a sample size from a margin of error or a standard deviation from a standard error.

Pick a formula, type the letter to solve for and enter the other values as name=number. The calculator prints the rearranged formula, the steps, the substitution and the result, with a table of what each symbol means.

The sections below show the rules and a worked sample-size example.

How to Use the Rearrange Formula Calculator

  1. Choose the formula.
  2. Type the letter to solve for.
  3. Enter the known values as name=number.
  4. Read the rearranged formula and the steps.

Rearrange Formula Formula

Margin of error

E=z snE=\frac{z\,s}{\sqrt n}

Solved for n

n=(z sE)2n=\left(\frac{z\,s}{E}\right)^2

Rearrange Formula Variables Explained

SymbolMeaningNotes
zz-score or critical value
sStandard deviation
nSample size
EMargin of error

Rearrange Formula Worked Example

Start with E = z·s ÷ √n and solve for n. Multiply both sides by √n to get E·√n = z·s, divide by E to get √n = z·s ÷ E, then square: n = (z·s ÷ E)². With z = 1.96, s = 12 and E = 2, n = (1.96 × 12 ÷ 2)² = 11.76² = 138.30, so use n = 139.

With the example values loaded in the calculator above, the steps are:

  1. Start with n = (z·s / E)².
  2. Already solved for n.
  3. Substitute z = 1.96, s = 12, E = 2.
  4. n = 138.2976.

Result: n = = 138.2976; Rearranged formula = n = (z·s / E)².

How to Read a Rearranged Formula

Rearranging does not change the relationship. It only moves the unknown to the left so you can compute it directly. Each step does the same operation to both sides, so the equality always holds.

Always substitute your numbers back into the original formula to check the result. In the margin of error example, n = (z·s ÷ E)² gives 138.3, and rounding up to 139 keeps the margin at or below 2. Round sample sizes up, never to the nearest integer.

Where Rearrange Formula Is Used

Sample size planning

Solve the margin of error formula for n to see how many observations you need.

Finding x from a z-score

Rearrange z = (x − μ) ÷ σ to get x = μ + zσ and convert a z-score back to a raw value.

Exam questions

Practise the steps of isolating a variable and compare with the written solution.

Science formulas

Make a different quantity the subject, such as solving a standard deviation formula for the sum of squares.

Common Rearrange Formula Mistakes to Avoid

  • Do the same thing to both sides at every step. A step that changes only one side breaks the equation.
  • Undo operations in the reverse order they were applied: add or subtract first, then multiply or divide, then roots or powers.
  • Check the result by substituting numbers into the original formula.
  • Round sample sizes up. Rounding 138.3 down to 138 would leave the margin slightly too large.

Rearrange Formula Terms and Definitions

Subject of a formula
The variable alone on one side of the equals sign.

Rearrange Formula FAQs

How do you rearrange a formula?

Treat it as an equation and undo the operations around the variable one at a time, doing the same to both sides. For E = z·s ÷ √n, multiply by √n, divide by E, then square both sides to get n.

How do I rearrange the margin of error formula for n?

Start from E = z·s ÷ √n. Then n = (z·s ÷ E)². With z = 1.96, s = 12 and E = 2 you get n = (11.76)² ≈ 138.3, so use 139.

How do I solve the z-score formula for x?

Multiply both sides of z = (x − μ) ÷ σ by σ, then add μ. The result is x = μ + z·σ. A z-score of 1.5 with μ = 100 and σ = 15 gives x = 122.5.

Why round sample size up?

A sample size must be a whole number, and a smaller sample gives a larger margin than you planned. Rounding 138.3 up to 139 keeps the margin at or below the target.

Related calculators

Last updated 2026-11-09. See our disclaimer.