Formulas and Essential Functions

Learn how Excel formulas work, master the most important built-in functions (SUM, AVERAGE, COUNT, IF, ROUND), and understand how to identify and fix common formula errors.

Video

Watch the lesson video, then complete the reading and challenge.

Presentation Slides

Review the slides below, then complete the reading and challenge.

How Formulas Work — the = sign, operators, and the order of operations in Excel
1 / 9

Lesson Notes

Read through the key concepts before you try the challenge.

Real-World Scenario

The office manager at Lakeside Medical Associates needs the supply tracker to automatically calculate total cost for each item (Quantity × Unit Cost), display a running total of all supply expenses, show the average cost per item, and flag any item with a quantity below the reorder level as 'LOW' in the Status column. All of this requires formulas — and writing a formula incorrectly produces wrong numbers that look correct, which is more dangerous than an obvious error. This lesson teaches you to write formulas with confidence and verify they are calculating correctly.

How Formulas Work

Every formula in Excel begins with an equals sign (=) — this tells Excel to treat what follows as a calculation rather than text or a number. Understanding the fundamentals of formula construction prevents the errors that trip up beginners:

  • Basic arithmetic formulas use standard operators: + (addition), - (subtraction), * (multiplication), / (division), ^ (exponentiation). The formula =B2*C2 multiplies the value in B2 by the value in C2 — in a supply tracker, this calculates Total Cost = Quantity × Unit Cost. Excel follows standard mathematical order of operations (PEMDAS): parentheses first, then exponentiation, then multiplication and division left to right, then addition and subtraction left to right. Use parentheses liberally to make the order explicit: =(B2+C2)*D2 is clearer and safer than =B2+C2*D2.
  • Cell references make formulas dynamic — instead of typing the actual numbers (=50*12.99), write the formula using cell addresses (=B2*C2). When the quantity or cost changes, the formula recalculates automatically. This is the fundamental reason formulas are more powerful than manual calculations: update the source data and every formula that references it updates instantly.
  • Relative cell references adjust automatically when a formula is copied to another cell — if =B2*C2 is in cell E2 and you copy it down to E3, Excel changes it to =B3*C3 automatically. This is the behavior you want when copying a total cost formula down 20 rows — each row's formula refers to that row's own data. This is why you write the formula once in E2 and copy it down, rather than writing a new formula in every row.
  • Absolute cell references use the $ sign to lock a reference so it does not change when copied — =$B$1 always refers to B1 regardless of where the formula is copied. Use absolute references when all rows should reference the same cell — such as a tax rate in B1 that should be applied to every row: =B2*$B$1. Press F4 while typing a cell reference to cycle through relative, absolute, and mixed reference styles.

Essential Functions: SUM, AVERAGE, COUNT, IF

Excel's built-in functions are pre-written formulas that perform common calculations — you provide the input (the range of cells to work with) and the function returns the result. These core functions cover the vast majority of calculations you will perform in a medical office setting:

  • SUM adds all values in a range — =SUM(E2:E25) adds all values in cells E2 through E25. This is the most-used function in Excel. The AutoSum button (Σ) in the Home tab inserts =SUM() and automatically suggests the range based on adjacent data — click a cell below a column of numbers and press Alt+= to insert a SUM formula instantly.
  • AVERAGE calculates the arithmetic mean of a range — =AVERAGE(C2:C25) returns the average quantity across all supply items. AVERAGE ignores blank cells (it does not count them in the denominator), which is the correct behavior for most data analysis. MIN and MAX return the smallest and largest values in a range: =MIN(C2:C25) finds the item with the lowest quantity, =MAX(D2:D25) finds the most expensive unit cost.
  • COUNT counts the number of cells that contain numbers — =COUNT(C2:C25) counts how many cells in the Quantity range have numeric values. COUNTA counts all non-empty cells regardless of data type — =COUNTA(A2:A25) counts how many rows have an item name (useful for knowing how many items are in the tracker). COUNTBLANK counts empty cells — useful for finding missing data.
  • IF evaluates a condition and returns one value if true and another if false — =IF(C2<=F2,"LOW","OK") checks whether the quantity in C2 is at or below the reorder level in F2 and returns 'LOW' if yes, 'OK' if no. This is exactly how a supply tracker Status column works. The syntax is =IF(logical_test, value_if_true, value_if_false). Nested IF allows chaining: =IF(C2=0,"OUT",IF(C2<=F2,"LOW","OK")) returns 'OUT' for zero quantity, 'LOW' for below reorder level, and 'OK' for adequate stock.
  • ROUND controls the number of decimal places in a result — =ROUND(B2*C2, 2) multiplies B2 by C2 and rounds to 2 decimal places, preventing floating-point calculation errors from appearing in financial totals. TODAY() returns the current date as a serial number that updates every time the file is opened — useful for 'Date Last Updated' fields. NOW() returns the current date and time.

Common Errors and Formula Auditing

