How to Calculate T Test in Excel

If you just need to calculate t test in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use =T.TEST(array1, array2, 2, 3) — it returns a p-value for the tails (1 or 2) and test type (1 paired, 2 equal variance, 3 unequal variance) you pass, and below 0.05 is the conventional threshold for calling a difference significant.

On this page8

Syntax

=T.TEST(array1, array2, tails, type)

Arguments

Argumentrequired / optionalDescription
array1requiredThe first sample.
array2requiredThe second sample.
tailsrequired1 for a one-tailed test, 2 for two-tailed.
typerequired1 paired, 2 two-sample equal variance, 3 two-sample unequal variance.

Related functions

Z.TESTF.TESTAVERAGE
▤Annotated stepsExcel
1

Decide whether the samples are paired (same subjects twice) or independent (two groups).

2

Type =T.TEST( and select both ranges.

3

Enter 2 for tails unless you have a directional hypothesis stated in advance.

4

Enter the type: 1 paired, 3 independent with unequal variance. Read the result against 0.05.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

T.TEST compares two samples and returns the probability of seeing a difference this large if the two populations actually had the same mean. The type argument matters more than most people realise: 1 is for paired measurements (the same subjects before and after), 3 is for two independent groups whose variances may differ, and 3 is the safer default for independent samples because assuming equal variance rarely holds. A p-value below 0.05 conventionally means "unlikely to be chance", but it says nothing about how large or how important the difference is — a trivial difference becomes significant with a large enough sample. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “calculate t test in excel”. Start on a copy or a tiny sample, keep the affected cells visible, and compare the result with the outcome you expected before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

Comparing conversion times for two page designs, 200 sessions each in B2:B201 and C2:C201: =T.TEST(B2:B201, C2:C201, 2, 3) returning 0.03 says a difference this large would arise by chance about 3 % of the time. Before-and-after measurements on the same people use the paired form: =T.TEST(before, after, 2, 1). T.TEST is the standard A/B significance check, and its type argument is where most spreadsheet significance testing quietly goes wrong. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. For “calculate t test in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Using type 2 (equal variance) by default, when the variances usually differ and type 3 is the honest choice.
  • Choosing a one-tailed test after seeing the data, which halves the p-value without justification.
  • Reporting significance without the effect size; with 100,000 rows almost anything is significant.

Frequently asked questions

What does the p-value mean?

The probability of a difference this large arising by chance if the populations were identical. It is not the probability that your conclusion is correct.

Which type should I use?

1 for paired measurements on the same subjects; 3 for two independent groups. Type 2 assumes equal variance, which usually does not hold.

One or two tails?

Two, unless you committed to a direction before collecting data.