What you will build
Create the named function LINE_TOTAL(qty, unit_price, tax_rate) from a tested formula, then use it to calculate Total for all three sample rows and verify the results.
Learning objectives
Open the practice workbook
Practice in your own copy
Make your own Google Sheets copy with the same data, formulas, formatting, filter and frozen header. The original remains unchanged.
Sign in to Google. If the original is not publicly shared, download the full workbook and import it into Google Sheets, or paste the example data into your own sheet.
Hands-on practice
Step 1: Select D2, enter =A2*B2*(1+C2), and confirm the result is 16.5. This is the base formula used to verify the logic before creating the named function.
=A2*B2*(1+C2)Step 2: Open Data > Named functions. Select Add new function, set Function name to LINE_TOTAL, then add three Argument placeholders in this order: qty, unit_price, tax_rate.
Step 3: In Formula definition, enter =qty*unit_price*(1+tax_rate). Select Next, review the function name and three arguments, then select Create to save the named function.
Step 4: Return to D2 and enter =LINE_TOTAL(A2,B2,C2). Confirm D2 is still 16.5, then copy/fill D2 down through D4 instead of retyping the formula in each cell.
=LINE_TOTAL(A2,B2,C2)Checkpoint
| Qty | Unit price | Tax rate | Total |
|---|---|---|---|
| 3 | 5 | 0.1 | 16.5 |
| 2 | 20 | 0.1 | 44 |
| 1 | 12 | 0.1 | 13.2 |
For formula lessons, result cells must be calculated rather than typed manually.
Common mistakes and fixes
Do not use A2, B2, C2 directly in the named function Formula definition. The definition must use the placeholders qty, unit_price, tax_rate; cell references belong in the call =LINE_TOTAL(A2,B2,C2).
Independent practice
Change Qty in A2 from 3 to 4 and confirm D2 changes from 16.5 to 22; then restore A2 to 3 and confirm D2 returns to 16.5.
Key takeaways
- ✓Verify the base formula before turning its logic into a named function.
- ✓Create LINE_TOTAL from Data > Named functions with the arguments qty, unit_price, tax_rate.
- ✓Use =qty*unit_price*(1+tax_rate) in Formula definition rather than direct cell references.
- ✓Call =LINE_TOTAL(A2,B2,C2) in D2, then fill it down through D4.
- ✓The verified results are 16.5, 44, and 13.2; changing A2 to 4 should change D2 to 22.
Check your understanding
Answer four questions about the practice sheet.
Next lesson
Continue in recommended learning order with Make a copy of a spreadsheet.
Comments
No comments yet. Be the first to join the discussion.