Cellgrids Cellgrids
Home › Practice questions › IF › Question 9

Excel IF Practice Question: Compare the year's total sales with the target in E2. If the target is met…

By Rinkesh Shah, founder of Cellgrids.

The question

Compare the year's total sales with the target in E2. If the target is met show Target met, otherwise show the shortfall amount. Put the answer in E3.

The data

ABCDE
1QuarterSalesTarget
2Q122000100000
3Q231000Result?
4Q318000
5Q424000

The yellow cell is where your answer goes.

Show answer

Answer in E3: 5000

How it works

Explanation: IF can return text in one branch and a number in the other. SUM supplies the actual total to compare.
Syntax: =IF(SUM(B2:B5)>=E2,"Target met",E2-SUM(B2:B5))
Total sales = 22000 + 31000 + 18000 + 24000 = 95000. That is below the target of 100000, so the shortfall is 100000 - 95000 = 5000.

Try it yourself in the live sheet

Type your formula in the highlighted cell and get instant feedback. Free, no Excel install needed.

Try this question in the live sheet →

IF syntax

=IF(logical_test, value_if_true, value_if_false)

Returns one value if a condition is true, another if false. Flagging an employee as Pass or Fail based on a score cutoff. Full IF guide.

More IF practice questions

All practice questions · Excel exercises · Interview prep · Cheat sheet