Coupon Savings Calculator Formula

Understand the math behind the coupon savings calculator. Each variable explained with a worked example.

Formulas Used

You Save

you_save = discount_amt

Final Total

final_total = cart_total - discount_amt

Effective Discount

effective_discount_pct = discount_amt / cart_total * 100

Variables

VariableDescriptionDefault
cart_totalCart Total(USD)85
coupon_typeCoupon Type1
coupon_valueCoupon Value15
discount_amtDerived value= coupon_type == 1 ? cart_total * coupon_value / 100 : coupon_valuecalculated

How It Works

How Coupon Savings Are Calculated

Coupons come in two forms: a percentage off the total, or a fixed dollar amount. This calculator handles both and shows the effective discount rate.

Percentage Coupon

Savings = Cart Total x Coupon % / 100

Fixed Dollar Coupon

Savings = Coupon Dollar Amount

Worked Example

You have an $85 cart and a 15% off coupon.

cart_total = 85coupon_type = 1coupon_value = 15
  1. 01Coupon type: Percentage off
  2. 02Savings = $85.00 x 15 / 100 = $12.75
  3. 03Final total = $85.00 - $12.75 = $72.25
  4. 04Effective discount = 15.0%

Ready to run the numbers?

Open Coupon Savings Calculator