Excel IF Practice Question: Compare the year's total sales with the target in E2. If the target is met…
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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Quarter | Sales | Target | ||
| 2 | Q1 | 22000 | 100000 | ||
| 3 | Q2 | 31000 | Result | ? | |
| 4 | Q3 | 18000 | |||
| 5 | Q4 | 24000 |
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
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
- Using IF, show Pass if the marks are 40 or more, otherwise Fail. Fill C2 to C4.
- Show Reorder when the stock is below 20 and OK otherwise. Fill C2 to C4.
- Using IF, give a 5% bonus on sales above 50000 and 0 otherwise. Fill C2 and C3.
- A candidate is Eligible only if the age is 18 or above and the score is 60 or above.…
- Using IF with OR, show Free if the order is 1000 or more or the customer is a member,…
- A blank Days cell means the order is not delivered yet. Show Done if Days has a value…
- Using nested IF, assign grades: 90 and above is A, 75 to 89 is B, 50 to 74 is C, below…
- Using nested IF with these simplified slabs, find the tax: nothing up to 250000; 5% of…
All practice questions · Excel exercises · Interview prep · Cheat sheet