Performing statistical tests in Excel can be a bit tricky, but with the right tools and techniques, you can easily run a Fisher's Exact Test. In this article, we will explore five different ways to run a Fisher's Exact Test in Excel.
Fisher's Exact Test is a statistical test used to determine if there is a significant association between two categorical variables. It is commonly used in scientific research, particularly in the fields of medicine and biology. The test is useful for analyzing small datasets and is considered more reliable than the Chi-Square Test when dealing with small sample sizes.
Before we dive into the different methods, let's take a look at the basic formula for Fisher's Exact Test:
Fisher's Exact Test Formula:
p = (a! * b! * c! * d!) / (n! * (a+b)! * (c+d)! * (a+c)! * (b+d)!)
where:
- a, b, c, and d are the frequencies of the four possible outcomes
- n is the total sample size
- p is the probability of observing the given data (or more extreme) under the null hypothesis
Now, let's move on to the five different ways to run a Fisher's Exact Test in Excel.
Method 1: Using the FISHERTEST Function

Excel has a built-in function called FISHERTEST that can be used to perform a Fisher's Exact Test. The function takes four arguments: the frequencies of the four possible outcomes (a, b, c, and d).
Syntax: FISHERTEST(a, b, c, d)
Example:
Suppose we have the following data:
Yes | No | |
---|---|---|
Disease | 10 | 20 |
No Disease | 5 | 15 |
To perform a Fisher's Exact Test, we can use the FISHERTEST function:
=FISHERTEST(10, 20, 5, 15)
This will return the probability of observing the given data (or more extreme) under the null hypothesis.
Method 2: Using the Analysis ToolPak

The Analysis ToolPak is an add-in that comes with Excel. It provides a range of statistical functions, including the Fisher's Exact Test.
To access the Analysis ToolPak, go to the "Data" tab and click on "Data Analysis". Then, select "Fisher's Exact Test" from the list of available tests.
Method 3: Using VBA Macros

VBA (Visual Basic for Applications) macros can be used to perform a Fisher's Exact Test in Excel. To create a macro, go to the "Developer" tab and click on "Visual Basic". Then, create a new module and paste the following code:
Sub FisherExactTest() Dim a As Long, b As Long, c As Long, d As Long Dim p As Double
'Input values a = Range("A1").Value b = Range("B1").Value c = Range("C1").Value d = Range("D1").Value
'Calculate Fisher's Exact Test p = (Application.WorksheetFunction.Fact(a) * Application.WorksheetFunction.Fact(b) * _ Application.WorksheetFunction.Fact(c) * Application.WorksheetFunction.Fact(d)) / _ (Application.WorksheetFunction.Fact(a + b) * Application.WorksheetFunction.Fact(c + d) * _ Application.WorksheetFunction.Fact(a + c) * Application.WorksheetFunction.Fact(b + d))
'Output result Range("E1").Value = p End Sub
Method 4: Using Excel Formulas

We can also use Excel formulas to perform a Fisher's Exact Test. The formula is based on the calculation of the probability of observing the given data (or more extreme) under the null hypothesis.
Formula:
=(FACT(a) * FACT(b) * FACT(c) * FACT(d)) / (FACT(a+b) * FACT(c+d) * FACT(a+c) * FACT(b+d))
where:
- a, b, c, and d are the frequencies of the four possible outcomes
Example:
Suppose we have the following data:
Yes | No | |
---|---|---|
Disease | 10 | 20 |
No Disease | 5 | 15 |
To perform a Fisher's Exact Test, we can use the following formula:
=(FACT(10) * FACT(20) * FACT(5) * FACT(15)) / (FACT(10+20) * FACT(5+15) * FACT(10+5) * FACT(20+15))
This will return the probability of observing the given data (or more extreme) under the null hypothesis.
Method 5: Using Add-ins

There are several add-ins available that can be used to perform a Fisher's Exact Test in Excel, such as XLSTAT, Analyze-it, and SigmaXL.
These add-ins provide a range of statistical functions, including the Fisher's Exact Test. To use an add-in, simply download and install it, and then access it from the Excel ribbon.
Fisher Exact Test Image Gallery









In conclusion, performing a Fisher's Exact Test in Excel can be done using various methods, including the FISHERTEST function, Analysis ToolPak, VBA macros, Excel formulas, and add-ins. Each method has its own advantages and disadvantages, and the choice of method depends on the specific needs of the user.
We hope this article has been helpful in providing a comprehensive overview of the different methods for performing a Fisher's Exact Test in Excel. If you have any questions or need further clarification, please don't hesitate to ask.