Table of Contents
The calculation of the Odds ratio and the Relative risk are fundamental components of advanced statistical analysis, particularly in fields like epidemiology and clinical research. While specialized statistical software often handles these tasks, Microsoft Excel provides a robust, accessible platform for performing these computations manually using straightforward arithmetic formulas applied to raw frequency data.
This comprehensive guide details the precise methods for calculating the Odds ratio (OR) and Relative risk (RR) within an Excel environment, ensuring accurate and interpretable results for your research projects.
Understanding the 2×2 Contingency Table
Both the odds ratio and relative risk are indispensable measures when conducting analysis on bivariate categorical data. This data is typically organized within a 2-by-2 table, which systematically captures the frequency counts of outcomes (Event/Non-Event) across two distinct exposure or treatment groups (Treatment Group/Control Group).
The structure of the 2-by-2 table, commonly known as a contingency table, assigns specific letters (A, B, C, D) to the cell counts representing the intersections of exposure and outcome. This standardized notation is crucial, as these cell counts form the variables used in the subsequent OR and RR formulas.

In this standard layout, the cell definitions are:
A represents the number of events in the treatment group.
B represents the number of non-events (failures) in the treatment group.
C represents the number of events in the control group.
D represents the number of non-events (failures) in the control group.
Defining and Calculating the Odds Ratio (OR)
The Odds ratio (OR) provides a powerful summary statistic used to quantify the association between an exposure and an outcome. Specifically, it calculates the ratio of the odds of an event occurring in the exposed or treatment group relative to the odds of the event occurring in the unexposed or control group. It is often favored in case-control study designs where calculating true probabilities (and thus Relative Risk) is not possible.
The core concept of “odds” is defined as the probability of success divided by the probability of failure. When applied to the 2-by-2 table structure, the mathematical calculation for the OR involves the cross-product of the cell frequencies:
Odds Ratio = (Odds of Event in Treatment Group) / (Odds of Event in Control Group)
The formula simplifies in terms of cell counts (A, B, C, D) as:
Odds ratio = (A * D) / (B * C)
Defining and Calculating the Relative Risk (RR)
The Relative risk (RR), often termed the risk ratio, offers a direct comparison of incidence rates. It expresses the ratio of the probability (or risk) of an event occurring in a treatment group to the probability (or risk) of the event occurring in a control group. RR is best utilized in prospective studies, such as cohort studies or randomized controlled trials, where the entire population at risk is followed over time, allowing for direct probability calculation.
To calculate the RR, we first determine the proportion of events in each group (the risk). The risk in the treatment group is A / (A + B), and the risk in the control group is C / (C + D). The Relative risk is simply the ratio of these two probabilities:
Relative Risk = (Risk of Event in Treatment Group) / (Risk of Event in Control Group)
Expressed using the cell counts, the formula is:
Relative risk = [A / (A + B)] / [C / (C + D)]
Practical Example: Training Programs Analysis
To demonstrate these calculations in Excel, consider a study where 100 basketball players are enrolled. 50 players are assigned to a new training program, and 50 are assigned to the established old program. The outcome is whether each player passes or fails a specialized skills test.
The primary objective of this statistical analysis is to quantify the difference in passing rates between the two programs. The results are summarized in the following table, structured according to the standard A/B/C/D convention:

Based on this table, our cell values for Excel calculation are:
A (New Program, Passed) = 34
B (New Program, Failed) = 16
C (Old Program, Passed) = 39
D (Old Program, Failed) = 11
Calculating and Interpreting the Odds Ratio
We calculate the Odds ratio (OR) by implementing the cross-product ratio formula: (A*D) / (B*C). Substituting the values from the basketball program example:
OR = (34 × 11) / (16 × 39)
OR = 374 / 624
The calculated Odds ratio is approximately 0.599. This calculation is easily performed in Excel by referencing the corresponding cells containing A, B, C, and D.

The interpretation of 0.599 is crucial: because the OR is less than 1.0, the odds of success are lower in the new program group. Specifically, the odds that a player passes the test using the new program are only 0.599 times the odds that a player passes the test using the old program.
We can also express this as a reduction: the odds of passing are reduced by 40.1% (1 – 0.599) when using the new program, indicating that the traditional training method is associated with higher odds of success.
Calculating and Interpreting Relative Risk
To calculate the Relative risk (RR), we use the formula: [A/(A+B)] / [C/(C+D)]. Note that the total number of players in both the New Program group (A+B) and the Old Program group (C+D) is 50.
RR = [34 / (34 + 16)] / [39 / (39 + 11)]
RR = [34 / 50] / [39 / 50]
RR = 0.68 / 0.78
The resulting Relative risk is approximately 0.872. This means the risk of passing in the new program is 87.2% of the risk of passing in the old program.

