Open In App

How to Calculate Conditional Probability in Excel?

Last Updated: 04 Jan, 2023

S

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Conditional probability is calculating the probability of an event provided the event associated is already done. In other words, If we have to find the conditional probability of two events suppose A and B, then we are finding the probability of event A happening given that event B has already occurred. The formula of conditional probability having events A and B are as follows:

P (A|B) = \frac{P(A\cap{B})}{P(B)}

Steps to Calculate Conditional Probability in Excel

For example, The data below represents a population of a town that uses social networking sites namely LinkedIn and Facebook. The data shows the number of people using Facebook and Using LinkedIn, the number of people using Facebook but not using LinkedIn, and so on. The total population taken is 200.

Dataset-to-calculate-conditional-probability

 

Now, we need to calculate,

  • Probability of people using Facebook. P(Use Facebook)
  • Probability of people using Facebook and using LinkedIn. P(Use Facebook AND Use LinkedIn)
  • The conditional probability of people using Facebook who also uses LinkedIn. P(Use Facebook| Use LinkedIn)
  • The conditional probability of people using LinkedIn who also uses Facebook. P(Not Use LinkedIn| Use Facebook)

Calculating Probability of People using Facebook (Use Facebook)

Step 1: Divide the total number of Facebook users by the total number of users. The formula for this is =F3/F5.

Using-formula-for-probability

 

Step 2: Press Enter key and you’ll get the results.

use-facebook-output

 

Calculating Probability of People Using Facebook and Using LinkedIn. P(Use Facebook AND Use LinkedIn)

Here, we need to calculate the probability of people who uses Facebook and LinkedIn. 

Step 1: Find the number of people who uses Facebook and LinkedIn.

Step 2: Apply the formula in the cell where you want your results to appear =D3/F5.

use-facebook-and-use-linkedin-formula

 

Step 3: Press Enter key and you’ll get the results.

use-facebook-and-use-linkedin-output

 

Calculating Conditional Probability of People Using Facebook Who Also Use LinkedIn. P(Use Facebook| Use LinkedIn)

Step 1: Find the number of people who uses Facebook and LinkedIn.

Step 2: Apply the formula in the cell where you want your results to appear =D3/D5. The only change in this question is we need to find the probability among people who use LinkedIn irrespective of their usage of Facebook. i.e the population or the sample space has changed to all the people who use LinkedIn.

P(Use Facebook| Use LinkedIn)

 

Step 3: Press Enter key and you’ll get the results.

use-facebook-conditional-probability-output

 

Calculating Conditional Probability of People not Using LinkedIn Who Also Use Facebook P(Not Use LinkedIn| Use Facebook)

Step 1: Find the number of people who uses Facebook and don’t use LinkedIn.

Step 2: Apply the formula in the cell where you want your results to appear =E3/F3. The only change in this question is we need to find the probability among people who don’t use LinkedIn irrespective of their usage of Facebook. i.e the population or the sample space has changed to all the people who use Facebook.

Final-output

 

Step 3: Press Enter key and you’ll get the results.

Output:

Output

 



S

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

How to Apply Conditional Formatting in a Pivot Table in Excel

article_img
One of the most useful ways to customize the pivot table formatting is using Conditional Formats. Conditional formatting rules can be applied to Pivot tables just like they can be applied to normal data ranges. So by using conditional formatting, we can highlight the cells with a certain color depending on the cell's value. Conditional FormattingWhat is Pivot Table Conditional Formatting In Excel, you have the power to make your data stand out using conditional formatting. This means you can automatically highlight cells that meet certain criteria. For example, you can easily spotlight cells that have values above the average or those that fall below a specific threshold. Now, when you apply this special formatting to a Pivot table, there is an important step to remember. After you've set up your conditional formatting, make sure to tweak the settings so that even after you refresh the Pivot table, the right cells maintain their distinctive appearance. This ensures that your highlighted information remains accurate and up-to-date as your data evolves. Types of Conditional Formatting in ExcelThere are many conditional formats that we can use on our data. Some of them are given below
Read More

I

How to Apply Conditional Formatting Based On VLookup in Excel?

