Learning Objectives
The true power of Excel lies not in storing data, but in calculating with it. A formula is an instruction that tells Excel to perform a calculation using values, cell references, and operators. Every formula in Excel begins with an equals sign (=). When Excel sees the equals sign, it knows that what follows is a calculation to evaluate, not just text or a number to display.
Excel uses standard arithmetic operators to perform calculations:
=B2+C2 adds the values in cells B2 and C2.=D2-E2 calculates the difference.=F2*G2 multiplies the values in cells F2 and G2.=H2/I2 divides the value in H2 by I2.=J2^2 squares the value in J2.When a formula contains multiple operators, Excel follows the mathematical order of operations, remembered by the acronym PEMDAS:
This matters in healthcare calculations. Consider a formula to calculate a patient's Body Mass Index (BMI): BMI = weight (kg) / height (m) squared. In Excel, if weight is in cell B2 and height in meters is in cell C2, the formula would be =B2/C2^2. Excel first calculates C2^2 (height squared), then divides B2 by that result. To be explicit, you can use parentheses: =B2/(C2^2).
To enter a formula:
=B2+C2).Instead of typing cell references, you can select cells while building a formula. After typing the equals sign, select cell B2 (Excel inserts B2 into the formula), type the operator (+), then select cell C2. This point-and-select method reduces errors, especially in large worksheets.
Excel also supports comparison operators that return TRUE or FALSE:
=A2=B2 returns TRUE if the values match.These operators are critical for the IF function covered later in this lesson, where you need Excel to make decisions based on whether values meet certain criteria — such as whether a blood pressure reading exceeds a clinical threshold.
Healthcare Connection: A pharmacy technician needs to calculate the total cost of a prescription: the per-unit price in cell B2 multiplied by the quantity in cell C2, minus the insurance discount in cell D2. The formula =B2*C2-D2 follows the correct order of operations: multiplication first (B2*C2), then subtraction of the discount (D2). Using parentheses for clarity — =(B2*C2)-D2 — makes the formula easier for a colleague to understand.
Understanding how Excel handles cell references when you copy formulas is one of the most important concepts in spreadsheet design. According to Microsoft's documentation, there are three types of cell references: relative, absolute, and mixed. Each behaves differently when a formula is copied from one cell to another.
Relative References (Default) – A reference like A1 tells Excel to look at a cell in a relative position from the formula cell. When you copy a formula containing a relative reference, the reference automatically adjusts based on the new location.
=A2+B2.=A3+B3.=A4+B4.This is exactly what you want in most situations. If column A contains patient systolic blood pressure and column B contains diastolic, a formula in column C that calculates the difference (=A2-B2) should adjust for each row as you copy it down.
Absolute References – Use dollar signs to lock a cell address so it does not change when the formula is copied. The syntax is $A$1. The dollar sign before the column letter locks the column; the dollar sign before the row number locks the row.
=E2*$F$1.$F$1 stays locked on cell F1.Without the dollar signs, copying the formula would change F1 to F2, F3, and so on — pointing to empty cells and producing errors.
Mixed References – Lock either the row or the column, but not both:
$A1 – The column (A) is locked; the row adjusts when copied.A$1 – The row (1) is locked; the column adjusts when copied.Mixed references are used in more advanced formulas, such as lookup tables or matrices where you need one dimension to stay fixed while the other changes.
The F4 Shortcut – While editing a formula, place the cursor on a cell reference and press F4 to cycle through reference types:
$A$1 (absolute)A$1 (mixed — row locked)$A1 (mixed — column locked)A1 (relative, back to default)This shortcut is far faster than manually typing dollar signs and is essential for building accurate formulas efficiently.
Healthcare Connection: A medical office manager is calculating the total cost of supplies for multiple departments. Column E lists the item cost before tax, and cell G1 contains the sales tax rate (7.5%). The formula in F2 is =E2*$G$1. Using an absolute reference for the tax rate cell ensures that when the formula is copied down for all 50 items, every row correctly multiplies its item cost by the same tax rate in G1. If the tax rate changes, updating cell G1 once automatically recalculates all 50 rows.
▶ Excel Formulas and Functions | Full Course • Kevin Stratvert
While formulas using arithmetic operators are powerful, Excel's built-in functions simplify common calculations dramatically. A function is a predefined formula that performs a specific calculation. Every function follows the same basic syntax:
=FUNCTIONNAME(argument1, argument2, ...)
The arguments inside the parentheses tell the function which cells or values to use. Let's examine the five most essential functions for healthcare data analysis.
The SUM function adds all numbers in a specified range:
=SUM(number1, [number2], ...)
The most common usage is to sum a continuous range: =SUM(B2:B50) adds all values from B2 through B50. You can also sum multiple ranges: =SUM(B2:B50, D2:D50).
Healthcare example: Calculate the total number of patient visits across all weekdays. If cells B2 through B6 contain the daily visit counts for Monday through Friday, =SUM(B2:B6) returns the weekly total.
The AVERAGE function calculates the arithmetic mean of a range of numbers:
=AVERAGE(number1, [number2], ...)
Healthcare example: Calculate the average patient wait time. If column C contains wait times in minutes for 30 patients, =AVERAGE(C2:C31) returns the average wait time. This metric is commonly tracked to monitor operational efficiency and patient satisfaction.
COUNT counts cells containing numeric values: =COUNT(value1, [value2], ...)
COUNTA counts all non-empty cells, regardless of content: =COUNTA(value1, [value2], ...)
Healthcare example: Count how many patients have recorded blood pressure readings this month. If column D contains systolic BP readings but some cells are blank, =COUNT(D2:D100) returns only cells with numeric entries. Use =COUNTA(A2:A100) to count patient name entries (text values) in the roster.
MIN returns the smallest value, and MAX returns the largest:
=MIN(number1, [number2], ...)=MAX(number1, [number2], ...)
Healthcare example: Identify the shortest and longest patient wait times. If column C contains wait times, =MIN(C2:C31) returns the shortest wait and =MAX(C2:C31) returns the longest. Clinic managers use these alongside the average to understand the full range of the patient experience.
AutoSum is a toolbar shortcut that inserts the SUM function automatically. Select a cell directly below or to the right of a column or row of numbers, then select the AutoSum button (the Greek sigma symbol Σ on the Home tab). Excel guesses the range and inserts =SUM(...).
You can also use the keyboard shortcut Alt+= (press Alt and the equals sign simultaneously) to trigger AutoSum. Select the AutoSum drop-down arrow to choose AVERAGE, COUNT, MIN, or MAX instead.
| Function | Syntax | What It Does | Healthcare Example |
|---|---|---|---|
| SUM | =SUM(range) | Adds all numbers in the specified range | =SUM(B2:B31) totals monthly patient visits across 30 days |
| AVERAGE | =AVERAGE(range) | Calculates the arithmetic mean of a range | =AVERAGE(C2:C31) finds the average patient wait time in minutes |
| COUNT | =COUNT(range) | Counts cells containing numeric values | =COUNT(D2:D100) counts patients with recorded BP readings |
| COUNTA | =COUNTA(range) | Counts all non-empty cells (numbers and text) | =COUNTA(A2:A100) counts patient name entries in the roster |
| MIN | =MIN(range) | Returns the smallest value in a range | =MIN(C2:C31) identifies the shortest patient wait time |
| MAX | =MAX(range) | Returns the largest value in a range | =MAX(C2:C31) identifies the longest patient wait time |
| IF | =IF(test, true, false) | Returns one value if TRUE, another if FALSE | =IF(D2>140,"HIGH","Normal") flags elevated systolic BP |
| AutoSum | Alt+= or Σ button | Shortcut that auto-inserts SUM (or others) | Select below copay amounts, press Alt+= to total instantly |
Healthcare Connection: A clinic's front desk manager tracks daily patient wait times in an Excel spreadsheet. At the end of the month, they use =AVERAGE(C2:C31) to report the average wait time (target: under 15 minutes), =MAX(C2:C31) to identify the worst wait (for process improvement), =COUNT(C2:C31) to confirm the number of data points, and =SUM(B2:B31) to total all patient visits. These four functions transform raw data into actionable metrics for clinic leadership.
The IF function is one of the most powerful and widely used functions in Excel because it enables your spreadsheet to make decisions. According to Microsoft's official documentation, the IF function checks whether a condition is true or false, then returns one value if TRUE and a different value if FALSE.
The syntax of the IF function is:
=IF(logical_test, value_if_true, value_if_false)
You have a patient vitals spreadsheet where column D contains systolic blood pressure readings. You want column E to display "HIGH" if the systolic BP is 140 or above and "Normal" if below 140.
=IF(D2>=140"HIGH""Normal")=IF(D2>=140,"HIGH","Normal")The value_if_true and value_if_false arguments can be numbers, cell references, or even other formulas:
=IF(C2>60, C2*0.10, 0) – If a patient's outstanding balance exceeds $60, calculate a 10% late fee; otherwise $0.=IF(B2="Yes", 1, 0) – If a consent form column says "Yes," assign 1 (complete); otherwise 0. Summing this column gives a total count of completed forms.You can place one IF function inside another to handle multiple conditions. This is called nesting. To categorize blood pressure readings into three levels:
=IF(D2>=140,"HIGH",IF(D2>=120,"Elevated","Normal"))
This formula first checks if D2 is 140 or above (HIGH). If not, it checks if D2 is 120 or above (Elevated). If neither, it returns "Normal." You can nest up to 64 IF functions, but for readability, try to limit nesting to two or three levels.
=IF(D2>=140,HIGH,Normal) without quotes will cause Excel to look for cell ranges named HIGH and Normal, likely returning an error.Healthcare Connection: The IF function is invaluable for clinical alert systems. A nurse reviewing patient vitals can use =IF(G2<95,"LOW O2 - ALERT","OK") in the SpO2 column to flag patients with oxygen saturation below 95%. Combined with conditional formatting (from Lesson 4-1), the IF function creates a simple but effective monitoring tool that draws immediate attention to patients who may need intervention.
Once your spreadsheet contains data and formulas, you need tools to organize and explore that data. Sorting rearranges your data rows based on the values in one or more columns, making it easier to identify patterns, find specific records, and prepare data for reports.
The simplest sort rearranges data based on one column:
For text, ascending means alphabetical order (A to Z); for numbers, ascending means smallest to largest; for dates, ascending means oldest to newest.
Multi-column sorting lets you sort by a primary column, then by a secondary column within ties. For example, sort patients first by department, then alphabetically by last name within each department.
Best Practice: Ensure your data has headers – Check the "My data has headers" box in the Sort dialog so Excel does not sort your header row into the data. Also avoid blank rows or columns — blanks can cause Excel to sort only a portion of your data, separating related records.
Healthcare Connection: A clinic manager reviewing patient wait times sorts the data by wait time in descending order to identify the longest waits. Then, using a multi-column sort, they sort by appointment type (routine vs. urgent) and then by wait time within each type. This analysis reveals whether urgent patients are being prioritized appropriately or whether all patients experience similar delays.
While sorting rearranges all your data, filtering temporarily hides rows that do not meet specific criteria, letting you focus on a subset. Excel's AutoFilter feature is the primary tool for filtering data.
To enable AutoFilter:
Checkboxes – Check or uncheck specific values. In a Department column, uncheck all except "Cardiology" to see only cardiology patients.
Text Filters – Filter text columns by "Contains," "Begins With," "Equals," etc. Example: Filter patient names that begin with "S" to quickly locate a record.
Number Filters – Filter numeric columns by "Greater Than," "Less Than," "Between," "Top 10," etc. Example: Filter systolic BP for readings greater than 140 to identify patients needing follow-up.
Custom Filters – Combine two conditions with AND or OR logic. Examples:
A filtered column's drop-down arrow changes to a funnel icon, reminding you that a filter is active. To clear a filter, select the funnel icon and choose Clear Filter From [Column Name]. Filtering hides rows but does not delete them — all hidden data remains in the worksheet.
Data validation restricts the type of data that can be entered into specific cells, reducing errors at the point of entry. This is particularly important in healthcare, where accurate data entry can impact patient care and billing.
A named range assigns a descriptive name to a cell or range of cells, making formulas easier to read. Instead of =SUM(C2:C31), name the range C2:C31 as WaitTimes and write =SUM(WaitTimes). To create a named range: select the range, click in the Name Box (left of the formula bar), type a descriptive name, and press Enter.
Healthcare Connection: A medical records coordinator needs to find all patients seen in the Emergency department during January 2026 with systolic blood pressure above 140. Using AutoFilter, they filter the Department column for "Emergency," the Date column for January 2026, and the Systolic BP column for values greater than 140. Within seconds, the spreadsheet displays only matching records. Data validation on the Department column ensures every entry is one of the approved department names, preventing filtering errors caused by inconsistent data entry like "ER" versus "Emergency."
Try It — Formula Builder: For each healthcare scenario, write the correct Excel formula before revealing the answer.
Challenge 1: Calculate the total supply cost from cells B2 through B15.
=SUM(B2:B15) — SUM adds all values in the range. Much more efficient than adding cells individually.
Challenge 2: Find the average patient wait time from 50 recorded times in cells C2:C51.
=AVERAGE(C2:C51) — AVERAGE calculates the mean, the standard measure for "typical" values like wait times.
Challenge 3: Count how many patients are listed in column A (cells A2:A200, some cells may be empty; patient names are text).
=COUNTA(A2:A200) — COUNT only counts numbers, but patient names are text — COUNTA counts all non-empty cells.
Challenge 4: Create a formula that displays "FEVER" if a patient's temperature in cell G2 is 100.4 or higher, and "Normal" otherwise.
=IF(G2>=100.4,"FEVER","Normal") — IF syntax: (logical_test, value_if_true, value_if_false). Text must be in quotation marks.
Lesson 4.2 Summary