Since this value is less than 1, it directly confirms that the probability of success is lower under the new program compared to the old one. We established this by calculating the individual probabilities:
Probability of passing under the New Program: 34 / 50 = 68%
Probability of passing under the Old Program: 39 / 50 = 78%
The relative risk of 0.872 precisely quantifies the relationship between these two probabilities.
Advanced Analysis: Calculating Confidence Intervals
When reporting OR or RR, it is standard practice to include confidence intervals (C.I.) to gauge the precision of the point estimate derived from the sample. A 95% C.I. defines a range of values within which the true population parameter is expected to fall 95% of the time, assuming repeated sampling.
Crucially, if the 95% C.I. includes the null value (1.0 for both OR and RR), the observed association is typically deemed not statistically significant at the standard 0.05 alpha level.
Confidence Interval for the Odds Ratio
The calculation of the 95% confidence interval for the Odds Ratio must utilize the natural logarithm (ln) transformation, as the distribution of the log odds ratio is closer to normal, which satisfies the assumptions required for standard statistical inference.
The formula requires calculating the Standard Error (SE) of the log Odds Ratio:
SE(ln(OR)) = √(1/A + 1/B + 1/C + 1/D)
Once the SE is determined, the 95% C.I. is calculated as:
95% C.I. for odds ratio = [ exp(ln(OR) – 1.96 * SE(ln(OR))), exp(ln(OR) + 1.96 * SE(ln(OR))) ]
For our training data, the 95% C.I. for the OR (0.599) turns out to be (0.245, 1.467). Since this interval spans 1.0, we conclude that the observed difference in odds of passing between the two programs is not statistically significant.
Confidence Interval for the Relative Risk
The 95% confidence interval for the Relative risk also relies on the log transformation. The formula for the Standard Error of the log Relative Risk, however, is structurally different from that used for the OR:
SE(ln(RR)) = √(1/A + 1/C – 1/(A+B) – 1/(C+D))
The overall C.I. is then constructed using the same exponentiation structure:
95% C.I. for relative risk = [ exp(ln(RR) – 1.96 * SE(ln(RR))), exp(ln(RR) + 1.96 * SE(ln(RR))) ]
Applying this to our calculated RR (0.872), the 95% C.I. is found to be (0.685, 1.109). As this interval also includes 1.0, we conclude that the observed reduction in risk associated with the new program is not statistically significant.

Conclusion and Further Resources
Calculating the Odds ratio and Relative risk in Excel is highly manageable, provided you organize your frequency data meticulously into a standard 2-by-2 table structure and apply the appropriate formulas. Furthermore, understanding how to compute and interpret the associated confidence intervals is essential for establishing the statistical significance and practical precision of your findings.
For more detailed information on interpreting these metrics and their application in various research contexts, consult the following resources:
Cite this article
stats writer (2025). How to Calculate Odds Ratio and Relative Risk in Excel Easily. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-to-calculate-odds-ratio-and-relative-risk-in-excel/
stats writer. "How to Calculate Odds Ratio and Relative Risk in Excel Easily." PSYCHOLOGICAL SCALES, 28 Dec. 2025, https://scales.arabpsychology.com/stats/how-to-calculate-odds-ratio-and-relative-risk-in-excel/.
stats writer. "How to Calculate Odds Ratio and Relative Risk in Excel Easily." PSYCHOLOGICAL SCALES, 2025. https://scales.arabpsychology.com/stats/how-to-calculate-odds-ratio-and-relative-risk-in-excel/.
stats writer (2025) 'How to Calculate Odds Ratio and Relative Risk in Excel Easily', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-to-calculate-odds-ratio-and-relative-risk-in-excel/.
[1] stats writer, "How to Calculate Odds Ratio and Relative Risk in Excel Easily," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, December, 2025.
stats writer. How to Calculate Odds Ratio and Relative Risk in Excel Easily. PSYCHOLOGICAL SCALES. 2025;vol(issue):pages.
