How to apply conditional formaules like if, countif


3 Answer(s)


All conditional formulae are used when you encounter a logical decision making step usually binary e.g. yes or no / true or false / if this then this or else that... etc

countif is more specific if statement in that you count the no of instances when the statement/condition returns "true"

Using IF function in Excel

--Syntax
IF( condition, [value_if_true], [value_if_false] )

--Parameters or Arguments

1) condition is the value that you want to test.

2) value_if_true is optional. It is the value that is returned if condition evaluates to TRUE.

3) value_if_false is optional. It is the value that is returned if condition evaluates to FALSE.

--Example
=IF(Sales>60, "PROFIT", "LOSS")

--NESTED IF
IF( condition1, value_if_true1, IF( condition2, value_if_true2, value_if_false2 ))

--Example
=IF(Total>300,"A", IF(Total>150,"B", "C"))

--COUNTIF

COUNTIF function counts the number of cells in a range, that meets a given criteria.

--Syntax
COUNTIF( range, criteria )

--Example
=COUNTIF(A2:A7, ">=2001")