How to calculate the total quantity ordered by the users?

Google Forms can ask how many of each product someone wants, but it won't add those numbers up. When a deal or a fee depends on the size of the order, a free item for every dozen or a shipping charge per item, you count each response yourself. In Neartail, every order form has an Order Quantity that uses the QUANTITY function, so the count is on your Google Form and changes as the customer picks. Other fields can use it too, for a discount, a delivery fee or a minimum order.

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

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("€")
  • 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

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
  • Enter Baker's dozen (Free cookies) as the new question's 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 )
  • 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() 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

A Google Form doesn't add up the quantities in an order. With Neartail, the QUANTITY function counts them on the form, and you can base free items, discounts and shipping fees on that count. Create your order form and complete the steps above. If you have any questions, write to support.

Last updated: