Go Back

If Cell equals

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)

Where;

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;

=IF(A2="Jim& co","NO","")

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.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

I need a formula that meets this criteria, If Cell A3 is >8 then Cell A6 equals 454, if Cell A3 is <8>4 then Cell A6 equals 290, if Cell A3 is <=4>0.1 then Cell A6 equals 169, if Cell A3 is <=0 then Cell A6 equals 0
Solved by O. Y. in 26 mins
If a cell value equals x I want that cell to display a string. For example. If a cell equals 1 I want that cell to display "DH1". If a cell equals 2 I want that cell to display "DH2" and if a cell equals 28 I want that cell to display "NH1"
Solved by M. Q. in 24 mins
I want to create a IF - THEN formula that says something like, if cell 'A1" equals 1 then cell A3 will equal 23, OR if cell 'A1" equals 2 then cell A3 will equal 28, OR if cell 'A1" equals 3 then cell A3 will equal 23.50, etc.
Solved by M. H. in 16 mins

Leave a Comment

avatar