How to Use the T.TEST Function in Google Sheets – All Variations

How to use the T.TEST function in Google Sheets
Reading Time: 6 minutes

The T.TEST function in Google Sheets is used to compare the mean of two different samples to know if there is a statistical difference between them.

Syntax
=T.TEST(range1, range2, tails, type)

range1 – The first data sample or range of cells the function examines for the t-test.
range2 – The second data sample or range of cells the function examines for the t-test.
tails – Indicates the number of distribution tails.

  • When set to 1: a one-tailed distribution.
  • When set to 2: a two-tailed distribution.

type – Indicates the type of T-TEST.

  • A paired or dependent test is performed when type is set to 1.
  • A two-sample equal variance test is performed when it’s set to 2.
  • A two-sample unequal variance test is performed when it’s set to 3.

Sample Usage
=T.TEST(B4:B14, C4:C14,2,1)

//This returns the T Score of a paired T.Test for the data in the ranges B4:B14 and C4:C14.

Link to copy the spreadsheet template with the examples

Contents:

What are T.TESTS?

T.TESTS are used in comparing the mean of two different samples to know if there is a statistical difference between them. The T.TEST function in Google Sheets finds the probability value of a T.TEST.

T.TESTS are performed to determine if two samples come from the same population. To carry out this test, one uses a method known as hypothesis testing, where you assume that the means of the 2 samples are equal, this is known as the null hypothesis. We also make an alternate hypothesis — that the means of the given samples are not equal. Then, using the T.TEST function in Google Sheets we can test these hypotheses. There are three important factors considered for each sample: 

  • Difference between the two means
  • Standard deviations of the two samples
  • Number of data values 

Why perform T.TESTS?

Statisticians can use T.TESTS to check if two data sets are equal or closely related for several reasons, in medical research, for instance, experiments can be carried out on two samples e.g a placebo group and a second group. By using T.TEST they can determine if the results from the two groups are the same. 

How to use the T.TEST function in Google Sheets 

The T.TEST function in Google Sheets enables us to conduct all kinds of T.TESTs right in our worksheets. 

Note: The T.TEST function tests two data samples, there might be situations where you need to test more than 2 Samples, such cases require tests like the Z-tests, ANOVA test, F-tests, etc.

Now, let us look at how to use the T.TEST function in Google Sheets to perform all three types of T.TESTS. 

Example 1: Using the T.TEST function in Google Sheets to perform a paired T.TEST

To perform a paired sample T.TEST let us follow the steps below.

Step 1: Provide the data sample

We will use the data set below that represents the test scores of 11 pupils in a class before and after a seminar. We will use column B for the before values and column C for the after values.

We are essentially using the before data as a control group here. Our interest is to find out if the seminar truly impacted each student’s performance.

Sample data for the paired t.test in Google Sheets

To find out if the two samples have the same mean value, we make the following assumptions: 

  • Null hypothesis: the two samples have no statistical difference in mean.
  • Alternate hypothesis: the two samples have a significant difference in mean. 

Note: we will use a significance level of 0.05 to compare the results from our T.TEST. 

Now, let us test the hypotheses above.

Step 2: Enter the T.TEST function in Google Sheets

Do the following:

  • In an empty cell, preferably the same as used in this tutorial, E4, and enter the T.TEST function, =T.TEST
  • Select the T.TEST function from the auto-suggested options.

Step 3: Enter the parameters for the T.TEST function in Google Sheets

Now, we need to provide the parameters needed to perform a paired T-TEST, and do the following: 

  • Set range 1 to B4:B14
  • Set range 2 to C4:C14
  • Set the tails to 2
  • Finally, set type to 1 indicating we want to perform a paired T.TEST

The full formula will be as shown below.

=T.TEST(B4:B14, C4:C14,2,1)
Parameters for the t.test function in Google Sheets
  • Press Enter.
Result of the paired t.test in Google Sheets

From the result above 0.1293526467, we can infer that our null hypothesis is false, since the p.value > 0.05.

Example 2: Using the T.TEST function in Google Sheets to perform a two-sample equal variance test

To perform a two-sample equal variance test we will use the data below. 

Two sample T.TEST in Google Sheets

This represents the IQ scores of randomly selected individuals from two different regions of the world. Both samples are made up of the same amount of entries. 

To test if their means are equal we do the following:

  • Set range to A4:A14
  • Set range 2 to B4:B14
  • Set the tails to 1
  • Finally, set type to 2 indicating we want to perform a 2 sample equal variance T.TEST
=T.TEST(A4:A14, B4:B14,2,2)
  • Press Enter.
Probability value of the two sample t.test

The p-value > 0.05, and the two samples have significantly different means.

Example 3: Using the T.TEST function in Google Sheets to perform a two-sample unequal variance test

We have slightly modified our data set by making a sample longer than the other. This ensures that the variance of the data for Group 1 is not equal to that of Group 2.

Two sample t.test for unequal variance

Now we are going to test this using similar steps: 

  • Set range 1 to A4:A14
  • Set range 2 to B4:B17
  • Set the tails to 2
  • Set the type to 3 to perform a 2-sample unequal variance T.TEST 
=T.TEST(A4:A14, B4:B17,2,3)
  • Press Enter
Result of the two sample t.test for unequal variance

We can conclude that since our p-value > 0.05, the two samples have significantly different means. 

Conclusion

The T.TEST function in Google Sheets determines the relationship between two datasets by testing the difference between their means.

Some related questions

What are the types of T.TESTS?

To understand how to perform T.TESTS in Google Sheets we need to know the various kinds, broadly speaking, there are 2 different types of T.TEST:

  1. A paired T.TEST is used for testing samples from a single population e.g before and after the treatment of a particular group. In such a case, the before state is used as a control state for the after state. This is also known as a dependent T.TEST.
  1. Two sample T.TEST is used when two samples come from two different populations. This kind of test is further divided into two: equal variance and unequal variance two-sample T.TESTS. in the former, the data sets are equal in length, while they are unequal in the latter. This is known as the independent T.TEST.

How do you find the p-value from T.TEST in Google Sheets?

The p-value is the value you obtain using the T.TEST function in Google Sheets. To find the p-value simply supply the parameters required by the function. E.g the T.TEST function below:

=T.TEST(B4:B14, C4:C14,2,1)

Where

  • B4:B14 is range 1 
  • C4:C14 is range 2
  • The tail is 2
  • The type is 1

We then compare this p-value/T-score to a significance level of 0.05 to decide the relationship between both means. 

See also 

Don’t miss other similar interesting articles on our blog:

How to find P-value in Google Sheets (+Template) 

How To Use The Z.TEST function in Google Sheets 

How To Use The Z.TEST function in Google Sheets

Leave a Reply