• Around The HomeToggle Menu

    • Entertainment
    • Productivity
    • Smart Home
  • FamilyToggle Menu

    • Parenting
    • Toys
    • Pets
    • Travel
  • Product ReviewsToggle Menu

    • Phones
    • Tablets
    • Laptops
    • Desktops
    • Wearables
    • Audio
    • Cameras
    • Headphones
    • Printers
    • Smart Home
    • TVs
    • Gaming and Video
  • One Cool ThingToggle Menu

    • Frugal Tech
    • Kickstarters
    • Videos
Techwalla
  1. Home
  2. Around The Home
  3. Productivity
  4. How to Use Conditional Statements in Excel

How to Use Conditional Statements in Excel

March 31, 2015
By: Zicheng Ren
  • Share
  • Share on Facebook

Excel allows you not only to make a table of data but also to process the data with features that include sorting, filtering and inserting functions. Using conditional statements in Excel is especially useful for obtaining results under a specified condition when processing a large quantity of data. The IF, COUNTIF and SUMIF functions are the most commonly used conditional statements in Excel.

Video of the Day

...
Type the arguments in the conditional statement.
credit: Courtesy of Microsoft

How to Use the IF Condition

...
Click Formulas.
credit: Courtesy of Microsoft

Open the XLSX file containing the data you want to process and click Formulas in the ribbon.

...
Choose a table cell.
credit: Courtesy of Microsoft

Click one table cell that you want to fill with the result of a calculation. For this, example, D4 is the profit data, which can be calculated by applying the conditional statement on the data from Sales and Target.

...
Choose IF.
credit: Courtesy of Microsoft

Choose IF from the Logical drop-down list in the Function Library section.

...
Type conditional statements in the Function Arguments.
credit: Courtesy of Microsoft

Type the value or expression that you want to evaluate in the Logical_test box. Type the value or expression to return if the Logical_test is true in the Value_if_true box. Type the value or expression to return if the Logical_test is false in the Value_if_false box. Click OK to continue. For example, type a condition statement to check whether the Sales data is greater than the Target data. If the statement is true, Excel returns the profit according to the equation in Value_if_true; if the statement is false, it returns zero for the profit according to Value_if_false.

...
Check the result.
credit: Courtesy of Microsoft

Check the result in the table cells.

How to Use COUNTIF and SUMIF Functions

...
Choose a table cell.
credit: Courtesy of Microsoft

Choose a table cell you want to fill with the result of the COUNTIF calculation.

...
Type the COUNTIF() function.
credit: Courtesy of Microsoft

Type the COUNTIF function in the Insert Function bar. For example, type COUNTIF(C1:C5,"<4.0") to count how many entries exist with a value less than 4.0 among the entries from C1 to C5.

...
Press Enter and check the result.
credit: Courtesy of Microsoft

Press Enter to see the result in the table cell. Check the result. For example, COUNTIF returned 1 because there was only one cell with a value less than 4.0 in the example data.

...
Choose a table cell.
credit: Courtesy of Microsoft

Choose a table cell you want to fill with the result of the SUMIF calculation.

...
Type the SUMIF() function.
credit: Courtesy of Microsoft

Type the SUMIF function in the Insert Function bar. For example, type SUMIF(B2:C5,">3.0") to sum the entries with values greater than 3.0 among the cells from B2 to B5.

...
Press Enter and check the result.
credit: Courtesy of Microsoft

Press Enter to see the result in the table cell. Check the result. For example, SUMIF returned 22.3 by adding up the values from B2 to B5 that were over 3.0.

Show Comments

Related Articles

How to Build Computer Software

How to Build Computer Software

Around The Home
Productivity
By: Warren Rachele
How to Convert Gigabytes to Hours

How to Convert Gigabytes to Hours

Around The Home
Productivity
By: C. Taylor
How to Use Multiple IF Statements in Microsoft Excel

How to Use Multiple IF Statements in Microsoft Excel

Around The Home
Productivity
By: Paul Higgins
How to Make a Calculator With Visual Basic

How to Make a Calculator With Visual Basic

Around The Home
Productivity
By: Violet Mabe
List of JSP Tags

List of JSP Tags

Around The Home
Productivity
By: Jackie Lohrey
How to Use Excel for Bookkeeping

How to Use Excel for Bookkeeping

Around The Home
Productivity
By: Jessica Kent
  • HOW WE SCORE
  • ABOUT US
  • CONTACT US
  • TERMS
  • PRIVACY POLICY
  • COPYRIGHT POLICY
  • Advertise

An error occurred. Try again later.

Thanks for signing up!
© 2018 Leaf Group Ltd. Leaf Group Media

Get great tech advice delivered to your inbox.

Keep your family productive, connected, entertained, and safe.

Please enter a valid email.