We can use the IF function to do something specific if cell equals to a certain value. If the result of the IF function is TRUE, we can do something, and if FALSE, we can choose to do something else. This post provides a clear guide on how to use the IF function if cell equals a given value.
Figure 1: If cell equals, flag “NO”
Syntax of the formula
=IF(check_string, true_result, false_result)
Check_string- is the logical part of the formula
True_result- what will be displayed if the IF function returns a TRUE value
False_result- will be displayed if the IF function returns a FALSE value.
Explanation of the formula
In our example above, we have used the formula below in cell C2;
In this formula, we shall get “NO” if the results of the IF function is TRUE. The cells where the result is not TRUE shall remain blank.
In this case, the check string shall be A2, and if it contains Jim& co, then we need “NO” as the TRUE result. If it does not contain Jim& com, then we get blank cells, as shown by the empty string “”. Note that in our example, the logical test is; A2=”Jim& co”
The empty string at the end of the formula is important, as it helps leave the cells whose results are not TRUE empty. Without the empty string, (“”), we shall have FALSE in each cell whose result is not TRUE.
Figure 2: If cell equals, flag “x”
Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchatservice! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.
Are you still looking for help with the IF function? View our comprehensive round-up of IF function tutorials here.