**TTest Function in Excel (Table of Contents)**

## T-TEST in Excel

TTEST function is categorized as a Statistical function in Excel. In mathematical term, the TTEST function in excel will calculate the probability that is associated with a Student’s T-Test. This function is usually used to test the probability of two samples have underlying populations with the same mean.

### T-TEST Formula in Excel

Below is the T-Test Formula in Excel

**Details of Parameters:**

T-TEST in excel has the following required parameters i.e. array1, array2, tails and type.

**array1:**it is the first data set.**array2:**it is the second data set.**Tails:**Tails specifies the number of distribution tails. If tails = 1, T-TEST uses the one-tailed distribution. If tails = 2, TTEST uses the two-tailed distribution.**Type:**Type is the kind of t-test to perform.- Paired
- Two-sample equal variance (homoscedastic)
- Two-sample unequal variance (heteroscedastic)

### How to Use the TTEST Function in Excel?

T-Test in excel is very simple and easy to use. Let understand the working of TTEST function in excel by some examples. TTEST function can be used as a worksheet function and as VBA function.

#### TTEST function as a worksheet function.

### T-Test in Excel Example #1

Suppose have given the following expenses data spent in India and in the US. The probability associated with the Student’s paired t-test with a 1-tailed distribution for the two arrays of data below can be calculated using the Excel function.

The T-Test formula in excel used is as follows: =TTEST(A4:A24,B4:B24,1,1)

The output will be **0.177639611.**

### T-TEST in Excel Example #2

A marketing research firm tests the effectiveness of a new flavoring for a leading beverage using a sample of 21 people, half of whom taste the beverage with the old flavoring and the other half who taste the beverage with the new flavoring.

Two-sample equal variance (homoscedastic) is calculated by the following T-Test formula in Excel =TTEST(A31:A51,B31:B51,1,2)

The output will be **0.454691996.**

### T-TEST in Excel Example #3

To investigate the effect of a new fever drug on driving skills, a researcher studies 21 individuals with fever. All participants then entered a simulator and were given a driving test which assigned a score to each driver as summarized in the below table.

Two-sample unequal variance (heteroscedastic) can be calculated by Excel TTest function by replacing the type to 3 =TTEST(A57:A77,B57:B77,1,3)

The output will be **0.364848284.**

#### T-TEST in Excel can be used as a VBA function.

Suppose we have the data sets located in the excel sheet range from A4 to A24 and B4 to B24, then we can calculate the TTEST of the given datasets by using the below VBA functions.

Sub TTESTcal() // start the TTEST function scope

Dim TTEST as interger

TTEST = Application.WorksheetFunction.TTest(Range(“A4:A24”),Range(“B4:B24”),1,1)

MsgBox TTEST // print the TTEST value in message box.

End sub // End the TTEST function

### Things to Remember about the TTEST Function in Excel

- TTest function through the #N/A Error if the two supplied arrays have different lengths.

- The tails and type parameters are truncated to integers.
- T-Test in excel returns #Value! Error if either the provided tails parameter or the provided type parameter is non-numeric.
- T-Test in excel returns #NUM! Error if-
- The supplied tails parameter has any value other than 1 or 2.

- The supplied type parameter is not equal to 1, 2 or 3.

### T-TEST in Excel Video

### Recommended Articles

This has been a guide to TTEST Function in Excel. Here we discuss the T-TEST Formula in excel and how to use TTEST function along with excel example and downloadable excel templates. You may also look at these useful functions in excel –

- 35+ Courses
- 120+ Hours
- Full Lifetime Access
- Certificate of Completion