This article was co-authored by wikiHow staff writer, Kyle Smith . Kyle Smith is a wikiHow Technology Writer, learning and sharing information about the latest technology. He has presented his research at multiple engineering conferences and is the writer and editor of hundreds of online electronics repair guides. Kyle received a BS in Industrial Engineering from Cal Poly, San Luis Obispo. The wikiHow Tech Team also followed the article's instructions and verified that they work. This article has been viewed 122,844 times. Learn more...

This wikiHow guide will show you how to use the IF function in Microsoft Excel to create logic formulas. If-else statements indicate that one value should appear “if” a condition is met, “else” show a different value if the condition isn’t met. The IF function allows you to evaluate a condition and output a different value for when the condition is true or false. You can add in AND, OR, and NOT functions to create more complex logical conditions. Use nested IF statements to create multiple conditions that must be met and different paths.

  • Use =IF(logical_test, [value_if_true], [value_if_false]) to create an if-else statement.
  • Add AND, OR, or NOT functions to evaluate more complex situations.
  • Create nested IF statements to evaluate multiple conditions at different levels.
  • {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/6\/64\/Use-If%E2%80%90Else-in-Excel-Step-2.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-2.jpg","bigUrl":"\/images\/thumb\/6\/64\/Use-If%E2%80%90Else-in-Excel-Step-2.jpg\/v4-728px-Use-If%E2%80%90Else-in-Excel-Step-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><p>License: <a target=\"_blank\" rel=\"nofollow noreferrer noopener\" class=\"external text\" href=\"https:\/\/en.wikipedia.org\/wiki\/Fair_use\">Fair Use<\/a> (screenshot)<br>\n<\/p><\/div>"}
    Open Excel and click Blank Document . This will create a new spreadsheet . If Excel has already opened to a blank spreadsheet, you can skip this step.
    • Alternatively, open an existing Excel file if you already have a dataset you want to apply the IF function to.
    {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/3\/3a\/Use-If%E2%80%90Else-in-Excel-Step-2-Version-2.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-2-Version-2.jpg","bigUrl":"\/images\/thumb\/3\/3a\/Use-If%E2%80%90Else-in-Excel-Step-2-Version-2.jpg\/v4-728px-Use-If%E2%80%90Else-in-Excel-Step-2-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><p>License: <a target=\"_blank\" rel=\"nofollow noreferrer noopener\" class=\"external text\" href=\"https:\/\/en.wikipedia.org\/wiki\/Fair_use\">Fair Use<\/a> (screenshot)<br>\n<\/p><\/div>"}
    Enter the data you want to evaluate. For example, you might have two columns of numbers in columns A and B. You can compare these numbers using an IF formula to see if they’re the same number.
    Advertisement
    {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/a\/a6\/Use-If%E2%80%90Else-in-Excel-Step-3-Version-2.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-3-Version-2.jpg","bigUrl":"\/images\/thumb\/a\/a6\/Use-If%E2%80%90Else-in-Excel-Step-3-Version-2.jpg\/v4-728px-Use-If%E2%80%90Else-in-Excel-Step-3-Version-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><p>License: <a target=\"_blank\" rel=\"nofollow noreferrer noopener\" class=\"external text\" href=\"https:\/\/en.wikipedia.org\/wiki\/Fair_use\">Fair Use<\/a> (screenshot)<br>\n<\/p><\/div>"}