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)`

**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))`

- 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))`

**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

**How to Calculate Ratio of 3 Numbers in Excel (3 Quick Methods)****Calculate Compa Ratio in Excel (3 Suitable Examples)****How to Calculate Average Ratio in Excel (2 Simple Ways)****Calculate Sharpe Ratio in Excel (2 Common Cases)****Debt Service Coverage Ratio Formula in Excel****Calculate Sortino Ratio in Excel (2 Methods)****How to Convert Percentage to Ratio in Excel (4 Easy Ways)**