How to calculate the shipping fees based on the quantity ordered?

This is a common question from small sellers who ship their products. For example, your delivery cost may grow with the number of items, so you want to charge per item or give a better fee for bigger orders. A Google Form cannot count the items in an order or work out a fee from that count, so you do the sums by hand. With Neartail, the QUANTITY function counts the items and you can write the fee as a formula, such as a fee per item or a tiered fee. Your customers will see the fee and the total before they submit. Even better, you write the rule once and every order follows it.

Let's start. Create your order form and follow the steps below.

How to calculate the order quantity?

  • On the page that opens, click "Enter your form name". Type your form's name, click Generate and wait about a minute.
  • Check the outline it suggests and click Proceed.
  • Once you create the form, you will land on the form's "Edit" tab. If it asks "Do you want to preview this form?", click No.
The tabs Edit, Preview, Share and Orders, with Edit marked
  • Your form comes with products, an Order Amount question that adds up by itself and an Order Quantity question. Click on each product and check its name and price, because a generated product can have no name and a price of 0.
  • Click on the Order Quantity question, then click the ⚙️ icon
The Order Quantity question selected in the editor, with its title and the gear at the bottom of its card marked
  • Field settings screen will be displayed. Select the "Answer" tab. Your form already has the QUANTITY function in the Calculate option as shown below, so you do not have to write it
  • Close this screen
The Answer tab of the field settings with QUANTITY() in the Calculate box, with the Answer tab and the box marked

How to calculate the shipping fee based on order quantity?

  • Click on the Order Quantity question, then click Add price field in the toolbar on the right
The form in the editor, with the Add price field icon marked in the toolbar on the right
  • Add price field screen will be displayed. Select Delivery Fee and click Next
The Add price field list, with Delivery Fee selected and Next marked
  • Check that Insert after says Order Quantity. If it does not, click the pencil and select it or the field will land where you last clicked, which can be in the middle of your products
  • Select Fixed amount and click Next
The Delivery Fee settings with Insert after Order Quantity and Fixed amount selected, marked with Next
  • Click Create. You will replace this amount with the formula in the next step
The Fixed amount box with 1 and the Create button marked

Fixed per-item shipping fee

Let's say the fixed shipping fee per item is $2. We can write a simple calculation to multiply the order quantity by 2 to calculate the total shipping fee.
QUANTITY() * 2
  • Field settings screen will be displayed. Select the "Answer" tab. Write the formula in the Calculate option as shown below and click Save
The Answer tab of the field settings with QUANTITY() * 2 in the Calculate box, with the Answer tab and the box marked

Advanced per-item shipping fee

Example #1:
Let's say the shipping fee for the first item is $10 and for each additional item, the shipping fee is $5. If a user orders 3 items, the shipping fee would be $10 for the first item and $5 for the other two items. The total shipping fee would be $20.
Formula to calculate the total shipping fee:
10 + (QUANTITY() - 1) * 5
Example #2:
Let's say the shipping fee per item is $2 and you get a discounted shipping fee of $15 for a pack of 10 items. If a user orders 22 items, the shipping fee would be $30 for 20 items plus an additional $4 for 2 individual items.
Formula to calculate the total shipping fee:
Math.floor(QUANTITY() / 10) * 15 + (QUANTITY() % 10) * 2
Math.floor function returns the largest integer less than or equal to a given number. For example Math.floor(22/10) will return 2. We can use this function to find the number of 10 packs in the order quantity.
The remainder operator % returns the integer left over after dividing one number by another. For example, 10 % 3 will return 1. 22 % 10 will return 2.
To use one of the advanced formulas, click on the Delivery Fee question, click the ⚙️ icon and select the "Answer" tab. Write the formula in the Calculate option in place of the other one and click Save.
The Answer tab of the field settings with the formula for a pack of 10 items, using Math.floor and the % operator in the Calculate box

How to calculate the total amount including the shipping fee?

Add a Net Amount price field. It adds the Delivery Fee to the Order Amount by itself. Without it, the fee shows on the bill but your customers are not charged for it.
  • Click on the Delivery Fee question, then click Add price field. Select Net Amount and click Next
The Add price field list, with Net Amount selected and Next marked
  • Check that Insert after says Delivery Fee. Select Standard calculation using NETTOTAL() and click Next
The Net Amount settings with Insert after Delivery Fee and Standard calculation using NETTOTAL() selected, marked with Next
  • Click Create
  • Field settings screen will be displayed. Click Save
The Standard calculation box with NETTOTAL() and the Create button marked
As your customers add items, the Order Quantity, the Delivery Fee and the Net Amount change on the form. Your customers pay the Net Amount.
The Bakery order form with 7 cupcakes ordered, Order Amount $20.00, Order Quantity 7, Delivery Fee $14.00 and Net Amount $34.00

Summary

If your delivery cost depends on the number of items, a Google Form cannot count them or work out the fee. With Neartail, the QUANTITY function counts the order quantity and you write the fee as a formula based on that quantity. Create your order form and complete the steps above. If you have any questions, write to support.

Last updated: