Suppose your company offers a quantity discount of 10 percent on the sale of a product,
provided the order is for more than 100 units. In the following paragraphs, you’ll build a
function to calculate this discount.
The file Treeorders.xls contains a worksheet which shows an order form that lists each item, the quantity, the
price, the discount (if any), and the resulting extended price.
To create a custom Discount function in this workbook, follow these steps:
Function Discount(quantity, price) If quantity >= 100 Then Discount = quantity * price * 0.1 Else Discount = 0 End If Discount = Application.Round(Discount, 2) End Function