EXCEL TIP: The IF Statement made simple

August 16, 2017

One of the functions we use most often in Excel is the IF statement.

 

This function is very powerful and to many can seem very complicated, whereas to others it is deceptively simple and its power can be underestimated.


The basic format of an IF statement is as follows:

 

=IF(if this is true,return this,otherwise return this)


 

Example:

 

=IF(A2>7,"Greater than Seven","Not greater than Seven")

 

returns the text Greater than Seven if the number in cell A2 is greater than 7 and Not greater than Seven, if it is not.

The first argument can be any expression that can be true or false, usually using =,>,<,<=,>= or <>.

Other Examples:

 

=IF(A3="X","Yes","No")

=IF(SUM(A2:A10)>B2,"Over Budget","Within Budget")

=IF(A2<0,0,A2)

 

Combining conditions


All of the above examples include only one condition, but it is possible to combine numerous conditions using the AND and OR functions.

 

Theses functions are formatted as follows:

=AND(Condition 1, Condition 2, Condition 3.....Condition n)
=OR(Condition 1, Condition 2, Condition 3.....Condition n)

The AND function returns TRUE if ALL of the individual conditions are true.

The OR function returns TRUE if ANY of the individual conditions are true.

They can be used in IF statements as follows:

=IF(AND(A2<=200,A2>=100),"In Range","Out if Range")
=IF(OR(A2="X",B2="X",C2="X"),"Contains X","Doesn't Contain X")

Share on Facebook
Share on Twitter
Please reload

Featured Posts

VAT Payment Holiday is over

August 4, 2020

1/10
Please reload

Recent Posts
Please reload

Archive
Please reload

Follow Us
  • LinkedIn Social Icon
  • Facebook Basic Square
  • Twitter Basic Square
Making the
Numbers Count
  • LinkedIn Social Icon
  • Facebook Social Icon
  • Twitter Social Icon