VLOOKUP is an Excel function to lookup data in a table organized vertically. VLOOKUP supports approximate and exact matching, and wildcards (* ?) for partial matches. Conditional Formatting Based on Vlookup: 1. Using the Vlookup formula to compare values in 2 different tables and highlighting those values which is only present in table 1 using conditional formatting. We have a Table containing old products of any grocery shop in 'Old Product' sheet and an updated table having new products in worksheet 'New'. We want to highlight rows in New table containing those items which are not in Old Product Table. Old Product Select the data from New table except the Headers. (The table in which we want to highlight rows.)Go to Home->Conditional Formatting->New Rule. In the dialog box appeared, Select the rule type - "Use a formula to determine which cells to format;";Under Edit the rule description enters the following formula: =ISNA(VLOOKUP($A2,'Old Product'!$A$1:$B$8,1,FALSE))Then click Format. Formula explanation: Inside VLOOKUP, 1st parameter is $A2 which is first name in New table.2nd parameter is Old Product Table.3rd parameter is column we want to compare which is 1 as we wan
Read More

How to use Conditional Formatting in Excel?

article_img
Microsoft Excel is a software that allows users to store or analyze the data in a proper systematic manner. It uses spreadsheets to organize numbers and data with formulas and functions. MS Excel has a collection of columns and rows that form a table. Generally, alphabetical letters are assigned to columns, and numbers are usually assigned to rows. The point where a column and a row meet is called a cell. Conditional formatting is a feature in Excel that allows you to format/highlight few particular cells that meet the condition specified or selected by you. You can find it in the home tab under the Styles group. Steps to use Conditional Formatting: Step 1: Insert the data/values in the spreadsheet. Step 2: Select the range of cells. Step 3: Click on the Conditional formatting in the Home tab. Step 4: Select any predefined condition or create your own condition(for this select New Rule). For example, we need to: Highlight marks which are more than 70.Highlight marks which are between 50 and 80.Highlight marks that are below average.Set icons on the marks.Show data bars on the marks.Steps to highlight marks that are more than 70 Step 1: Insert the data in the spreadsheet, we enter t
Read More

C

How to Add a Conditional Column in Power Query in Excel?

We may use Power Query to generate new columns whose values depend on one or more criteria that have been applied to existing columns in your database. The condition imposed on an existing column in the data model serves as the foundation for Power BI's conditional column. On the Add column tab, in the General category, is the Conditional column command. In this article, we are going to discuss the Conditional column in Power Query and in Power Pivot queries. Step By Step Implementation Step 1: Create an excel table with fields Roll No., Student name, and Marks. Step 2: Select a table. Then navigate to the data tab on the top of the ribbon and select the Get Data option and then go to from other sources and choose from Table/range. Step 3: Then create a Table dialog box appear. Here select the range and check my table has headers then click on OK. Step 4: Now as you can see the excel table is converted to a power query editor. Step 5: Now in the power query go to the add column tab on the top of the ribbon and here select the conditional column. Step 6: Add Conditional Column dialog box appears. Here write the new column name and then apply the if condition. Step 7: Her
Read More

Conditional Formatting in Excel: Basic to Advanced Guide

article_img
How to Do Conditional Formatting in Excel: Quick StepsSelect the Cells to FormatGo to the Home Tab >> Click on Conditional FormattingChoose a Formatting RuleSet Your Condition and Formatting StyleClick OKEver stared at a spreadsheet full of numbers and wished it could show you what’s important instead of making you guess? Conditional formatting in Excel does exactly that—it turns raw data into visual insights with just a few clicks. Whether you’re tracking sales trends, monitoring project deadlines, or analyzing survey results, this feature helps you spot patterns, highlight outliers, and make data-driven decisions faster.This guide covers everything from basic conditional formatting to advanced conditional formatting techniques, including how to highlight cells based on values, use color scales to visualize data, and flag duplicate cells automatically. You’ll also learn to create custom rules with formulas and clean up your sheets by removing outdated formatting. How to Use Conditional Formatting in ExcelTable of ContentWhat is a Conditional Formatting in ExcelHow to Use Conditional Formatting to Highlight cells Based on Another Cell in Excel1. Highlight Cells Based on Value
Read More

Editing Excel Macros in Excel

article_img
Excel Macro is a set of actions that can be recorded, saved, used multiple times. This feature saves us a lot of time when dealing with repetitive tasks and huge data sets. We can always make changes to an existing Macro in Excel. There are two ways to record and run macros: Excel Commands Excel Visual Basic for Applications(VBA).1. Copying a Macro Code We can reuse the existing macro code while creating new Macros. For example, if you have existing macros created using the record function, we can reuse the code to write new macros. To open the code follow the below steps: Select Tools --> Macros --> Visual Basic Editor. Copy code from the existing macros(use Command + C) and paste(use Command + V) in the new macro2. Renaming a Macro Follow the below steps to rename a Macro in Excel: Select Tools --> Macros --> Visual Basic Editor. Select name on the left plane.Edit the name.3. Deleting a Macro Follow the below steps to delete a macro in Excel: Select Tools --> Macros --> Macros... Select the macro to be deleted. Click on the minus(-) symbol at the bottom.Select yes to delete the macro.
Read More

