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

If shipping costs more the more someone buys, the fee depends on how many items are in the order, and a Google Form doesn't count them. A charge of $2 an item, or $10 for the first and $5 for each one after, has to be worked out from every response by hand. Neartail's QUANTITY function counts the items on your Google Form, and you write the shipping fee as a formula on that count. Customers see the fee and the total change as they add items, and every order follows the same rule.

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 and click Generate.
  • Check the outline it suggests and click Proceed. Your form opens on the Edit tab.
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 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
  • In Field settings, 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 Field settings
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
  • Select Delivery Fee and click Next
The Add price field list, with Delivery Fee selected and Next marked
  • 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
  • In Field settings, 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. Your customers pay the Net Amount.
  • 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
  • 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
  • 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

A Google Form can't count the items in an order, so it can't charge shipping by quantity. With Neartail, the QUANTITY function counts them and your Delivery Fee formula uses that count, so customers see the fee before they submit. Create your order form and complete the steps above. If you have any questions, write to support.

Last updated: