How to Check IF a condition is met in Excel?

Spread the love

In this post you will learn how to check if a condition is met in Excel.

Checking if a simple condition is met –

Figure below shows a list of states and six monthly gas prices. For each price, say you want to determine whether that state’s price in that month is above or below the average of all the states for the same month. For higher than average prices, you will report “High” and for lower than average “Low.” A grid below the data will be used to report the results.

=IF(C3>AVERAGE(C$3:C$11),"High","Low")

The IF function is the most basic conditional analysis function in Excel. It has three argu-
ments: the condition, what to do if the condition is true, and what to do if the condition
is false.

The condition argument in this example is C3>AVERAGE(C$3:C$11). Condition arguments
must be structured to return TRUE or FALSE, and this usually means that there is a compar-
ison operation (like an equal sign or greater-than sign) or another worksheet function that
returns TRUE or FALSE (like ISERR or ISBLANK). The example condition has a greater-than
sign and compares the value in C3 to the average of all the values in C3:C11.

If our condition argument returns TRUE, the second argument of the IF function is
returned to the cell. The second argument is High, and since the value in C3 is indeed
larger than the average, cell C14 shows the word High.

Cell C15 compares the value in C4 to the average. Because it is lower, the condition argu-
ment returns FALSE, and the third argument is returned. Cell C15 shows Low, the third
argument of the IF function.

Rating: 1 out of 5.

Leave a Reply