Using-Functions
Using-Functions
in Excel
IF, AND, and OR
FUNCTIONS
Functions are pre-built formulas that perform
specific calculations or actions on data in your
spreadsheet. They automate complex
processes and save you time and effort.
IF FUNCTIONS
The IF function is the cornerstone of conditional logic in Excel. It
evaluates a condition and returns one value if true and another if
false. This function is essential for creating dynamic spreadsheets
and automating calculations based on specific criteria.
The AND function is a premade function in Excel, which returns TRUE or FALSE
based on two or more conditions.
Note: The AND function is often used together with the IF function.
=AND([logical1], [logical2], ...)
The conditions are referred to as [logical1], [logical2], and so on.
=IF(AND(B2>=40,C2>=40),"Pass","Fail")
COMBINING IF and OR
IF OR statement in Excel
To evaluate two or more conditions and return one result if any of the
conditions is TRUE, and another result if all the conditions are FALSE,
embed the OR function in the logical test of IF:
IF(OR(condition1, condition2,...), value_if_true, value_if_false)
Formula Description
=OR(A2>1,A2<100) Displays TRUE if A2 is greater than 1 OR less than 100,
otherwise it displays FALSE.
=IF(OR(A2>1,A2<100),A3,"The value is out of range") Displays the value in cell A3 if it is greater than 1 OR less
than 100, otherwise it displays the message "The value is
out of range".
=IF(OR(A2<0,A2>50),A2,"The value is out of range") Displays the value in cell A2 if it’s less than 0 OR greater
than 50, otherwise it displays a message.
COMBINING IF, AND, AND OR
You can create powerful formulas by combining the IF. AND, and OR functions. This allows for
sophisticated logic in your spreadsheets, enabling you to handle complex decision- making processes
and perform advanced data analysis effectively.