
Step 1 of 5
Turn the Spending Rule into a Comparison
Translate a per-purchase spending rule into a logical comparison and identify its equality boundary.
Learning path · Level 2 · Tutorial 4
Use IF in Excel or Calc to label office-supply purchases as within or over a spending limit. Translate a simple rule into a comparison, copy the formula across records, and test the threshold so the labels match the intended policy.
Turn the Spending Rule into a Comparison
Translate a per-purchase spending rule into a logical comparison and identify its equality boundary. 3 min
Build the First IF Status Formula
Create the Purchases practice worksheet and build the first IF formula that labels a purchase against one shared spending limit. 4 min
Apply the Rule to Every Purchase
3 min
Test Below, At, and Above the Limit
Check the formula at the spending-limit boundary, diagnose an equality-case error, and verify the calculated labels in your worksheet. 3 min
Apply a New Limit and Verify the Result
Apply the unchanged spending rule after changing the shared limit to $60.00, then verify formula references and boundary results. 3 min

Step 1 of 5
Translate a per-purchase spending rule into a logical comparison and identify its equality boundary.
The policy asks one question for each purchase: is this amount over the spending limit?
A logical test compares values and returns either TRUE or FALSE. For a limit of 50:
65>50 is TRUE.50>50 is FALSE.The rule is applied to each purchase separately. Do not add purchases together or use a running balance. An amount exactly equal to the spending limit is not over it.

A strict “greater than” comparison includes only values to the right of the limit; the value on the limit is excluded.
Comparison operators express the condition you want to test. A strict operator excludes equality. An inclusive operator includes equality.
Use these operators when translating a rule into a logical test.
| Operator | Meaning | Example |
|---|---|---|
| = | equal to | 50=50 |
| <> | not equal to | 49.99<>50 |
| > | greater than | 50.01>50 |
| < | less than | 49.99<50 |
| >= | greater than or equal to | 50>=50 |
| <= | less than or equal to | 50<=50 |
Tip
“Over the spending limit” means strictly greater than the limit, so it uses >. Using >= would incorrectly treat an amount equal to the limit as over the limit.
Match each comparison operator to its meaning.
Tap an item and then its matching pair.
The spending limit is 50. Which statement correctly applies the policy “over the spending limit”?

Step 2 of 5
Create the Purchases practice worksheet and build the first IF formula that labels a purchase against one shared spending limit.
On your computer, create a workbook named Spending Limits.xlsx in Excel or Spending Limits.ods in Calc. Rename the worksheet to Purchases.
In A1:C1, enter the headers Purchase, Amount, and Status. Enter the five records below in rows 2–6. Keep column D empty. In E1, enter Spending limit; in E2, enter 50.
Format B2:B6 and E2 as US dollars with two decimal places. Enter the underlying amounts as numbers without currency symbols. Leave the Status cells empty for now: they will contain formulas, not typed labels.
Enter these records in A1:C6. The Status column stays blank until you add the formula.
| Purchase | Amount | Status |
|---|---|---|
| Printer paper | 35 | Leave blank |
| Ink cartridge | 65 | Leave blank |
| Notebooks | 50 | Leave blank |
| Pens | 49.99 | Leave blank |
| Folders | 50.01 | Leave blank |
Tip
The spending limit is outside the record range so every purchase can use the same threshold. Do not type status words into column C; a formula will generate them.
IF has three arguments:
TRUEFALSEHere, the test asks whether the amount in B2 is greater than the shared spending limit in $E$2. Because the question is “Is it over the spending limit?”, "Over limit" must be the TRUE outcome. "Within limit" is the FALSE outcome.
Text returned by a formula needs straight double quotation marks. The $E$2 reference remains the shared threshold; entering the formula does not change the amount in B2.
Follow the branch produced by the comparison: TRUE goes to the first IF outcome, and FALSE goes to the second.

The order of IF outcomes follows the TRUE branch first, then the FALSE branch.
Choose the version that uses the argument separator accepted by your application settings. Both formulas use the same logic.
=IF(B2>$E$2,"Over limit","Within limit")
=IF(B2>$E$2;"Over limit";"Within limit")Complete the formula. Then, on your own worksheet, enter the completed version in C2 and verify the displayed status for the $35.00 purchase.
=IF(B2$E$2,,)
Step 3 of 5
The formula in C2 already applies the spending rule to the first purchase. Fill it down through C6.
As the formula moves down, the amount reference follows the purchase row: B2 becomes B3, B4, and eventually B6. The shared spending limit must remain fixed at $E$2 in every row.
This means each status is based on that row’s amount, not on a previous purchase or a total.

When copied down, the amount reference changes by row; the absolute spending-limit reference stays $E$2.
Tip
Use the fill handle to drag C2 down to C6, or copy C2 and paste it into C3:C6. After filling, select C6 and inspect its formula in the formula bar.
In your local workbook, open the Purchases sheet and fill C2 through C6. Keep column D empty and leave the spending limit in E2 unchanged.
The formula’s text labels remain the same after copying. Only the relative amount reference changes. Your application may use semicolons instead of commas because of its settings; that does not change the cell references or the rule.
Formula already in C2. After filling down, each row keeps the same rule while its amount reference follows that row.
=IF(B2>$E$2,"Over limit","Within limit")Within limit
With B2 equal to 35 and E2 equal to 50, the formula in C2 displays this result.
Use these as quick checks after filling. Compare a status with the amount on the same row; do not assume a successful fill automatically produced the intended references.
| Purchase | Amount | Expected status |
|---|---|---|
| Printer paper | $35.00 | Within limit |
| Ink cartridge | $65.00 | Over limit |
| Notebooks | $50.00 | Within limit |
| Pens | $49.99 | Within limit |
| Folders | $50.01 | Over limit |
After filling C2 through C6 in your own worksheet, inspect C6. Complete the two references as they should appear in its formula.
=IF(>,"Over limit","Within limit")
Step 4 of 5
Check the formula at the spending-limit boundary, diagnose an equality-case error, and verify the calculated labels in your worksheet.
Boundary testing checks the three values nearest a rule’s cutoff: just below it, exactly at it, and just above it. For this worksheet, the spending limit in E2 is displayed as $50.00.
The policy says a purchase is Over limit only when its amount is greater than the spending limit. An amount equal to the limit is still Within limit. Test the written rule first; then compare your prediction with the formula result.

The boundary itself belongs to the “Within limit” side. Only a value beyond $50.00 is over the spending limit.
Use the existing records to test the formula before changing anything:
B5 is 49.99.B4 is 50.B6 is 50.01.First predict each status from the policy. Then inspect the formula-generated cells C5, C4, and C6. Do not type over a status result.
If an observed label disagrees with the prediction, inspect the formula rather than overwriting the label: check the comparison operator, the order of the two quoted outcomes, and whether the row amount and shared threshold references are correct.
At a $50.00 spending limit, these are the expected results of the written policy.
| Amount | Position relative to limit | Expected status |
|---|---|---|
| $49.99 | Below | Within limit |
| $50.00 | Equal | Within limit |
| $50.01 | Above | Over limit |
Tip
A result of Over limit for the equal amount is a useful warning sign: an inclusive comparison may have been used where the policy requires a strict one.
Complete the corrected comparison operator in this status formula for the equal-value row.
=IF(B4$E$2,"Over limit","Within limit")With E2 still set to 50, inspect your local worksheet and write a short verification note. Include:
Within limit.Use the formula results in the Status column as your observed evidence; do not replace them with typed labels.
Write at least 100 characters (0/100).

Step 5 of 5
Apply the unchanged spending rule after changing the shared limit to $60.00, then verify formula references and boundary results.
The policy does not change: only an amount strictly greater than the spending limit is Over limit. An amount equal to the limit is still Within limit.
For the final check, set the shared spending limit in E2 to 60. Then use three amounts around that boundary: 59.99, 60, and 60.01. Because the comparison is strict, the first two receive Within limit and the last receives Over limit.
Keep the purchase names and the values in B2 and B3 unchanged. The formulas in the Status column should recalculate; do not type status labels into the cells.

With a strict greater-than comparison, equality stays on the within-limit side of the boundary.
Tip
Type the new amounts as plain numbers with a decimal point. Keep the Amount column displayed as US dollars with two decimal places, so the boundary cases appear as $59.99, $60.00, and $60.01.
Complete the canonical comma-version formula for the Status cell in row 6. If your application uses semicolons, use its required separator when entering a formula locally.
=IF(B6$E$2,,)Open the Purchases worksheet in Spending Limits.xlsx in Excel or Spending Limits.ods in Calc. Make these edits, leaving column D empty. The existing formulas in C2:C6 should recalculate automatically.
Do not replace any Status formula with typed text. After editing, save the workbook locally.
Enter these plain numeric values. Keep B2 and B3 unchanged.
| Cell | Enter |
|---|---|
| E2 | 60 |
| B4 | 60 |
| B5 | 59.99 |
| B6 | 60.01 |
Click C6 and inspect the formula bar. Its amount reference should be for row 6, while the shared threshold remains $E$2. Your application may display semicolons instead of commas, depending on its settings.
=IF(B6>$E$2,"Over limit","Within limit")After saving the workbook locally, report your verification. Give the observed labels for the three boundary cases in this order: C5, C4, then C6. Also confirm the fixed threshold reference in the copied formula and whether every cell in C2:C6 contains a formula-generated status.
Write at least 60 characters (0/60).
Summary
> comparison: only amounts greater than the spending limit are Over limit.$E$2 threshold, and quoted text outcomes in IF.Congratulations! You completed: Flag Spending Limits with IF
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks