IF function

2016-04-25

This function allows you to test a logical statement and return one value if it’s true and another value if the statement is false.

 

Syntax

 

IF(Expression, Value if true, Value if false)

 

  • Expression (required) – This is the expression you want to test.
  • Value if true (required) – This is the result the function will return if the expression is true.
  • Value if false (optional) – This is the result the function will return if the expression is false. If nothing is entered here the function will return FALSE when the expression is false.

 

Example

 

In this example we use the formula IF(A2=”Donald Trump”,”Lame”,”Not Lame”). If the value in A2 is “Donald Trump” then the result is “Lame”, if it’s any other value the result is “Not Lame”.

 

IF function

 

[download id=”127″]

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Subscribe

Related Articles

IFNA function

This function will return a specified value if your given expression results...

read more

TRUE function

This function will return the TRUE value. This is the same as just entering...

read more

FALSE function

This function will return the FALSE value. This is the same as just entering...

read more

Comments

1 Comment

  1. Jagbir Singh

    Hi,

    Noticed the picture of Abu. He/She is very cute. I am very sorry to know you have lost Abu. We have recentlly lost our family dog – Fluffy. He was born on 10-Nov-2007 and left us on 20-Aug-2020. Almost the same times as Abu, lagging by 4 months on each end. He was a small white pomeranian and has left quite a hole in our hearts. I understand how painful Abu’s loss would have been. Please accept my heartfelt condolences.

    With best regards.
    Jagbir

Get The Latest News

Follow Us

Follow us on social media to stay up to date with the latest tips in Excel!

Pin It on Pinterest