Adding spreadsheet functions.
The checkbox value is 1 when it's selected and 0 otherwise. To prevent an accidental user input of negative value to quantity, we use ABS function to evaluate it. The formula for the subtotal is the checkbox's value times the quantity times unit price, and the formula for the total is the sum of the values in cell E1 to E4.
Note: cell variable (A1, A2, ...) and function names are case-insensitive.
- Click cell E1 and click the 'Edit formula' button on the cell's toolbar and enter B1 * ABS(C1) * D1 and click 'Apply'.
- Repeat for the cell E2, E3, and E4 with formula B2 * ABS(C2) * D2, B3 * ABS(C3) * D3, and B4 * ABS(C4) * D4, respectively.
- Click cell E5 and click the 'Edit formula' button on the cell's toolbar and enter SUM(E1:E4) and click 'Apply'.
You have now completed your order form. Congratulations!