Logical Functions if Sumif Countif
Logical Functions if Sumif Countif
IF Function
The IF function is one of Excel's logical functions that evaluates a certain condition and returns the value
you specify if the condition is TRUE, and another value if the condition is FALSE.
=IF(Condition,True,False)
Another way of interpreting what the IF function is doing is:
Operator Explanation
= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to
If you only want text to appear if the result is true, you can
enter ““ (two double quotes) in the position for false – E.G.
=IF(C7>=$E$2,“Exceeded Target“,““)
Nesting IF functions
If you need to make more than one decision before calculating an answer, you can nest or embed an IF
function inside an IF function. You use additional IF functions in place of the true component of the IF
function. If the result of the first conditional test is true, then the 2nd argumant is executed and that's it. If on
the other hand the result of the first conditional test is false, then the second (nested) IF function re
evaluates with a second conditional test.
This structure allows for multiple conditional tests to be run in the event of the precendeing test being false
Another way of thinking about what the nested Ifs do could be to say:-
Test the highest value first then keep going in the same direction.
For example, we first work out did they score over 85, then over 75,
thenover 70 and so on
COUNTIF function
The COUNTIF function counts only those values in a list that meet a criteria you set in the function. For example
looking at the list below we can use the COUNTIF function to count all the YES entries in column I.
SUMIF function
The SUMIF function will allow you add up only those values that meet the criteria you set. For example in the data
above you could add up all the salaries above £20,000, thus:-
=SUMIF(H19:H44,”>=20000”)
Criteria – so
Data to be only add up
evaluated values where
this is true