Include your email address to get a message when this question is answered. If you want to reverse existing logic, you can use the NOT function. Images were taken using Excel 2016. Nicole Levine is a Technology Writer and Editor for wikiHow. The IF function has the concept of "else" built-in. That's because we only have two possible values, and the ELSE part of the formula (the FALSE result) logically takes care of "L" for us: if the cell doesn't contain "S", it must be "L". IF statements are incredibly robust, and form the basis of many spreadsheet models, but they are also the root cause of many spreadsheet issues. As a worksheet function, the IF function can be entered as part of a formula in a cell of a worksheet. We use cookies to make wikiHow great. For example, to "pass" scores above 70: =IF(A1>70,"Pass","Fail"). In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. See details here. More than one condition can be tested by nesting IF functions. Use the IF function in combination with the AND function and the OR function and become an Excel expert. We put the second IF statement, replacing the false result. If a cell in column D contains "S", return "Small". Logical_test1 – Read more. By Tepring Crocker May 12, 2016 Categories: Conditional Formatting, Excel® Tags: If/Then Conditional formatting *Steps in this article will apply to Excel 2007-2016. This wikiHow teaches you how to create a logical formula using nested IF statements in Microsoft Excel. ElseIf tests if a condition is met ONLY if the previous conditions have not been met. =IF (Something is True, then do something, otherwise do something else) So an IF statement can have two results. It is possible to nest multiple IF functions within one Excel formula. An if can have zero to many elseif's and they must come before the else. In the previous example we tested if a cell value is positive. Excel 2010 Quick Tip: If Then and If Then Else. The formula you create will use the following syntax: Open Microsoft Excel. Using If..ElseIf..Else with excel. Description. Generally, the Excel IF function evaluates where a cell is Blank or Not Blank to return a specified value in TRUE or FALSE arguments. Else_value (value_if_false): This final parameter is optional. We are starting with very easy example, here in Cell A2 We will enter a short name of day and in Cell … Get over 100 Excel Functions you should know in one handy PDF. When an If...Then...Else statement is encountered, condition is tested. When a True If with Index Match - left vlookup with If condition. There are only these two sizes in the data. We will be working on an interesting example to show you the if function with 3 conditions. In other words, we want to check the color in column B, and then leave a marker (x) if we find the word "red" or "green". The experiment will be selecting a bowler based on his performance. For example, to "pass" scores above 70: =IF (A1>70,"Pass","Fail"). Syntax % of people told us that this article helped them. This article explains how to use the IF-THEN function in Excel for Microsoft 365, Excel 2019, 2016, 2013, 2010; Excel for Mac, and Excel Online, as well as a few examples. Otherwise, the else_value behaves in the same way as the then_value. This means you can't use IF by itself to test for text that may appear anywhere in a cell. Usually, nested IFs are used when you need to test more than one condition and return different results depending on those tests. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article was written by Nicole Levine, MFA. By signing up you are agreeing to receive emails according to our privacy policy. Experienced Excel users know that the VLOOKUP … In the example shown, we want to mark or "flag" records where the color is red OR green. An if can have zero or one else's and it must come after any elseif's. In the example shown, the formula in cell E5 is: If you need to test a condition, then take one action if the condition is TRUE, and another action if the condition if FALSE, you can use the IF function. For example, take a look at the IF function in cell D2 below. This article describes the Excel nested IF construction. To test a condition, and take one action if the condition is TRUE, and another action if the condition if FALSE, you can use the IF function. The ElseIf is added to an existing If statement. In this video we look at how to combine the IF function with the OR and AND functions to test more than one condition at the same time. Once an else if succeeds, none of the remaining elseif's or else's will be tested. Notice we are only testing for "S" — we don't need to test for "L". You can add ElseIf statements to an If...Then...Else statement to test a second condition if the first condition is False. IF functions with AND & OR logic in Excel. The Excel IF Statement tests a given condition and returns one value for a TRUE result and another value for a FALSE result. = IFS(logical_test1, Value1 [logical_test2, Value2] …, [logical_test127, Value127]) Where: 1. Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. In that case, we need to extend the formula with another IF statement. When we want to test more than one condition we need to use more IF statements inside the IF condition The first argument is the logical test, the second argument is the result (or calculation) to return when the test is TRUE. Inputting IF-THEN in Excel The IF-THEN function in Excel is a powerful way to add decision making to your spreadsheets. The formula you create will use the following syntax: =IF(condition1, value_if_true1, IF(condition2 value_if_true2, value_if_false2). The IF function is a built-in function in Excel that is categorized as a Logical Function.It can be used as a worksheet function (WS) in Excel. The end result of this formula will look like this: In our example, we want a certain action to occur if the value of A1 is greater than 5. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts. TIP: If you have Excel 2016, try the new IFS function instead of nesting multiple IF functions. For this, multiple testing is to be done using AND and OR function, you should gain expertise in using either or both of these with IF statement. Nicole Levine is a Technology Writer and Editor for wikiHow. {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/c\/c5\/Use-If%E2%80%90Else-in-Excel-Step-1.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-1.jpg","bigUrl":"\/images\/thumb\/c\/c5\/Use-If%E2%80%90Else-in-Excel-Step-1.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-1.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot) License: Fair Use<\/a> (screenshot)
\n<\/p><\/div>"}, {"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\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-2.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/0\/0d\/Use-If%E2%80%90Else-in-Excel-Step-3.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-3.jpg","bigUrl":"\/images\/thumb\/0\/0d\/Use-If%E2%80%90Else-in-Excel-Step-3.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-3.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/5\/5f\/Use-If%E2%80%90Else-in-Excel-Step-4.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-4.jpg","bigUrl":"\/images\/thumb\/5\/5f\/Use-If%E2%80%90Else-in-Excel-Step-4.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-4.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/a\/a4\/Use-If%E2%80%90Else-in-Excel-Step-5.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-5.jpg","bigUrl":"\/images\/thumb\/a\/a4\/Use-If%E2%80%90Else-in-Excel-Step-5.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-5.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/5\/50\/Use-If%E2%80%90Else-in-Excel-Step-6.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-6.jpg","bigUrl":"\/images\/thumb\/5\/50\/Use-If%E2%80%90Else-in-Excel-Step-6.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-6.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/b\/b3\/Use-If%E2%80%90Else-in-Excel-Step-7.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-7.jpg","bigUrl":"\/images\/thumb\/b\/b3\/Use-If%E2%80%90Else-in-Excel-Step-7.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-7.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/a\/a4\/Use-If%E2%80%90Else-in-Excel-Step-8.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-8.jpg","bigUrl":"\/images\/thumb\/a\/a4\/Use-If%E2%80%90Else-in-Excel-Step-8.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-8.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/2\/22\/Use-If%E2%80%90Else-in-Excel-Step-9.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-9.jpg","bigUrl":"\/images\/thumb\/2\/22\/Use-If%E2%80%90Else-in-Excel-Step-9.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-9.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/0\/00\/Use-If%E2%80%90Else-in-Excel-Step-10.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-10.jpg","bigUrl":"\/images\/thumb\/0\/00\/Use-If%E2%80%90Else-in-Excel-Step-10.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-10.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/8\/83\/Use-If%E2%80%90Else-in-Excel-Step-11.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-11.jpg","bigUrl":"\/images\/thumb\/8\/83\/Use-If%E2%80%90Else-in-Excel-Step-11.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-11.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/f\/f7\/Use-If%E2%80%90Else-in-Excel-Step-12.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-12.jpg","bigUrl":"\/images\/thumb\/f\/f7\/Use-If%E2%80%90Else-in-Excel-Step-12.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-12.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"
\n<\/p><\/div>"}, {"smallUrl":"https:\/\/www.wikihow.com\/images\/thumb\/8\/8d\/Use-If%E2%80%90Else-in-Excel-Step-13.jpg\/v4-460px-Use-If%E2%80%90Else-in-Excel-Step-13.jpg","bigUrl":"\/images\/thumb\/8\/8d\/Use-If%E2%80%90Else-in-Excel-Step-13.jpg\/aid9246283-v4-728px-Use-If%E2%80%90Else-in-Excel-Step-13.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"