What does this formula mean?
Follow the quotation engine order from rounded line charges to final total. Calculate every material through its selected area/piece basis. Calculate each independently entered service quantity × rate; a fixed service is its entered amount. Round each line once to cents.
When should you use it?
Use for materials, independently priced services and mixed tax-inclusion selections with one global discount before tax.
The formula
S = M + V = T + N; DT = roundHalfUp(D × T ÷ S); DN = D − DT; BT = T − DT; BN = N − DN; Tax = roundHalfUp(BT × t ÷ 100); Grand = S − D + Tax
Read “×” as multiply, “÷” as divide, “Σ” as add the line values, and “ceil” as round upward to the next whole number. “roundHalfUp” rounds a tie upward at the stated precision.
Understanding the symbols
- M; V
- Sum of rounded material lines; sum of rounded service linesUnit: integer minor units (cents)
- S; T; N
- Combined subtotal; included-in-tax subtotal; excluded-from-tax subtotalUnit: integer cents
- D; DT; DN
- Global discount; included pool discount; excluded pool remainder discountUnit: integer cents
- BT; BN
- Included and excluded pools after allocated discountUnit: integer cents
- t
- User-entered tax percentage, not a jurisdictional recommendationUnit: %
- Tax; Grand
- Tax rounded once on BT; final discounted subtotal plus taxUnit: integer cents
How to calculate manually
Use an ordinary calculator. Keep intermediate digits until the rounding step described below.
- Calculate every material through its selected area/piece basis. Calculate each independently entered service quantity × rate; a fixed service is its entered amount. Round each line once to cents.
- Add rounded materials and services for S. Separately total included lines for T and excluded lines for N; check S = T + N.
- Calculate one global percentage or fixed discount D. In integer cents, taxable discount DT = roundHalfUp(D × T ÷ S); excluded discount DN = D − DT. If S is zero, do not divide.
- Subtract the allocated shares: BT = T − DT and BN = N − DN. Check BT + BN = S − D.
- Calculate tax once on BT using the manually entered percentage, round half up to cents, and add it to S − D. Do not tax each line separately or tax BN.
Worked example
Teaching example: Ajax Gold 295 × 180 cm × 3, d=0.04 m², AED 250/m²; Carrara White 320 × 180 cm × 2, AED 180/m²; 10% discount, 5% tax
- Rounded lines: AED 3,952.50 + AED 2,073.60 = AED 6,026.10.
- 10% discount = AED 602.61; discounted subtotal = AED 5,423.49.
- With every material included in tax and no services, 5% tax rounds to AED 271.17.
- 5423.49 + 271.17 = AED 5,694.66.
Answer: AED 5,694.66
Materials plus services: mixed tax inclusion
The live example below uses the current Quotation Generator’s published demonstration fixture. Original materials remain AED 3,952.50 and AED 2,073.60. All rates are tax-exclusive.
- Fabrication: independently entered 10 m² × AED 40/m² = AED 400.00.
- Edge polishing: independently entered 12 m × AED 25/m = AED 300.00. No perimeter is inferred.
- Delivery: fixed AED 150.00, excluded from tax by the demonstration user’s selection.
- Installation: 4 pieces × AED 50/piece = AED 200.00.
Combined AED 7,076.10; 10% discount AED 707.61. Included pool AED 6,926.10 receives AED 692.61 discount; excluded AED 150.00 receives the AED 15.00 remainder. After discount: included AED 6,233.49 + excluded AED 135.00 = AED 6,368.49. One 5% tax on AED 6,233.49 rounds to AED 311.67. Final: AED 6,680.16.
The 5% rate and delivery exclusion are educational inputs, not legal tax rules. With no services and all materials included, the original AED 5,694.66 result remains unchanged.
Try it yourself
Try it: Quotation materials and services
Values stay in this page’s memory. Changing units reinterprets the entered measurement. Match source and target categories for conversions.
- Ajax Gold: AED 3,952.50 (included in tax)
- Carrara White: AED 2,073.60 (included in tax)
- Fabrication: 10 m² × AED 40 = AED 400.00 (included in tax)
- Edge Polishing: 12 linear m × AED 25 = AED 300.00 (included in tax)
- Delivery: fixed amount = AED 150.00 (excluded from tax)
- Installation: 4 pieces × AED 50 = AED 200.00 (included in tax)
- Material subtotal: AED 6,026.10
- Service subtotal: AED 1,050.00
- Combined subtotal S: AED 7,076.10
- Included subtotal T: AED 6,926.10
- Excluded subtotal N: AED 150.00
- Global discount D: AED 707.61
- Allocated included discount DT: AED 692.61
- Allocated excluded discount DN: AED 15.00
- Included after discount BT: AED 6,233.49
- Excluded after discount BN: AED 135.00
- Combined after discount: AED 6,368.49
- Tax once on BT: AED 311.67
- Discount shares reconcile exactly in cents. The demonstration excludes delivery by user choice, not by a legal exemption rule.
Common mistakes
- Applying tax before discount, taxing excluded lines, rounding only the final total, or adding rounded per-line tax amounts.
Precision and rounding
All formula quantities above are integer cents; do not round allocation to whole currency units. Lines round half up once; global discount and pooled tax round separately. BigInt intermediate arithmetic allocates DT = roundHalfUp(D × T ÷ S), DN = D − DT. For S = 0 the allocation is zero without division. Service inputs allow six effective decimal places; the current material-rate precision contract remains unchanged. Percentage inputs support two decimals. A fixed discount cannot exceed subtotal.
Known limitations
A draft quotation is not a tax invoice, payment or acceptance. The user selects tax inclusion and rate. Verify transaction-specific treatment; a currency does not determine jurisdiction. Service quantities are independent, never inferred from material area or perimeter.