Formula errors are a normal part of working in Excel — the key is recognizing what each error code means so you can fix it quickly rather than panicking or deleting the formula:

  • #DIV/0! means the formula is attempting to divide by zero — this happens when the divisor cell is empty or contains zero. For example, =AVERAGE(C2:C5) returns #DIV/0! if all four cells are empty. Fix by either ensuring the divisor is not empty, or wrapping the formula in IFERROR: =IFERROR(C2/D2, 0) returns 0 instead of the error if D2 is zero.
  • #VALUE! means the formula references a cell that contains the wrong type of data — for example, =B2*C2 returns #VALUE! if C2 contains text instead of a number. Check the referenced cells to confirm they contain the expected data type. This is often caused by numbers accidentally stored as text.
  • #REF! means the formula references a cell that no longer exists — this happens when rows or columns referenced by the formula have been deleted. Click the cell with #REF!, look in the formula bar for #REF! markers in the formula, and update the reference to point to the correct current cells.
  • #NAME? means Excel does not recognize a name in the formula — usually caused by a typo in a function name (=SUMM() instead of =SUM()), a reference to a named range that does not exist, or missing quotation marks around text in a formula. Read the formula carefully and correct the spelling or syntax.
  • Formula Auditing tools help you understand how a formula works — Formulas > Trace Precedents draws arrows to show which cells the selected formula uses as inputs. Formulas > Evaluate Formula walks through the calculation step by step, showing how Excel computes the result. These tools are invaluable when you inherit a spreadsheet built by someone else and need to understand what the formulas are doing.

Quick Reference: Formulas and Functions

Formulas and Functions Quick Reference — syntax for SUM, AVERAGE, COUNT, IF, ROUND, TODAY; relative vs absolute reference guide; error code lookup table with causes and fixes; formula auditing tool locations

Formulas and Functions Quick Reference — writing correct formulas for medical office data

Responsible Use

Formulas that produce wrong answers but no visible error codes are the most dangerous type of spreadsheet mistake — a Total Cost formula that multiplies the wrong columns may produce a plausible-looking number that is completely wrong. At Lakeside Medical Associates, incorrect cost calculations in the supply tracker could lead to over-ordering (wasting budget) or under-ordering (running out of critical medical supplies mid-shift). Always verify every new formula by manually calculating the expected result for at least 2–3 sample rows before using the spreadsheet for real decision-making. If you are uncertain about a formula, ask your supervisor to review it before the spreadsheet is used operationally.

AI Assist

💡 AI Task: Ask ChatGPT — 'I am building a supply tracker in Excel for a medical office. I have these columns: A=Item Name, B=Category, C=Quantity, D=Unit Cost, E=Total Cost, F=Reorder Level, G=Status. Write the exact Excel formulas for: (1) Total Cost (E column), (2) Status column showing OUT/LOW/OK based on quantity vs reorder level, (3) a grand total SUM of all Total Costs, (4) the average unit cost across all items, and (5) a count of how many items are currently LOW or OUT.' Test each formula in your supply tracker and verify the results are correct.

Knowledge Check

In your supply tracker, cell E2 contains the formula =C2*D2 (Quantity × Unit Cost). When you copy this formula down to E3, what formula does Excel place in E3?

Challenge

Apply what you've learned in this lesson.

Add a complete formula layer to your Lakeside Medical Associates supply tracker — making it automatically calculate totals, identify low stock, and provide summary statistics. Every number in your summary section must come from a formula, not a manually typed value.

  1. In the Total Cost column (E), write the formula =C2*D2 in E2 and copy it down all 20 rows. Verify each Total Cost is the product of that row's Quantity and Unit Cost. Apply Currency formatting to the Total Cost column.
  2. In the Status column (G), write a nested IF formula: =IF(C2=0,"OUT",IF(C2<=F2,"LOW","OK")). Copy down all 20 rows. Verify that items with zero quantity show 'OUT,' items at or below reorder level show 'LOW,' and adequately stocked items show 'OK.'
  3. Create a summary section starting at row 23: add labels in column A for Grand Total Cost, Average Unit Cost, Minimum Quantity, Maximum Unit Cost, Total Items Tracked, and Items at LOW or OUT status. Write the corresponding formula in column B for each: =SUM(E2:E21), =AVERAGE(D2:D21), =MIN(C2:C21), =MAX(D2:D21), =COUNTA(A2:A21), and =COUNTIF(G2:G21,"LOW")+COUNTIF(G2:G21,"OUT").
  4. Add a 'Last Updated' field in your summary section using =TODAY() so the date updates automatically whenever the file is opened. Format it as a long date (MMMM D, YYYY).
  5. Deliberately create a #DIV/0! error in a test cell by typing =B2/0, take a screenshot showing the error, then fix it using IFERROR. Delete the test cell and save the completed workbook as 'Supply Tracker with Formulas – Lakeside Medical.xlsx.'