How to calculate the total quantity ordered by the users?

This is a common question from small bakers and shops who sell by the piece. For example, you might give a free cookie for every dozen or work out a shipping fee from the number of items. A Google Form can ask for the quantity of each product, but it cannot add those quantities up, so you count them by hand. With Neartail, the QUANTITY function is already in your form. Your customers will see the order quantity as they pick. Even better, you can use that count to offer discounts and calculate shipping fees.

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

Use QUANTITY function to calculate order quantity

You can use the QUANTITY function to calculate the order quantity. The syntax for the QUANTITY function is:
QUANTITY(currency)
where
  • currency - currency symbol or text used to display the price of the products.
For example:
  • If the price format is $50 each, $5.75 per kilo etc, the formula to calculate the order quantity is QUANTITY("$")
  • If the price format is €50 each, €5.75 per kilo etc, the formula to calculate the order quantity is QUANTITY("€")
  • 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

Baker's dozen: How to offer a free cookie for every dozen?

  • Click on the Order Quantity question, then click Add field in the toolbar on the right
The form in the editor, with the Add field icon marked in the toolbar on the right
  • New question will be displayed. Enter Baker's dozen (Free cookies) as its title, then click the ⚙️ icon
The Baker's dozen (Free cookies) question selected in the editor, with its title and the gear at the bottom of its card marked

Use Math.floor to calculate the number of dozens

Math.floor function returns the largest integer less than or equal to a given number. The syntax for Math.floor function is:
Math.floor(number)
where
  • number - This could be a number or a calculation that returns a number.
Baker's dozen is 13. To offer a free cookie for every dozen that a user orders, we can calculate the number of dozens by dividing the order quantity by 12. Since we only need a round number, we can use the Math.floor function to calculate the exact number of free cookies.
Math.floor( QUANTITY() / 12 )
  • 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() divided by 12 inside Math.floor in the Calculate box, with the Answer tab and the box marked
As your customers add items, the Order Quantity and the free cookies change on the form.
The Bakery order form with 25 items ordered, Order Amount $70.00, Order Quantity 25 and Baker's dozen (Free cookies) 2

Summary

If you need to know how many items are in an order, a Google Form cannot add the quantities up. With Neartail, the QUANTITY function is already in your form and you can base discounts and shipping fees on the order quantity. Create your order form and complete the steps above. If you have any questions, write to support.

Last updated: