How to Use TTEST Function in Google Sheets

This guide will discuss how to use the TTEST function in Google Sheets.

When we need to determine whether two samples are likely to come from the same two underlying populations having the same mean, we can easily do this using the TTEST function in Google Sheets.

The rules for using the TTEST function in Google Sheets are the following:

  • The TTEST function returns the probability associated with t-test.
  • We must input a numeric value for the tails and type arguments. 
  • The selected sample for range1 and range2 arguments must have the same number of data points. 
  • If we set the tails argument to 1, the TTEST function will return the probability of a higher value of the t-statistic under the assumption that range1 and range2 are samples from populations with the same mean. 
  • If we set the tails argument to 2, the TTEST function will return a value double the value returned when the tails argument is set to 1. 

Google Sheets is an excellent tool for performing complicated statistical analysis. It allows us to easily test probabilities and hypotheses to reach accurate conclusions.

One of the functions we can use is the TTEST function, a powerful statistical tool that lets us perform several types of t-tests. Moreover, it’s a reliable method to determine if two sample means are significantly different from each other. 

In this guide, we will provide a step-by-step tutorial on how to use the TTEST function in Google Sheets, explore the syntax, and a real example of using the function.

Great! Let’s dive right in.

The Anatomy of the TTEST Function

The syntax or the way we write the TTEST function is as follows:

=TTEST(range1, range2, tails, type)

  • = the equal sign is how we start any function in Google Sheets.
  • TTEST() refers to our TTEST function. This function determines whether two samples are likely to have come from the same two underlying populations having the same mean.
  • range 1 is a required argument. It refers to the first sample of data or group of cells to consider for the t-test.
  • range 2 is another required argument. It refers to the second sample of data or group of cells to consider for the t-test.
  • tails is also a required argument. This argument will specify the number of distribution tails. If we input 1, we will use a one-tailed distribution. If we input 2, we will use a two-tailed distribution. 
  • type is a required argument that specifies the type of t-test performed. If we input 1, the function will perform a paired test. If we input 2, the function will perform a two-sample equal variance (homoscedastic) test. If we input 3, a two-sample unequal variance test is performed. 

A Real Example of Using TTEST to Perform a Paired T-test

Suppose we have two data sets containing the test scores of students before and after additional classes. Let’s say we want to determine if the additional classes made a significant difference in the student’s test scores.

Our initial data set would look like this:

Initial dataset

In the spreadsheet above, we can see the student’s name and their test scores before and after the additional classes. Essentially, we are using the before values as a control group.

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

  • Null hypothesis: the two samples do not have a significant difference in mean
  • Alternate hypothesis: the two samples have a significant difference in mean

We can use the formula below to test the hypotheses above:

=TTEST(B2:B10,C2:C10,2,1)

Paired T-test formula

The first part of the formula is our range1 argument. We simply selected the range B2:B10. Then, we also selected the range C2:C10 as our range2 argument. Next, we set the tails argument to 2 (two-tailed distribution). 

Lastly, we will set the type argument to 1, indicating we want to perform a paired t-test. 

Our final data set would look like this:

Final dataset

A Real Example of Using TTEST to Perform an Equal Variance Test

Suppose we have two data sets containing the IQ scores of two different groups of people. In this case, we want to find out if there is a significant difference in the average IQ scores of the two groups.  

Our initial data set would look like this:

Initial dataset

The spreadsheet above shows the two samples of IQ scores from two different groups. We will use the TTEST function to test if the means of the two data sets are equal.

We will use the formula below:

=TTEST(A13:A21,B13:B21,2,2)

Equal Variance Test formula

The first part of the formula is our range1 which is A13:A21. Next, we selected the range B13:B21 as our range2 argument. Then, we set the tails argument to 2 (two-tailed distribution). Lastly, we set the type argument to 2, indicating we want to perform an equal variance t-test. 

Our final data set would look like this:

Final dataset

A Real Example of Using TTEST to Perform an Unequal Variance Test

Suppose we have the same data sets containing the IQ scores of two different groups. However, one data set is longer than the other, meaning the variance of Group 1 is not equal to the variance of Group 2.

Our initial data set would look like this:

Initial dataset

The spreadsheet above shows that Group 1 has 9 values while Group 2 has 11 values. In this case, we will perform a two-sample unequal variance test. 

We will utilize the formula below:

=TTEST(A24:A32,B24:B34,2,3)

Unequal Variance Test formula

The first part of the formula is our range1 which is A24:A32. Then, we selected the range B24:B34 as our range2. Next, we set the tails argument to 2 (two-tailed distribution). Lastly, we set the type argument to 3, indicating we want to perform a two-sample unequal variance t-test.  

Our final data set would look like this:

Final dataset

You can make your own copy of the spreadsheet above using the link below. 

Amazing! Now we can dive into the steps of using the TTEST function in Google Sheets.

How to Use TTEST Function in Google Sheets

1. First, we will select an empty cell to display our formula.

TTEST Function in Google Sheets

2. We will begin our formula with an equal sign and the function name. Our formula would be “=TTEST(”.

TTEST Function in Google Sheets

3. Then, we will select the first column as our range1. Our formula would be “=TTEST(B2:B10”.

TTEST Function in Google Sheets

4. Next, we will select the second column as our range2. Our formula would be “=TTEST(B2:B10,C2:C10”.

TTEST Function in Google Sheets

5. We will set the tails argument to “2”. Our formula would be “=TTEST(B2:B10,C2:C10,2”.

TTEST Function in Google Sheets

6. Since we want to perform a paired sample t-test, we will input “1” as our type argument. Our final formula would be “=TTEST(B2:B10,C2:C10,2,1)”.

TTEST Function in Google Sheets

7. We will press the Enter key to return the result.

TTEST Function in Google Sheets

8. Let’s say we want to perform a two-sample equal variance test. Following the same steps, we will select the first column as our range1 and the second column as our range2. Our formula would be “=TTEST(A13:A21,B13:B21”.

TTEST Function in Google Sheets

9. Then, we will set our tails argument to “2” and our type argument to “2”. Our final formula would be “=TTEST(A13:A21,B13:B21,2,2)”.

TTEST Function in Google Sheets

10. Press the Enter key to return the result. 

TTEST Function in Google Sheets

11. Lastly, we can also perform a two-sample unequal variance test. Similarly, we will select the two columns separately as our range1 and range2 arguments. Our formula would be “=TTEST(A24:A32,B24:B34”.

TTEST Function in Google Sheets

12. Next, we will set our tails argument to “2” and our type argument to “3”. Our final formula would be “=TTEST(A24:A32,B24:B34,2,3)”.

TTEST Function in Google Sheets

13. Press the Enter key to return the result.

TTEST Function in Google Sheets

And tada! We have successfully used the TTEST function in Google Sheets.

You can apply this guide whenever you need to return the probability associated with t-tests. You can now use the TTEST function and the various other Google Sheets formulas available to create great worksheets that work for you.

That’s pretty much it! Make sure to subscribe to our newsletter to be the first to know about the latest guides and tutorials from us.

Get emails from us about Google Sheets.

Our goal this year is to create lots of rich, bite-sized tutorials for Google Sheets users like you. If you liked this one, you'll love what we are working on! Readers receive early access to new content.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like