IF Function in Excel – Formula Explained with Examples

Home/Excel Formulas/IF Function in Excel – Formula Explained with Examples

What is the use of IF function?

IF Function in Excel helps us to check a condition, it returns one value if a specified condition is TRUE, or another value if the condtion is FALSE

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


What is the syntax of IF function?

IF Function in Excel- Syntax

IF( logical-text,

[value_if_true], [value_if_false] )

logical-text: it is a condition to test
[value_if_true]: value to be returend if the condition is satisfying/True
[value_if_false]: value to be returned if the condition is not satisfying/False

IF Function in Excel – Examples

IF Function in Excel- Example 1

Example 1: Returns “Fine” as the salary is not more than 2000
This example IF formula is checking if B14 cell values is greater than 2000 or not, it is printing as “Fine” as the cell value (2000) is not greater than 2000.

Example 2: Returns “Exceeded” as the salary is more than 3500
This example IF formula is checking if B15 cell values is greater than 3500 or not, it is printing as “Exceeded” as the cell value (4000) is greater than 3500.

Example 3: Returns “Fine” as the salary is more than 10000
This example IF formula is checking if B16 cell values is greater than 10000 or not, it is printing as “Fine” as the cell value (8000) is not greater than 10000.

Examples on IF With AND

IF - Example 2

Example 4: Returns “Fine” as the both conditions are satisfying
Example 5: Returns “Fine” as the both conditions are satisfying
Example 6: Returns “Exceeded” as the second condition is failing

Examples on IF With OR

IF - Example 3

Example 7: Returns “Good” as the both conditions are not satisfying
Example 8: Returns “Good” as the both conditions are not satisfying
Example 9: Returns “Not Good” as the second condition is satisfying

Examples on Nested IF Conditions

IF - Example 4

Example a: Returns “Less” as the first condition is satisfying
Example b: Returns “Less” as the second condition is satisfying
Example c: Returns “Less” as the third condition is satisfying

VBA example on IF function

IF function is also available in VBA, following is the example code:

Dim sOuput as String
Dim iVal as Integer
iVal=2000
If iVal < =3500 Then sOutput="Good" Else sOutput="Not Good" End If

Output: sOutput=Good

Reference:

Please refer the below article for more Logical Excel functions.
Logical Excel Formulas

Please refer the below article for more Excel Functions.
Excel Formulas | Home

LIMITED TIME OFFER
By |February 28th, 2013|Excel Formulas|0 Comments

About the Author:

Excel VBA Developer having around 8 years of experience in using Excel and VBA for automating the daily tasks, reports generation and dashboards preparation. Valli is sharing to helps us automating daily tasks.

Leave A Comment


Related pages


vlookup function helpsql server adodb connection stringoffset vlookupsumif function examplesconnect to sql server from excel vbaexcel isequalcreate userform excelrun macro without opening workbookexcel 2007 lookup functionexcel sumif exampleadd developer tab excel 2013excel macro activecelldefinition of merge in excelvlookup practiceexcel merge columnsfunctions in vba excelmicrosoft excel estimate templatesteps in creating a chart in excelexcel formula with example in hindivba xlsvb6 interview questionsexcel pivot table shortcut keyvba typesvba create macroms excel ribbonexcel vba print to pdfsas stands forvba button excelbar of pie chart excel 2010forgotten password in excel to unprotect sheetexcel macro open foldermacro excel 2007 tutorialexcel vba programming examples pdfvba sql query excelms excel schedule templatesample project timelinesvba clean functionms access find record vbasave vbamerge multiple columns in excelglobal variable in vbaif cell contains text then excelunprotect excel spreadsheet 2010how to join cells in excelexcel formula is not blankmacro programming in excelobjfso.opentextfileoption base 1 vbaproject charter ppt presentationhow to protect a workbook in exceldialog box vbadisplay developer tabcomplex pivot tablesvba excel password removerexcel vba softwareembed forms.combobox.1auto save excel 2010project analysis template excelconversion of xml file to excelhow to use sum if formulaassign macro to command buttoncopy file using vbscriptbutton excel vbajob costing excel templateexcel find duplicates in a columncopy file vb6vb opentextfileadding columns in excelvba set column widthexcel copy cell contentsexcel spreadsheet test for interviewddl dml dcl in sqlexcel formula columnexcel macro checkboxhow to use the vlookup function in excel 2010vb codingsvbyesno vbaexcel chart typesgenerate graph in excelexcel vba charts