• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About

Excel IF Function

The IF function tests a condition and takes an alternative action depending on the result. It is a logical function and gets Excel to think for itself.

For example, if the sales total in cell B4 is higher than £1500 then calculate the commission, and if not then leave the value as it is.

The IF function can only test one condition. Because of this limitation, it is often combined with other functions like AND and OR that can check multiple conditions.

The syntax for the IF function is:

=IF(logical_test, [value_if_true], [value_if_false])

ArgumentPurpose
Logical_testThe condition to be tested
Value_if_trueThe action to be taken if the result is true
Value_if_falseThe action to be taken if the result is false

Logical operators

Conditions are tested using logical operators.

OperatorActionExampleResult
=Equals To5=5True
>Greater Than10>5True
<Less Than10<5False
>=Greater Than or Equal To10>=8False
<=Less Than or Equal To10<=10True
<>Not Equals To10><10False

IF function examples

Cell B4FunctionResult
1600=IF(B4>=1500, “Well done”, “Unlucky”)Well done
1050=IF(B4>=1500, B4*0.1, B4)1050
50=IF(B4=200, “Bingo”, 0)0
2000=IF(B4>1500, B4-B4*0.05, “No discount”)1900

Double quotations “” are used to tell Excel to accept the text literally. Any text to be displayed in a cell should be enclosed with double quotations.

Primary Sidebar

Popular Posts

  • Excel Fixtures and League Table Generator
  • 5 Reasons Why your Excel Formula is Not Calculating
  • Excel IF Function Contains Text – A Partial Match in a Cell
  • Excel Formula to Display the Sheet Name in a Cell
  • 4 Alternatives to Nested IF Formulas
  • How to Hyperlink to a Hidden Worksheet in Excel
  • How to Create a Reverse FIND Formula
  • Check if a Value is an Even Number
  • Conditional Formatting Multiple Columns – 3 Examples
  • IF Function in Power Query Including Nested IFS

Recent Posts

  • SEQUENCE Function in Excel
  • Sort by Drop Down List in Excel
  • Advanced SUM Function Examples – The Power of SUM
  • Display Negative Time in Excel
  • Lookup Multiple Values in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2020 Computergaga · All Rights Reserved ·