Summary

To test if a cell is greater than a given value, you can use the IF function. In the example shown, the formula in cell E5 is:

=IF(C5>80,"x","")

The result in cell E5 is "x" since the score in cell C5 is greater than 80. The result returned by the IF function can be adjusted as needed.

Generic formula

=IF(A1>80,"Yes","No")

Explanation 

The aim is to mark records with an "x" if a score is greater than 80 and leave the cell blank if the score is less than 80. This can be achieved using the IF function in Excel.

IF function

The IF function runs a logical test and returns one value for a TRUE result, and another value for a FALSE result. The generic syntax for IF looks like this:

=IF(logical_test,if_true,if_false)

The IF function can return a value, a cell reference, or even another formula. In the worksheet shown, the goal is to identify rows where the score is greater than 80 by returning "x" as a marker. To accomplish this task, the formula in cell E5 is:

=IF(C5>80,"x","")

In this formula, the logical test is this expression:

C5>80

This expression returns TRUE if the value in C5 is greater than 80 and FALSE if not. In cell F5, the result is TRUE because C5 contains 85. The IF function then returns "x" as a final result:

=IF(C5>80,"x","") // returns "x"

In cell F6, the expression returns FALSE because C6 contains 79. The IF function returns an empty string "" as a final result:

=IF(C6>80,"x","") // returns ""

In Excel, an empty string ("") displays nothing. The result returned by the IF function can be customized as needed. For example, to return "Yes" if a score is greater than 80 and "No" if not, you can use this formula:

=IF(C5>80,"Yes","No")

Note that if no value is provided for the value_if_false argument, the formula will return FALSE for scores not greater than 80.

Conditional formatting

Another way to identify cells with a value greater than 80 is to use conditional formatting, as seen below:

Using conditional formatting to highlight scores greater than 80

This is an example of applying conditional formatting with a formula. The formula used to highlight scores greater than 80 is:

=C5>80

The formatting is automatic. If a score is changed to a number greater than 80, the yellow highlighting will appear. You can find more conditional formatting examples here.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.