T Test function in excel is used for calculating the probability of significant difference between two data sets whether any or both of them are under the same population with the same mean. T Test which also includes whether the data sets which we are using for calculation is a onetail distribution or two tail distribution with kind of variance it has which may be equal or unequal.
Syntax:= T.TEST(array1,array2,tails,type)
The T.TEST function syntax has the following arguments:
 Array1 (It is a required argument) – The first data set.
 Array2 (It is a required argument) – The second data set.
 Tails (It is a required argument) – Specifies if it is a onetailed or twotailed test. If tails = 1, TTEST uses the onetailed distribution. If tails = 2, TTEST uses the twotailed distribution.
 Type (It is a required argument) – The type of ttest to perform:
 1 – Performs a paired ttest.
 2 – Twosample equal variance ttest.
 3 – Twosample unequal variance ttest.
Example: Let’s look at some Excel T.TEST function examples and explore how to use the T.TEST function as a worksheet function in Microsoft Excel:
Example 1:
I have a Group 1 and Group 2 test scores of a classroom. I need to run T.TEST to find is there a significant difference between these two groups.
Apply T.TEST to get the difference.
The first test is a type of Paired.
Syntax: =T.TEST(A2:A17,B2:B17,2,1)
Result: 0.934119741
The second test is a type of Two Sample equal variance.
Syntax: =T.TEST(A2:A17,B2:B17,2,2)
Result: 0.940819416
The third test is a type of Two Sample unequal variance.
Syntax: =T.TEST(A2:A17,B2:B17,2,3)
Result: 0.940819422
Example 2:
To investigate the effect of a new fever drug on driving skills, a researcher studies 16 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.
Twosample unequal variance (heteroscedastic) can be calculated by Excel TTest function by replacing the type to 3:
Syntax: =T.TEST(A2:A17,B2:B17,2,3)
Result: 0.41527332
Note:
 If array1 and array2 have a different number of data points, and type = 1 (paired), T.TEST returns the #N/A error value.
 The tails and type arguments are truncated to integers.
 If tails or type is nonnumeric, T.TEST returns the #VALUE! error value.
 If tails is any value other than 1 or 2, T.TEST returns the #NUM! error value.

T.TEST uses the data in array1 and array2 to compute a nonnegative tstatistic. If tails=1, T.TEST returns the probability of a higher value of the tstatistic under the assumption that array1 and array2 are samples from populations with the same mean. The value returned by T.TEST when tails=2 is double that returned when tails=1 and corresponds to the probability of a higher absolute value of the tstatistic under the “same population means” assumption.