How to Calculate Odds Ratio in Excel

This article illustrates how to calculate the odds ratio in excel. The Odds Ratio (OR) can be defined as the probability of occurrence of an event in proportion to the likelihood of non-occurrence of that event.

Consider the following generic dataset.

Here the odds of the event happening in the treatment group is a/b. Similarly, the odds of the event happening in the control group is c/d. So, the ratio of the two odds will be (a/b)/(c/d).

Therefore, the generic formula for the odds ratio is as follows.

Odds Ratio = (a/b)/(c/d) = (a×d)/(b×c)


Download Sample Workbook

You can download the practice workbook from the download button below.


How to Calculate Odds Ratio (OR) in Excel

Assume you have the following dataset. It contains the results from a medical survey. The survey was done on some intravenous drug users to find out if they were HIV+ or HIV-. And then it was done on people who didn’t use the drugs.

Now, enter the following formula in cell E5 to calculate the odds ratio of the survey results.

=(C5/D5)/(C6/D6)

Calculate Odds Ratio in Excel

Interpretation:

Here, the result 2.14 indicates that it is 2.14 times more likely for those who are HIV+ to also be IVD+ than to be IVD-.

Read More: How to Calculate Ratio in Excel (4 Handy Methods)


Calculate Confidence Intervals (CI) for Odds Ratio in Excel

The generic formula for the confidence intervals for the odds ratio is as follows.

Confidence Interval = e^(ln(OR)±1.96×√(1/a+1/b+1/c+1/d))

  • Now, enter the following formula in cell F5 to get the lower 95% confidence interval. The formula contains the EXP, LN, and SQRT functions.
=EXP(LN(E5)-1.96*SQRT(1/C5+1/D5+1/C6+1/D6))

Calculate Confidence Intervals (CI) for Odds Ratio

  • Then enter the following formula in cell G5 to get the upper 95% confidence interval.
=EXP(LN(E5)+1.96*SQRT(1/C5+1/D5+1/C6+1/D6))

Calculate Confidence Intervals (CI) for Odds Ratio

Read More: How to Calculate Ratio Between Two Numbers in Excel (5 Ways)


Things to Remember

  • You should not conclude from the odds ratio that the IV drug users are 2.14 times more likely to become HIV+ than those who do not use the drugs. Rather you should interpret it the other way around.
  • OR>1 generally indicates a higher likelihood for an event to occur than to not occur. OR<1 indicates the opposite.

Conclusion

Now you know how to calculate the odds ratio in excel. Did this article help you with the task? If you have further queries or suggestions, please let us know in the comment section below.

You can also visit our ExceDemy blog to explore more excel related problems and solutions. Stay with us and keep learning.


Related Articles

Md. Shamim Reza

Md. Shamim Reza

Hello there! This is Md. Shamim Reza. Working as an Excel & VBA Content Developer at ExcelDemy. We try to find simple & easy solutions to the problems that Excel users face every day. Our goal is to gather knowledge, find innovative solutions through them and make those solutions available for everybody. Stay with us & keep learning.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo