12.13 User-Defined Functions: a Delivery Fee Function
Aarti needs a delivery estimate beside an order amount. A normal order of 270 has a fee of 15 in today's practice rule. During a festival the fee rises to 25. Some large orders remain free. You will write one worksheet function that returns those results, then test the value exactly at each threshold.
Define a fee before naming the function
Decide which orders owe a fee under the fictional rule
QuickCart is a fictional practice team with an order list resembling a Blinkit-style delivery dataset. The fee schedule, dates and handling are invented. Treat the amount as a rupee subtotal and the returned number as a quote. A quote does not mean an order was completed or a fee was collected. The example preserves three thresholds, 99, 199 and 499. It uses decimal amounts so an amount like 198.99 has an unambiguous expected result.
| Order amount | Regular fee | Festival fee |
|---|---|---|
| Below 99 | 30 | 40 |
| 99 up to but below 199 | 25 | 35 |
| 199 up to but below 499 | 15 | 25 |
| 499 or more | 0 | 0 |
- Amount: A valid amount is a number of zero or more. A real zero can indicate a free item in this fixture and receives the ordinary below-99 quote. A blank amount is missing. Treat it separately rather than letting it quietly become zero.
- Festival flag: The caller can omit the flag for the ordinary fee. If supplied, use an actual Excel logical TRUE or FALSE. Only a paid fee receives the extra ten. A free delivery does not start owing a festival fee under this rule.
- Output: Return the number to the cell containing the formula. Let the cell's number format display the unit or decimal places. The function need not change source data, other cells or the worksheet selection.
- Validation: A text amount or unexpected flag should be visible as an input problem. In this exercise invalid types return a value error and negative amounts return a number error, so an invalid price cannot be mistaken for a free order.
Understand what a user-defined function is for
A user-defined function, often called a UDF, is a calculation supplied by your own code. A worksheet call can pass a literal or a cell reference and use the function's result as part of a formula. A VBA Function usually assigns its return result to its own name. In this case the line setting DeliveryFee to a number provides the value that Excel displays in the calling cell. This behaves like another formula dependency, where a change in input calls for recalculation. You can use a Sub for a deliberate action such as writing a fixed report header. A worksheet user-defined function serves the formula by calculating its result.
Use a public function in a standard module of your approved macro-enabled workbook. Keep the module with the practice worksheet. Excel for the web cannot execute VBA. The exact function should be tested under the approved desktop policy, or you can trace its small inputs and results without executing it. A macro-free copy of the workbook does not contain the required code. It may display a formula or an earlier value, so do not assume the receiving file can recalculate it.
Remember: Pass the amounts and flags the formula needs as explicit arguments. Return one number or a clear error, and let the worksheet show and aggregate the result.
Write the comparison in a complete order
Evaluate the greatest threshold first
We can start with “at least 499,” then ask “at least 199,” then “at least 99.” An exact 499 reaches the first band and costs zero. A 270 fails the 499 check but passes the 199 check and gets 15. A 150 reaches the third check and gets 25. After validating nonnegative amounts, the remaining range starts at zero and goes up to, but not including, 99. The Select Case block carries this decision from top to bottom.
If the first rule instead says “at least 99,” a 499 can match that branch before seeing the free group. A successful match does not keep looking for a later, more specific rule. By checking descending thresholds you ensure the appropriate band wins. Another valid solution would test explicit nonoverlapping lower and upper intervals, but check that decimal values between integer thresholds are covered. Saying “99 to 198” in an explanation can mislead someone working with 198.99. State the upper bound as exclusive in the prose and the tests.
Lab one. Calculate a single fee with validated arguments
Make a worksheet, module and answer table
Make DeliveryFeePractice.xlsm yourself in approved desktop Excel, and create a sheet called Cases. Keep a short text marker on another sheet and an unused practice cell for checking that the inputs stay as they are. In the editor insert a standard module for this workbook and put the following code there. The function returns a Variant so it can return either a number or a worksheet error.
Option Explicit
Private Function ReadFeeInput(ByVal supplied As Variant, _
ByRef result As Variant) As Boolean
Dim cell As Range
If IsObject(supplied) Then
If TypeName(supplied) <> "Range" Then Exit Function
Set cell = supplied
If cell.CountLarge <> 1 Then Exit Function
result = cell.Value2
ElseIf IsArray(supplied) Then
Exit Function
Else
result = supplied
End If
ReadFeeInput = True
End Function
Public Function DeliveryFee(ByVal orderAmount As Variant, _
Optional ByVal isFestival As Variant = False) As Variant
Dim rawAmount As Variant, rawFlag As Variant
Dim amount As Double, fee As Double
DeliveryFee = CVErr(xlErrValue)
If Not ReadFeeInput(orderAmount, rawAmount) Then Exit Function
If Not ReadFeeInput(isFestival, rawFlag) Then Exit Function
Select Case VarType(rawAmount)
Case vbByte, vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbDecimal
amount = CDbl(rawAmount)
Case Else
Exit Function
End Select
If VarType(rawFlag) <> vbBoolean Then Exit Function
If amount < 0 Then
DeliveryFee = CVErr(xlErrNum)
Exit Function
End If
Select Case amount
Case Is >= 499
fee = 0
Case Is >= 199
fee = 15
Case Is >= 99
fee = 25
Case Else
fee = 30
End Select
If rawFlag And fee > 0 Then fee = fee + 10
DeliveryFee = fee
End Function
- Normalize the argument shape first. A caller can pass both literal values and one-cell references. If VBA receives a Range object, read its Value2 once after checking its size. If it receives an array or a multi-cell Range, this helper does not proceed. Call it one order at a time and fill down the worksheet formula instead of relying on Excel's array or implicit-intersection behavior.
- Preserve the source type. Reading a truly empty cell produces Empty. A formula returning empty text produces a String. Neither belongs to the permitted numeric cases, while an actual Double zero can pass. A String that contains the digits 270 still fails this exercise's numeric rule. If your source deliberately includes numeric text, handle its conversion explicitly before calling the function.
- Keep the flag logical. The Optional value makes omission mean False. If you supply a flag, the function accepts only a Boolean value. A text label reading TRUE is different. Use the Excel logical constant or a cell calculated to a real logical value. An explicit blank argument cell is not useful for requesting an ordinary quote; omit the argument or supply FALSE.
- Protect the result. The initial CVErr gives the result a value error until the inputs pass. A valid amount type with a negative value gives a number error. A normal call always assigns fee to the function name at the final line. The variable fee is local. It does not remember previous calls or modify another cell.
Enter a set of known and uncertain inputs
| Call | Expected |
|---|---|
=DeliveryFee(64) | 30 |
=DeliveryFee(150) | 25 |
=DeliveryFee(270) | 15 |
=DeliveryFee(270,TRUE) | 25 |
=DeliveryFee(1299,TRUE) | 0 |
=DeliveryFee(98.99) | 30 |
=DeliveryFee(99) | 25 |
=DeliveryFee(198.99) | 25 |
=DeliveryFee(199) | 15 |
=DeliveryFee(498.99,TRUE) | 25 |
=DeliveryFee(499,TRUE) | 0 |
=DeliveryFee(0) | 30 |
=DeliveryFee("270") | #VALUE! |
=DeliveryFee(270,"TRUE") | #VALUE! |
=DeliveryFee(-1) | #NUM! |
Enter the formulas with the argument list separator and decimal mark your Excel expects. The table uses English Excel examples. In these rows there are no source cell edits caused by the function. A valid call returns an ordinary number and the invalid calls return recognizable errors. Localized Excel can display translated error names.
- Check the original three amounts 64, 150 and 270 first. Each belongs to a different paid band. In the ordinary case expect 30, 25 and 15. Then use TRUE for 270 and 1299 to verify a paid fee changes and a free fee stays at zero.
- Change a literal around one threshold, such as 198.99 to 199. Compare the outputs 25 and 15. If the output is the same for both, check the comparison order and whether you entered a numeric decimal or a text value.
- In an unused area put a numeric 270 in A2 and a logical flag in B2. Use the referenced formula below. Set the flag to FALSE first and then TRUE. The expected results are 15 and 25. Clear A2 and observe a value error. Enter a real numeric zero and observe the valid below-99 fee with the current flag.
- Return A2 to 270 and set the flag with the logical expression below. Compare the result to the original literal. Then deliberately type the letters TRUE as text with a leading apostrophe. The function checks the stored type, so the text is rejected. Restore the actual Boolean when finished.
B2: =TRUE()
C2: =DeliveryFee(A2,B2)
Trace the fee in one worksheet cell
Read the arguments
The cell calls DeliveryFee with numeric 270 and Boolean TRUE. The arguments passed the type checks.
Choose the base
The amount is below 499 and at least 199, so the base is 15.
Apply the flag
The base is a paid fee and the flag is true. Add ten to make 25.
Return to the formula
The calling cell displays 25. The function left the source amount, flag and other worksheet cells alone.
Lab two. Compare regular and festival fees across the known order list
Give each formula the correct inputs from its own row
In the same practice workbook add a sheet called Orders. Use the original records from the formulas chapter. For this lab IDs in A2:A11, original amounts in G2:G11 and statuses in I2:I11 are sufficient. Use J as Regular quote and K as Festival scenario. In L1 enter an actual logical flag and label its meaning in a neighboring unused cell. This one flag will be used by every K formula when you switch the scenario.
J2: =DeliveryFee(G2)
K2: =DeliveryFee(G2,$L$1)
L1: =TRUE()
Fill J2 and K2 down through row eleven. The amount reference is relative, so each formula finds its own record. The dollar signs keep the flag at L1 for all scenario rows. If you left that reference relative, the next row could look at a blank L2. The exercise's strict flag type check would then recognize the invalid reference rather than silently quote an ordinary fee. Verify the first and last references before using the totals.
| Order ID | Amount | Status | Regular quote | Festival quote |
|---|---|---|---|---|
| BLK-1001 | 64 | Delivered | 30 | 40 |
| BLK-1002 | 270 | Delivered | 15 | 25 |
| AMN-1003 | 110 | Delivered | 25 | 35 |
| BLK-1004 | 240 | Cancelled | 15 | 25 |
| AMN-1005 | 232 | Delivered | 15 | 25 |
| BLK-1006 | 150 | Delivered | 25 | 35 |
| BLK-1007 | 1299 | Delivered | 0 | 0 |
| AMN-1008 | 195 | Returned | 25 | 35 |
| BLK-1009 | 220 | Cancelled | 15 | 25 |
| BLK-1010 | 90 | Delivered | 30 | 40 |
Reconcile the fee change without using the UDF twice as proof
Start with the known regular fee bands. On the ten rows there are two below 99, three from 99 through less than 199, four from 199 through less than 499 and one at or above 499. Two times 30, three times 25 and four times 15 add to 195. The free row contributes zero. Nine are paid, so adding ten to each gives an increase of 90 and a scenario total of 285. That agrees with a separate sum of all values in K, not because the person trusted the same function twice, but because they independently used the known counts.
Only seven of these orders are Delivered. This lesson first quotes a fee for any valid amount, regardless of status. A useful secondary worksheet aggregate can filter to the seven delivered rows. Their ordinary fees add to 140. Six of the delivered rows have a positive base, so the festival scenario for that group is 200. These are still conditional quotes for the training example. Whether a particular business charges a fee on a delivered or cancelled row needs a separate agreed accounting rule.
=SUM(J2:J11)
=SUM(K2:K11)
=SUMIF(I2:I11,"Delivered",J2:J11)
=SUMIF(I2:I11,"Delivered",K2:K11)
- As long as the input is valid and the formulas are current, the four complete results are 195, 285, 140 and 200. Confirm both the individual 270 example and the free 1299 example before accepting the aggregate.
- Set L1 to the logical value FALSE. The two columns should now quote the same fees for each row. Both full sums should be 195 and the delivered-only figures should both be 140. Leave the formula dependencies in place and set L1 to TRUE again to reproduce the festival result.
- In a separate copy change the 1299 in G8 to exactly 499. That amount remains free for both scenarios. Then set it to 498.99. The regular fee becomes 15 and the festival fee becomes 25. The complete ordinary sum becomes 210 and the festival sum 310. The two complete totals differ by 100 because all ten orders now have paid quotes.
- Restore 1299 and set the amount on one row to a true blank or textual number in the exercise copy. The row's fee should show a value error. Inspect the actual cell. A complete sum across a range with an error may also show an error. Fix or report the particular invalid input before treating a number as a full-batch fee.
- Place a separate marker next to the routine and verify it remains. The UDF writes its return to the formula's result, with no general report formatting or input changes. Leave a note explaining which flag produced the last observed totals.
Keep the function's dependencies visible in the formula
Compare explicit inputs with an implicit worksheet read
Suppose a programmer tries to fetch the festival decision from whichever sheet is active instead of passing it. A reviewer looking at the worksheet formula would see only the amount, even though the returned fee also depends on another cell. The same displayed call could appear to be calculated under different settings. Excel builds calculation dependencies from the information available to it. Keeping the flag in the formula clearly tells the reader and worksheet which source participates in that result.
The example likewise does not use the current date, user name or hidden configuration to silently decide the surcharge. A festival in the exercise is a specific scenario chosen by the logical input. The operator can run two scenarios with the same amount and compare both outcomes side by side. If your organization defines event periods by calendar, first calculate a date-based flag in a visible cell and pass it to the function. That makes it possible to test an ordinary and special day separately.
Recognize when a procedure needs to be a Sub
A worksheet function serves a formula. Microsoft describes restrictions on actions a custom function may perform when called from a worksheet. The example returns a value without formatting other cells, deleting data, changing a workbook property or asking an operator to respond to a dialog. A custom function may be called during calculation in circumstances where a user did not press a macro button. Keep the calculation as a predictable read-only operation so the workbook's normal recalculation is easy to reason about.
If the team needs a command to generate a formatted fee report, use a separate Sub with its own checked inputs, write scope and button. The report could call the same fee calculation, but the worksheet function still only returns the number. Tying a worksheet calculation to a side effect can make the report fragile on recalculation. Test each behavior where it belongs. For the lab you can change L1 and observe K change without explicitly running a procedure.
Decide whether a UDF is the simplest shared calculation
- Built-in worksheet expressions: A small, static fee schedule can fit inside a worksheet formula or a lookup table. That choice can be simpler when users share the file with people who cannot run VBA.
- Named formula functions: In a compatible Excel version a named LAMBDA can express a reusable calculation without a VBA project. Review the earlier dynamic-array lessons if the file must support that style. Availability of LAMBDA and other newer functions depends on the client, so verify the intended environment before switching.
- VBA reuse: An approved XLSM workbook can keep the example's module with its data and formulas. A packaged add-in can provide functions to other workbooks when installed and supported, and a personal macro workbook can supply code on its own machine. Those approaches change how the code reaches a user. Test distribution rather than assuming a coworker already has the personal code.
- Precomputed sharing: When an approved workflow sends values to somebody who only needs to read the result, produce a deliberately identified snapshot according to policy. The quoted amounts, source date and rule need to be understood without the function. Keep the source workbook's code wherever the calculation must remain editable and testable.
Find the source of an unexpected fee or worksheet error
Look at the symptom before changing the VBA module
- The formula name is not recognized: Check the exact spelling, the standard module, public declaration and saved file type. Verify that you are using the permitted desktop Excel environment. A macro-free copy cannot store this module, and browser Excel does not execute worksheet VBA code. If the code belongs to a different open workbook or add-in, its availability and workbook-qualified name can affect the formula. Keep this training function in the same file while learning.
- The worksheet displays a value error: Check whether the amount is stored as text, blank or an actual error, and whether the flag is a real logical value. A literal quoted 270 is text. A cell containing the typed Boolean TRUE is different from one containing the word TRUE stored as text. Try the known formula with numeric 270 and a logical TRUE to isolate whether the function or the source is the problem.
- The worksheet displays a number error: Check whether the numeric amount was negative. This practice represents ordinary nonnegative order totals. A refund may be real in another workflow but it needs its own rule. Do not invent a fee for negative amounts just to force a number into the report. If reviewers need a separate refund calculation, agree on the inputs and semantics first.
- A number appears but looks wrong: Check the raw amount, flag and physical precision. A source formatted with zero decimals might display 499 while its underlying value is 498.99, which is a paid band. A value shown as 0 can mean the threshold was met rather than the flag being false. Compare the named input fields and test both equal and just below the cutoff.
- Some rows ignore the shared flag: Check the formula that was filled down. A relative L1 reference can turn into L2. Anchor the common flag while leaving the amount row relative. Validate the last record before approving the sum. If the workbook is in a calculation mode that delays updates, calculate the exercise workbook using its existing controls and see whether its outputs are current.
Use a worksheet calculation as an independent alternative on clean input
For the known numeric order list, write a basic formula in a separate column to compare the threshold logic without calling DeliveryFee. This is for the validated rows, so it assumes numeric nonnegative amounts and a real Boolean flag. It does not implement the custom function's rejection behavior. Enter the two formulas below at M2 and N2, then fill down. Read M as the base and N as the scenario. Both quote columns should match the VBA outputs when the original fixture meets all rules.
M2: =IF(G2>=499,0,IF(G2>=199,15,IF(G2>=99,25,30)))
N2: =M2+IF(AND($L$1,M2>0),10,0)
At G2 of 64, M2 gives 30 and N2 gives 40 with the flag true. G8 of 1299 gives zero in both columns. Compare the full columns with J and K at each row. When G8 becomes 498.99, the clean-input worksheet calculation uses the same threshold and shows 15 and 25. If a blank reaches the alternate formula, Excel's comparison behavior can give a different result from the guarded custom function. State the assumptions before comparing the outputs. Reject bad inputs upstream or use the custom validation rather than expecting every shortcut to cover them.
If the team decides a built-in formula or lookup table is sufficient, it can review and share the logic without depending on a VBA module. In a larger rule system deliberately compare how easy each version is to audit. Explain changes in an agreed rule table, then update the code or formula at one place and rerun the same boundary fixture. The purpose of writing a UDF does not make it necessary for every fee calculation.
Use absolute and relative references for different reasons
Hold the scenario flag fixed when you duplicate a formula down a single snapshot. If you want two scenario columns, put Boolean False above one column and True above the other. You can anchor the amount column while leaving the scenario flag's column free to move. For example put the two flags in Q1 and R1, then in Q2 use the form below and fill right one column and down through eleven. The amount comes from column G on the current row. The flag comes from row one in each scenario's own column.
Q2: =DeliveryFee($G2,Q$1)
In Q11 that copied formula reads G11 and Q1, so it quotes 30 for amount 90 and flag false. In R11 it reads G11 and R1, so the quote becomes 40 when the flag is true. This exercise explains why a workbook-wide flag needs both anchors, while a side-by-side scenario needs only a fixed flag row. An exact read of the copied formula is better than judging the reference only by its current value.
Explain why two groups can share rates yet differ in totals
The all-status amount table includes ten rows. There is one free row and nine paid rows. The delivered-only table includes seven rows and one of them is the free row. The same 10 festival increase applied to paid results therefore changes the all-status sum by 90 and the delivered-only sum by 60. A separate rule that filtered the source before calculating could show different output columns, but it should produce the same totals for the same valid subset. The explicit filter state is what makes the comparison meaningful.
Ask a learning partner to change the outcome in one known group while leaving the larger source group alone. If they change a Cancelled row's amount from 220 to 499, that row's quote becomes zero in both scenarios. The all-status regular total drops by 15 to 180 and the festival total drops by 25 to 260. The delivered-only sums stay 140 and 200. This check works even if somebody tries to verify the rule using only an earlier total, because the underlying status limits which result changes.
Make an invalid batch visible next to a valid free quote
Record the count of accepted results before displaying the total
A reporting sheet should let a reviewer tell the difference between a valid zero and an invalid entry. A zero is counted as a number by COUNT. A worksheet error is ignored by COUNT when counted through a range reference. For the ten original rows, all valid quotes make COUNT return ten. If one source amount is blank and its fee shows a value error, the count is nine. Write a separate batch check in an unused cell before deciding whether to display an overall amount.
=IF(COUNT(J2:J11)=10,SUM(J2:J11),"Review fees before reporting")
This check treats the ten expected fee rows as the known practice scope. The phrase is a request for review and does not represent a fee. Test it on the original fixture to get 195. Replace the amount in row eight with a true blank on the copy. Its normally free quote becomes an error, and the batch check asks for review. Restore 1299 and confirm that quote is zero and the batch result is 195 again. A free order has an actual answer. The error tells you to inspect the amount before choosing a band. Add one more independent observation by turning the scenario flag off and rechecking the row with 270. The regular result stays fifteen and the scenario result returns to fifteen. Then turn it on again and observe twenty-five only in the scenario. This catches a mistaken flag reference even if every current fee is a number and the aggregate passes the count check.
Decide which failure information to keep
A common reporting mistake is to use IFERROR with a zero fallback on every row. That can make a missing amount look equivalent to a valid fee waiver. Preserve the underlying row-level error so somebody can locate the affected order using the ID. Display a separate plain-language status beside the aggregate and explain how many inputs need attention. If the report owner explicitly wants a subtotal of just valid quotes, label it as a partial result and give its denominator or source count. In this exercise the complete sum is appropriate only after all ten row-level quotes pass.
Imagine a reviewer only needs a static example report for a short meeting. They can keep a clearly dated copy of the numbers and the exact fee rules, then check that the exported rows still show all ten IDs and the two totals. Another analyst who needs to test new amounts benefits from the editable source workbook and approved procedure. Those uses need different artifacts because one requires calculation and the other requires reproducible evidence of an earlier result.
Explain the three outcomes: 1299 produces a valid free quote. An empty amount produces a value error. A negative amount produces a number error after passing the numeric type check. Each message tells the reviewer which aspect of the input or calculation to inspect next.
Quick checks
Read the input type, threshold and surcharge
What fee does 270 return when the second argument is omitted?
The base fee is 15 because 270 is at least 199 and below 499. The omitted flag defaults to False, so the surcharge is not applied. A True flag would raise this paid quote to 25.
What fee belongs to exactly 499 if the flag is True?
The free band begins at 499. That branch assigns a base fee of 0. The extra ten applies only to a positive base fee. The formula returns the number zero, which is a valid free quote.
How are an empty amount and numeric zero different?
An empty amount is an invalid input for this exercise and returns a value error. Zero is an allowed actual number and uses the below-99 band. With an omitted flag its fee is 30. Check the actual value type before converting a missing field into a price.
Which formulas should change if the value in L1 changes?
The festival scenario column uses the shared referenced flag and should recalculate under the workbook's calculation settings. The base quote column omits that flag and keeps its original fee values. The amount and status columns stay outside the function's effects.
Why can the sum of the festival quotes rise by ninety rather than one hundred?
There are ten rows but only nine paid base fees. The free quote stays zero. A ten-unit increase for each of the nine paid fees contributes ninety, giving a new full sum of 285. Count the paid quotes separately rather than using all rows as the surcharge count.
Can a custom worksheet function format the other order columns for this lesson?
Its purpose is to return a result to the formula. Keep external effects such as rebuilding or formatting a report in their own Sub with explicit invocation and safety checks. This function leaves the amount, flag and nearby note untouched.
Interview and discussion
Explain the test approach as well as the fee
Why should the optional flag be an explicit argument?
Anyone reading the formula can see how the amount and festival scenario interact. Excel can also follow the flag cell as a dependency. Hiding it in another worksheet read or using the actual computer date would make the same formula text less informative and complicate reproducible testing.
What tests would you write for a fee threshold?
Try an amount just below the threshold, exactly at it and just above. Test both scenarios and include an invalid value. At 498.99 with TRUE, the expected result is 25. At 499 with TRUE, the expected result is zero. Include at least one actual blank so it cannot be confused with a valid numeric zero.
Why does the function return Variant rather than Double?
The code needs to return either an ordinary number or an Excel error value. A Variant can hold the CVErr result for invalid input. Returning an error makes the troublesome row visible and avoids using the same number for an invalid request and a genuine fee waiver.
What would a reasonable test of a copied fee workbook include?
Verify the approved desktop Excel client, macro-enabled file type and availability of the exact code. Open the intended file, check a paid literal and a free literal, then edit a source cell and observe recalculation under the current settings. A previously displayed number does not establish that the receiving file still contains the code or can recalculate it.
How do you verify a fee sum without trusting the same function twice?
Group the numeric inputs by the written thresholds and independently multiply the counts by their matching base fees. Here the counts are two, three, four and one, so the result is 195. Count nine positive fees and add ninety for the festival scenario. Compare the calculation, the row-level fee examples and the source IDs.
Six recall cards
- Choose the boundary first
At 99, 199 and 499 the next amount band begins. Test one real decimal immediately below each cutoff.
- Worksheet return
A VBA Function assigns the result to its own name. Keep the calculation in the formula and broader writes in a Sub.
- Two data types
Pass a numeric amount and a Boolean flag. An absent optional flag uses False; text or an invalid cell needs review.
- Free stays free
A true festival flag adds ten only to a paid base fee. Orders at or above 499 remain zero.
- Check copied references
A relative order amount follows the row. Anchor a shared flag to its one intended cell.
- Reconcile separate scopes
Ten quoted rows give 195 and 285. Delivered rows give 140 and 200 under the same fee rules.
Microsoft references
Continue practising: explore the existing Excel Task Hub for additional exercises.