Table of Contents
Conditional probability is a statistical concept that measures the likelihood of an event occurring given that another event has already occurred. In Excel, conditional probability can be calculated using the formula =P(A|B), where A represents the event for which the probability is being calculated and B represents the event that has already occurred. This formula can be applied using the built-in function “PROB” or by creating a table of values and using the “COUNTIFS” function to count the number of times the events A and B occur together. Additionally, the “IF” function can be used to create logical statements to calculate conditional probabilities for specific conditions. By utilizing these functions and formulas, Excel can effectively calculate conditional probabilities to assist in statistical analysis and decision making.
Calculate Conditional Probability in Excel
The conditional probability that event A occurs, given that event B has occurred, is calculated as follows:
P(A|B) = P(A∩B) / P(B)
where:
P(A∩B) = the probability that event A and event B both occur.
P(B) = the probability that event B occurs.
This formula is particularly useful when calculating probabilities for a two-way table, which is a table that displays the frequencies (or “counts”) for two categorical variables.
For example, the following two-way table shows the results of a survey that asked 300 people which sport they liked best: baseball, basketball, football, or soccer. The rows display the gender of the respondent and the columns show which sport they chose:

This is a two-way table because we have two : gender and favorite sport.
Next, we’ll show how to calculate conditional probabilities for two-way tables in Excel.
How to Calculate Conditional Probability in Excel
Suppose we’re interested in answering questions like:
What is the probability that a respondent is male, given their favorite sport is baseball?
We can find the answer by using the conditional probability formula:
P(male|baseball) = P(male∩baseball) / P(baseball) = (34/300) / (68/300) = 0.5
Thus, the probability that a respondent is male, given their favorite sport is baseball, is 0.5 (or 50%).
We can calculate conditional probabilities for other scenarios in the table using a similar formula. The image below shows how to calculate every conditional probability in the table, along with the formula used:

Notice that for every conditional probability calculation, we’re simply using the conditional probability formula of P(A|B) = P(A∩B) / P(B).
For example, the probability that a respondent’s favorite sport is soccer, given they are female, is calculated as:
P(soccer|female) = P(soccer∩female) / P(female)
Out of the 300 respondents, there are exactly 44 who are female and prefer soccer as their favorite sport, thus P(soccer∩female) = 44/300.
And out of the 300 respondents, there are 150 who are female, thus P(female) = 150/300.
Thus, P(soccer|female) = P(soccer∩female) / P(female) = (44/300) / (150/300) = 0.2933.
We perform a similar calculation for every conditional probability scenario.
Cite this article
stats writer (2026). How to Calculate Conditional Probability in Excel: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-you-calculate-conditional-probability-in-excel/
stats writer. "How to Calculate Conditional Probability in Excel: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 7 Mar. 2026, https://scales.arabpsychology.com/stats/how-do-you-calculate-conditional-probability-in-excel/.
stats writer. "How to Calculate Conditional Probability in Excel: A Step-by-Step Guide." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-do-you-calculate-conditional-probability-in-excel/.
stats writer (2026) 'How to Calculate Conditional Probability in Excel: A Step-by-Step Guide', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-you-calculate-conditional-probability-in-excel/.
[1] stats writer, "How to Calculate Conditional Probability in Excel: A Step-by-Step Guide," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, March, 2026.
stats writer. How to Calculate Conditional Probability in Excel: A Step-by-Step Guide. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.
