
Generally, you use an IF statement to test a condition and to return one value if the condition is met, and another value if the condition is not met. IF is one of the most popular and useful functions in Excel.

Let's have another example of the IF statement. However, most of the time you would require nested IF or a combination of IF with other Excel functions. This was a simple example of an IF function in Excel. Since it is greater than 19, it shows Adult in C2. Here, Excel will simply check if the value in cell B2 is greater than 19 or not. In Cell C2 write this excel IF statement and drag it down: =IF(B2>19,"Adult","Minor") Let's say people whose age is greater than 19 are Adults and who are less than 19 are minor.

Now you want to know how many of them are adults and how many are minors. IF Example 1:Īssume you have a list of people. The best thing about the IF statement is that you can customise TRUE and FALSE results. Pro Note: IF in Excel 2016, 2013, and 2010 can have up to 64 nested IF statements. The IF statement in Excel checks the condition and returns the specified value if the condition is TRUE and another specified value if FALSE. At the place of value if TRUE and value of FALSE, you can put a value, a text within quotes, another formula or even another if statement ( nested IF statement, we will talk about it). Syntax: =IF( condition, value if TRUE, value if FALSE)

The IF function in Excel is used to give conditional outputs.