Best Microsoft Excel High-Paying Jobs with Excel Skills in 2024

article_img
Are you ready to unlock a world of opportunities with Microsoft Excel? In today’s data-driven job market, mastering Excel is essential for launching a successful career, whether you're a fresher or an experienced professional. In this article, we will cover the high-paying Excel jobs available in 2024, including crucial roles like data analyst, business analyst, and many more. We'll explore the qualifications needed for these positions, along with salary estimations to help you understand your earning potential. Whether you’re looking for Excel jobs for freshers or seasoned professionals, we’ll also dive into options for Excel freelancing jobs and work-from-home jobs in Excel. Equip yourself with the knowledge to excel in your career and take the first step toward a lucrative future!Best Microsoft Excel High-Paying Jobs with Excel Skills in 2024Table of ContentWhy choose a career in ExcelWhy Excel Skills Are Essential for Your CareerEssential Excel Skills Required to Boost Your Resume Best Microsoft Excel High-Paying JobsFinancial AnalystsData AnalystAdministrative Assistant Accountants Project ManagersManagement ConsultantRetail Store ManagersBusiness Analyst Market Research A
Read More

Excel VLOOKUP Function - Excel Guide for Beginners

article_img
How to do Vlookup in Excel - Quick StepsPrepare Your DataEnter the VLOOKUP Formula >>Press EnterUse a Cell Reference for Flexibility Copy the Formula for Multiple RowsThe VLOOKUP function is one of the most widely used tools in Excel for looking up and retrieving data from a table. Whether you’re working with a single sheet or multiple workbooks, VLOOKUP allows you to search for a value in one column and return a related value from another. If you're new to Excel or still getting the hang of formulas, this guide is for you. We will cover everything from the basics of how VLOOKUP works to practical examples that show how to search data across sheets, troubleshoot common issues, and master the VLOOKUP formula for any task.Excel VLOOKUP FunctionWhat is the VLOOKUP Function in ExcelThe term VLOOKUP stands for Vertical Lookup. It is designed to search for a specific value in the first column of a table (lookup column) and retrieve corresponding data from a different column in the same row.Syntax of VLOOKUP FormulaVLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])Arguments:1. lookup_value: The value you want to search for (e.g., a specific ID, name, or product code).
Read More

AI in Excel: Top 20 Excel AI Tools in 2025 (Free/Paid)

article_img
The integration of AI in Excel is transforming the way professionals manage, analyze, and visualize data. Whether you're handling large datasets, performing financial analysis, or automating repetitive tasks, AI-powered tools can significantly improve efficiency and accuracy. In 2025, advanced Excel AI tools are making complex tasks easier by offering features like data cleaning, predictive analytics, smart automation, and AI-driven insights.In this guide, we’ve gathered a list of the top 20 Excel AI tools for 2025 that are reshaping how users interact with Excel.Table of ContentBest AI Tool in Excel: Top Picks for 2025Top 10 Free Excel AI Tools in 2025Top 10 Excel AI ToolsAI in Excel: OverviewIn Excel, an AI tool (Artificial Intelligence tool) refers to an add-in or extension that leverages artificial intelligence to enhance your spreadsheet experience. These tools can automate tasks, improve data analysis, and generally make you more productive.Excel has always been a powerful tool for data analysis, but with the integration of AI tools, it has transformed into a smarter, more intuitive platform.Best AI Tool in Excel: Top Picks for 2025Explore the below AI tools designed for auto
Read More

K

How to Calculate Mean Absolute Error in Excel?

Mean absolute error is the measure of error between the observed and the expected values in a given data set. Where, O stands for Observed values,E stands for Expected values,n stands for total no. of observations. Now let us understand it with the help of an example. Example: Follow the below steps to calculate MAE in Excel: Step 1: Suppose we have the following data: Step 2: According to formulae, let's calculate the difference between the observed and the expected values. Step 3: Now let's calculate the absolute values. Step 4: Now we know from the data that n= no of observations and in this the value of n=5. And also the let's calculate the total sum of |O-E|. Step 5: Now we have the value of Sum of |O-E| and the value of n. Now according to formulae, the Mean Absolute Error is calculated as: Step 6: So the value of MAE is:
Read More
three90RightbarBannerImg