Computer Fundamentals and Introduction to Programming · Lecture Notes
Chapter 3.2: Microsoft Excel
The measurements of a lab experiment, a course's grade list, a project's materials budget, or a shop's stock record can all be organized the same way: records go in rows and attributes in columns. Spreadsheet programs combine this layout with calculation. A formula typed into a cell produces a result from the values in other cells and updates that result automatically when those values change. These notes start from the basic concepts of Microsoft Excel, such as the workbook, the cell, and the range. They then cover formulas, cell references, commonly used functions, data-management and analysis tools, and charts. The notes use the tab and command names of the English interface of Microsoft 365 and the English function names. Arguments are separated by commas, as in English-language Excel. The result of every formula is shown calculated step by step.
Learning outcomes
- Workbook
- Use the concepts of workbook, worksheet, cell, row, column, and range correctly; enter data of the appropriate type into a cell and explain that a number format changes only the display.
- Formulas
- Calculate formula results according to operator precedence; predict in advance how relative, absolute, and mixed references change when copied; compute with basic, logical, conditional, and lookup functions; find and fix the causes of error values.
- Data management
- Apply tables, sorting, filtering, SUBTOTAL, conditional formatting, PivotTables, and data validation.
- Visualization
- Choose the chart type that suits the purpose of the data and format the chart so that it does not mislead; prepare a workbook for printing, sharing, and protection.
3.2.1Excel and the worksheet
Excel works on a grid of rows and columns. Each box of the grid can hold a number, a piece of text, or a formula. This simple structure suits very different jobs, from a small shopping list to thousands of rows of measurement data. This section explains the parts of the grid and what they are called.
3.2.1.1What is a spreadsheet for?
Consider a grade sheet kept on paper. Each student's midterm and final grades are written down, and then the averages are worked out one by one on a calculator. If a grade was entered wrongly, that student's average is recalculated. The class average is found again from scratch. A spreadsheet turns this around. The average is written once as a formula; when one of the grades changes, the result refreshes by itself.
A spreadsheet is a program that holds data in cells arranged in rows and columns and calculates from that data with formulas written in the cells. Microsoft Excel, LibreOffice Calc, and Google Sheets are common examples of the kind.
The main uses of Excel can be grouped under six headings:
- Calculation. Calculations done with formulas and functions are repeatable. If the same calculation is to be done again with new data, only the data is changed.
- List management. Records of students, products, customers, or measurements are kept in order in rows and columns.
- Analysis. Records are sorted, those that meet a condition are filtered out, and totals and averages are produced by group.
- Visualization. Numbers are turned into charts; trends and comparisons are seen at a glance.
- Planning. Budgets, calendars, stock, and task tracking are run in table form.
- Sharing. A workbook stored in the cloud can be edited by several people at the same time, who can also add comments to cells.
For an engineering student the most important of these is often calculation. The current of a circuit at different resistor values, the mean of an experiment's measurements, or the total cost of a bill of materials can be found in Excel with a few formulas. Once a formula is written correctly, it can be copied down hundreds of rows.
3.2.1.2Workbook, sheet, and cell
Every file opened in Excel is a workbook. Inside the workbook are one or more worksheets. Each sheet is a separate table with the same grid structure. The sheet names appear on tabs at the bottom of the window; when a new workbook is opened there is a single sheet, named “Sheet1”.
A workbook is the whole Excel file; today its default extension is .xlsx. A worksheet is a single grid of cells inside the workbook. A cell is the single box where a row and a column intersect, and it holds a single value or formula.
In the Excel window there are several important elements around the grid. Figure 3.2.1 shows them together.
- Name Box: shows the address of the selected cell. Typing an address here and pressing Enter goes to that cell. For example, typing
Z500is faster than scrolling with the mouse for a long time. - Formula bar: shows the actual content of the active cell. If the cell holds a formula, the cell shows the result and the formula bar shows the formula itself.
- Column letters and row numbers: the headers along the edges of the grid. Clicking a header selects the whole column or row.
- Active cell: the cell that is currently selected and into which what you type will go. It is shown with a bold border.
- Sheet tabs: list the sheets in the workbook. The + button next to the tabs adds a new sheet.
At the top of the window is the ribbon. The ribbon divides commands into tabs: File, Home, Insert, Page Layout, Formulas, Data, Review, and View. In these notes the location of a command is written as “Data → Sort”. This notation means that the Data tab is chosen first, and then the Sort button on that tab.
3.2.1.3Cell address and range
Every cell has an address. The address is written with the column letter first, then the row number: C3 is the cell where column C and row 3 intersect. Column letters run from A to Z; after Z two-letter names begin: AA, AB, …, AZ, BA. In Microsoft 365 Excel a sheet has 1,048,576 rows and 16,384 columns. The last column is named XFD.
Which columns from the start are AB and XFD? How many cells are there on a sheet in all?
- A single letter. A = 1, B = 2, …, Z = 26. Column letters resemble a number system with 26 digits.
- AB. The first letter counts “rounds” of 26, and the second letter gives the position within the round: A × 26 + B = 1 × 26 + 2 = 28. So AA is column 27 and AB is column 28.
- XFD. X = 24, F = 6, D = 4. With three letters the first letter counts rounds of 26 × 26 = 676: 24 × 676 + 6 × 26 + 4 = 16,224 + 156 + 4 = 16,384. This number is 214.
- Number of cells. 1,048,576 rows (220) × 16,384 columns = 17,179,869,184 cells, that is, about 17 billion cells.
These limits are rarely stretched in practice. Even so, data with millions of rows does not fit on one sheet. For data of that size, other tools such as a database or a programming language are used.
Most calculations are done not with a single cell but with a group of cells. A rectangular region made of adjacent cells is called a range.
A range is a rectangular block of cells determined by its top-left and bottom-right corner cells, and is written with a colon between the two addresses: B4:D6 covers the nine cells from B4 to D6.
How many cells do the ranges B4:D6, A1:A10, and C3:F10 contain?
- Formula. Number of columns = last column − first column + 1; number of rows = last row − first row + 1. The number of cells is the product of the two. The “+ 1” comes from both end cells being included in the range.
- B4:D6. Columns B, C, D: 4 − 2 + 1 = 3. Rows 4, 5, 6: 6 − 4 + 1 = 3. Number of cells 3 × 3 = 9.
- A1:A10. A single column, 10 − 1 + 1 = 10 rows: 10 cells.
- C3:F10. C, D, E, F: 4 columns. 10 − 3 + 1 = 8 rows. 4 × 8 = 32 cells.
There are several ways to select a range. The mouse can be dragged from the top-left cell to the bottom-right cell. Or the first cell is selected and, holding Shift, the last cell is clicked. Typing B4:D6 in the Name Box gives the same result. Cells that are not adjacent are selected one by one while holding the Ctrl key.
3.2.1.4A value in a cell, a formula in a cell
A cell can hold two kinds of content. The first is a value typed directly, such as the number 12 or the word “Pen”. The second is a formula that begins with an equals sign. A formula uses the addresses of other cells and calculates its result from the values in those cells. Figure 3.2.2 shows a small shopping table.
=B2*C2).The formula =B2*C2 is typed in cell D2. Excel reads this formula as: “multiply the value in B2 by the value in C2.” Since B2 holds 12 and C2 holds 8, D2 shows 12 × 8 = 96. By the same logic, the formula =B3*C3 in D3 gives 5 × 30 = 150. The formula uses not the numbers themselves but the addresses of the cells where the numbers are. The real power of a formula comes from this distinction.
In Figure 3.2.3 the number of pens has been raised from 12 to 20. The formula in D2 is still =B2*C2, but because B2 changed, the result becomes 20 × 8 = 160. Had =12*8 been typed in the formula instead of the cell references, the formula would have had to be corrected by hand when the quantity changed. For this reason, cell addresses are used in formulas instead of constant numbers wherever possible.
Typing the calculated result by hand instead of a formula. For example, if the number 96 is typed directly into D2, then when B2 changes, D2 stays at the old value. The cell looks the same, but the table is now wrong. Whether a cell holds a value or a formula can be told by looking at the formula bar.
3.2.2Data entry
Excel interprets what is typed into a cell: “12” is taken as a number, “Pen” as text, and “2024-03-01” as a date. This interpretation determines whether calculations will come out right. This section covers data types, practical ways to enter data into a cell, and operations on the rows and columns of the sheet.
3.2.2.1Data types
A data type is the kind of value in a cell, and it determines which operations can be done with that value. The main types in Excel are text, number, date and time, logical value, formula, and error value.
- Text: content that is not counted in calculations, such as a name, a description, or a category. “Pen”, “Electrical”, and “A-101” are each text.
- Number: a quantity that can be counted in calculations. In English settings the decimal separator is the period: 35.5 is a number. If 35,5 is typed, English-language Excel does not recognize it as a number and stores it as text; an entry such as 3/5, meanwhile, can even turn into a date (March 5).
- Date and time: Excel stores dates behind the scenes as numbers. That is how the difference in days between two dates is found by subtraction.
- Logical value: can be only
TRUEorFALSE. The results of comparison formulas are of this type: the formula=5>3gives TRUE. - Formula: a calculation that begins with an equals sign. The cell shows not the formula itself but its result.
- Error value: a special result that appears when a formula cannot be calculated.
#DIV/0!,#NAME?, and#VALUE!are examples of this type.
Excel signals the type of what is entered in a cell by its alignment. If no special alignment has been given to the cell, text is left-aligned, numbers and dates are right-aligned, and logical values and error values are centered. Figure 3.2.4 shows these default alignments.
This rule is a small but valuable checking tool. If one of the numbers in a column sits left-aligned, that cell has most likely been stored as text. Such a cell is not included in the calculation of functions like SUM. The cause of a wrong total is often a cell like this.
In an Excel with English (US) settings, 250, 12.5, 2024-03-01, 12 TL, and TRUE are typed in order into cells A1:A5. What are the type and alignment of each cell? What does =A1+A2 give?
- A1 = 250. It consists only of digits: a number, right-aligned.
- A2 = 12.5. Because the decimal separator is the period, it is recognized as a number and right-aligned.
- A3 = 2024-03-01. The year-month-day pattern is recognized as a date; since a date is also a number, it is right-aligned.
- A4 = 12 TL. It has letters at the end; Excel cannot convert it to a number and stores it as text. It is left-aligned.
- A5 = TRUE. It is recognized as a logical value and centered.
- Formula.
=A1+A2= 250 + 12.5 = 262.5.
If you try to calculate with the “12 TL” in A4, a #VALUE! error appears. The right way to show a currency is to type only 12 in the cell and add the unit with a number format.
3.2.2.2Entering and editing data
To enter data into a cell, select the cell, type, and press Enter. Enter confirms the entry and moves to the cell below; Tab moves to the cell on the right. To correct the content of a cell without deleting it, enter Edit mode. This mode is entered with the F2 key or by double-clicking the cell. In Edit mode the cursor is inside the cell, and the arrow keys move the cursor within the text instead of changing cells. Table 3.2.1 summarizes the keys used most often in data entry.
| Action | Key | Description |
|---|---|---|
| Edit a cell | F2 | Switches to Edit mode; the content is corrected without being deleted. |
| Confirm the entry | Enter | Enters the value and moves to the cell below. |
| New line inside a cell | Alt+Enter | Starts a second line in the same cell. |
| Cancel the entry | Esc | Cancels what was typed; the old content stays. |
| Clear the content | Delete | Deletes the value; the cell's format stays. |
| Select a row | Shift+Space | Selects the whole row of the active cell. |
| Select a column | Ctrl+Space | Selects the whole column of the active cell. |
Column C in Figure 3.2.5 shows an important case. Values such as a student number, a postal code, or a product code consist of digits, but the leading zeros are meaningful. If Excel takes 00125 as a number, it drops the leading zeros and shows 125. To keep the zeros, the value is stored as text: either an apostrophe is typed into the cell first ('00125) or the cell is formatted as Text beforehand. In this case Excel puts a green triangle in the top-left corner of the cell and gives the warning “Number stored as text”.
Storing values as text is right for codes that will not enter calculations. Numbers that will enter calculations must never be stored as text. Such cells also land in the wrong place when sorting, because text is sorted separately from numbers.
Using numbers copied from another program without checking them. Numbers that come from web pages or text files are often pasted as text; sometimes there is an invisible space at the end as well. The total of such a column comes out too low, and no error message appears. Left-aligned numbers and green triangles are the signs of this problem. It is fixed by choosing Convert to Number from the warning button next to the green triangle.
Two principles are worth following when entering data. The first is that a cell holds a single observation: instead of “12 kg”, only 12 is typed and the unit moves to the column header. The second is that a column holds a single attribute: dates and descriptions are not mixed in the same column. These two principles are the precondition for sorting, filtering, and formulas to work without trouble.
3.2.2.3Rows, columns, and sheets
As a table grows, operations on rows and columns become necessary. These are done both from the right-click menu and from the Cells group on the Home tab (Insert, Delete, Format).
- Inserting and deleting. When a row is inserted, the rows below it shift down; when a column is deleted, the columns to its right shift left. The addresses in formulas update by themselves to follow this shift.
- Size. Row height and column width are adjusted by dragging the line between the headers. Double-clicking the line widens the column automatically to fit its longest content.
- Hiding. A hidden row or column is not deleted; it is only removed from view. Formulas keep using hidden cells.
- Freezing. When you scroll down a long list, the header row leaves the screen and you forget which column is which. The View → Freeze Panes → Freeze Top Row command keeps row 1 fixed on the screen.
- Sheet name and layout. Instead of names like “Sheet1”, short names that describe the content are used: “Data”, “Calc”, “Report”. Raw data, calculation, and report can be kept on separate sheets.
Freezing is not limited to the first row. The Freeze First Column command fixes column A; this is useful in wide tables whose row headers are in that column. To freeze both a row and a column, first select the first cell below and to the right of the part that is to stay fixed, then give the Freeze Panes command. For example, if B2 is selected, row 1 and column A freeze together.
3.2.3Formatting
The same data reads very differently before and after formatting. A table with a clear header, aligned numbers, and explicit units is both easier to read and less likely to be misunderstood. Formatting in Excel has two separate layers: the appearance of the cell (font, color, border, alignment) and the way a number is displayed. The second layer matters separately for calculations.
3.2.3.1Cell formatting
The cell-formatting commands are collected in the Font, Alignment, Number, and Styles groups on the Home tab. All the options are also in the Format Cells dialog, which opens with Ctrl+1. The tabs of the dialog are Number, Alignment, Font, Border, Fill, and Protection.
- Font and fill. Bold text and a light fill color set the header row apart from the rest of the data.
- Alignment. Determines the horizontal and vertical position of the text inside the cell. Keeping numbers right-aligned makes the digits line up.
- Border. Shows the edges of the table. Adding a heavy border to every cell, however, clutters the table and makes it harder to read.
- Wrap Text. Splits a long text over several lines inside the cell without widening the column.
- Merging. The Merge & Center command makes several cells look like one. It can be used in a report title, but merged cells in a data range break sorting and filtering.
- Cell style. Ready-made sets of formatting. A format is defined once and applied consistently across the whole workbook.
Merging cells in the middle of a data table. For example, if the department name of three students in the same department is typed into a single merged cell, Excel sees the department of the second and third rows as empty. Sorting stops with the warning “To do this, all the merged cells need to be the same size”; a filter also finds only the first row. The department name must be typed separately in every row.
3.2.3.2Number formats
The number in a cell can be displayed in different formats. The value 0.25 appears as 25% in percentage format, and the value 45292 as 1/1/2024 in date format. Changing the format does not change the number stored in the cell; it only determines how that number is written on screen.
A number format is a rule that determines how the value stored in a cell is shown on screen. A format does not change the value: calculations always use the underlying value shown in the formula bar.
| Stored value | Format | Shown in the cell |
|---|---|---|
| 0.25 | Percentage | 25% |
| 1250 | Currency | ₺1,250.00 |
| 45292 | Date | 1/1/2024 |
| 0.5 | Time | 12:00 |
| 123456789 | Scientific | 1.23E+08 |
Each row of Table 3.2.2 shows a rule. Percentage format shows the value multiplied by 100 with a percent sign appended; the cell still holds 0.25. Currency format adds a thousands separator and two decimal places. Why date and time values are numbers is explained in 3.2.8.1. In short, 1 day corresponds to the number 1; 0.5 is half a day, that is, 12 hours. In scientific format 1.23E+08 means 1.23 × 108.
The difference between the shown value and the stored value is most confusing with decimal places. The Decrease Decimal button shows a number with fewer digits but does not round it. Calculations are always done with the full value in the formula bar.
The values 1.4, 1.4, and 1.4 are typed into cells A1, A2, and A3 in order, and all three are given a number format with 0 decimal places. The cells show 1. What does the formula =SUM(A1:A3) in A4 show?
- Stored values. Because the format affects only the display, 1.4 stays in the cells.
- Total. 1.4 + 1.4 + 1.4 = 4.2.
- Display. If A4 also has a 0-decimal format, 4.2 is shown as 4.
A reader of the table expects 1 + 1 + 1 = 3 but sees 4. If you want calculations to use the displayed values, the value must actually be rounded: a formula such as =ROUND(A1,0) turns 1.4 into 1, and later calculations use this rounded value.
The ready-made number-format options are in the drop-down list in the Home → Number group: General, Number, Currency, Accounting, Short Date, Long Date, Time, Percentage, Fraction, Scientific, and Text. The Custom category in the Format Cells box lets you write your own format code. For example, the code 0.0 "kg" shows the value 12 as “12.0 kg”. Because the number 12 is still stored in the cell, this value takes part in calculations.
Entering a percentage on the wrong scale. When 20 is typed into a cell already formatted as a percentage, Excel takes it as 20% and stores 0.2. If 20 is typed into an unformatted cell and the percentage format is applied afterwards, the cell shows 2000%, because the stored value is 20. The value of a ratio cell should always be checked in the formula bar: for 20% it should show 0.2 or 20%.
3.2.4Formulas and operator precedence
The calculating power of Excel comes from formulas. A formula is what you would type into a calculator, enriched with cell addresses. This section covers the parts of a formula, the order in which Excel performs operations, and a surprising case that arises from that order.
3.2.4.1The parts of a formula
A formula is a calculation expression typed into a cell that begins with an equals sign (=). A formula can contain four kinds of element: a constant (a value typed directly, such as 5), a cell reference (the address of another cell, such as C1), an operator (an operation sign such as +, −, *, /), and a function (a ready-made calculation such as SUM).
=SUM(B2:B4)*C1+5: the equals sign at the start of the formula, the SUM function, the range reference B2:B4, the multiplication and addition operators, the cell reference C1, and the constant 5.The formula in Figure 3.2.9 reads: “multiply the sum of B2, B3, and B4 by C1 and add 5 to the result.” If B2:B4 holds 10, 20, and 30 and C1 holds 2, the result is (10 + 20 + 30) × 2 + 5 = 60 × 2 + 5 = 125.
If the equals sign is forgotten, Excel stores what was typed as text, not as a formula. No calculation is done in a cell that holds B2*C2; the text appears in the cell exactly as typed. The operators in Excel are as follows:
- Arithmetic:
+addition,-subtraction and negation,*multiplication,/division,^exponentiation,%percent. - Comparison:
=,>,<,>=,<=, and<>for not equal. The result is TRUE or FALSE. - Concatenation:
&joins two pieces of text side by side.=A1&" TL"produces the text “1250 TL” if A1 holds 1250. Concatenation does not use the number's format; even if A1 is displayed in currency format, the result contains no thousands separator. - Reference: a colon (
:) forms a range:B2:B4.
Three principles guide good formula writing. First, when the order of operations is in doubt, use parentheses: =(B2+C2)/2 is the average of two grades. Second, the result is recalculated when the referenced cells change; that is why formulas are written with addresses instead of values. Third, constants such as a VAT rate or a discount rate are not embedded in the formula but typed into a separate cell. When the rate changes, only that cell is updated.
3.2.4.2Operator precedence
When a formula has several operators, Excel applies them in a particular order. This order largely resembles precedence in mathematics: first parentheses, then exponents, then multiplication and division, and last addition and subtraction. Excel's order has two additional levels: negation (the minus sign) and percent.
Operator precedence is the set of rules that determines the order in which the operators in a formula are applied. Operators of the same precedence are applied from left to right.
| Precedence | Operation | Example |
|---|---|---|
| 1 | Parentheses | =(A1+B1)*2 |
| 2 | Negation (sign) | =-A1 |
| 3 | Percent | =A1*10% |
| 4 | Exponent | =A1^2 |
| 5 | Multiplication and division | =A1*B1/C1 |
| 6 | Addition and subtraction | =A1+B1-C1 |
| 7 | Concatenation | =A1&" TL" |
| 8 | Comparison | =A1>B1 |
The “left to right” rule applies to operations at the same level. In the formula =12/3*2, division and multiplication have the same precedence. Excel does the operation on the left first: 12 / 3 = 4, then 4 × 2 = 8. If the multiplication were done first, 12 / 6 = 2 would result; that is wrong.
It also helps that comparison comes last. In the formula =A1+B1>100, the addition is done first and then the total is compared with 100. So the question “does the sum of the two grades exceed 100?” can be written without parentheses.
What is the result of the formula =5+3*2^2-8/4? What is the result if parentheses are added at the start, giving =(5+3)*2^2-8/4?
- Exponent. The formula has no parentheses or negation; the highest precedence is the exponent: 2^2 = 4. The formula becomes
5+3*4-8/4. - Multiplication and division, left to right. 3 × 4 = 12, then 8 / 4 = 2. The formula becomes
5+12-2. - Addition and subtraction, left to right. 5 + 12 = 17, 17 − 2 = 15.
- The parenthesized form. Parentheses first: 5 + 3 = 8. Then the exponent: 2^2 = 4. Then multiplication and division: 8 × 4 = 32 and 8 / 4 = 2. Last, 32 − 2 = 30.
A single pair of parentheses doubled the result. Parentheses are the only way to change the order of operations.
3.2.4.3Evaluating a formula step by step
When Excel evaluates a formula, it first replaces the cell references with the values in those cells. Then it carries out the operations one at a time in order of precedence. At each step the formula gets a little shorter, until a single value is left. This process can be followed step by step on screen with the Formulas → Formula Auditing → Evaluate Formula command. Table 3.2.4 shows the evaluation of the formula =2+3*(B1-1)^2 when B1 holds 4.
| Step | Operation performed | New form of the formula |
|---|---|---|
| 0 | Start | =2+3*(B1-1)^2 |
| 1 | The reference is replaced by its value: B1 → 4 | =2+3*(4-1)^2 |
| 2 | Inside the parentheses: 4 − 1 = 3 | =2+3*3^2 |
| 3 | Exponent: 3^2 = 9 | =2+3*9 |
| 4 | Multiplication: 3 × 9 = 27 | =2+27 |
| 5 | Addition: 2 + 27 = 29 | =29 |
The result is 29. Figure 3.2.10 shows the first step of this process. If the parentheses were removed and =2+3*B1-1^2 were typed, the calculation would go quite differently: exponent 1^2 = 1, multiplication 3 × 4 = 12, addition and subtraction 2 + 12 − 1 = 13. Parentheses are the way to tell Excel “first take the difference, then square it”.
3.2.4.4Negation and exponents
In Table 3.2.3 negation is second and exponentiation fourth. That is, in Excel the minus sign is applied before the exponent. In mathematics, however, the expression −2² is read as −(2²) = −4; the exponent is taken first and the minus applied afterwards. This difference produces a surprising result in Excel.
What do the formulas =-2^2, =0-2^2, and =-(2^2) give in Excel?
=-2^2. The leading minus is negation and comes before the exponent. First −2 is formed, then (−2)^2 = 4 is calculated.=0-2^2. The minus here is not negation but subtraction; subtraction comes after the exponent. First 2^2 = 4, then 0 − 4 = −4.=-(2^2). Parentheses first: 2^2 = 4. Then negation: −4.
To get the mathematical result −2² = −4, the second or third form is used. The same applies to cell references: if A1 holds 3, the formula =-A1^2 gives 9, not −9.
Another property of the exponent operator is that it is applied from left to right. Excel calculates the formula =2^3^2 as (2^3)^2 = 8^2 = 64. In mathematics, by contrast, exponents are read from right to left: 2^(3^2) = 2^9 = 512. Writing parentheses in such expressions makes the reader and Excel understand the same thing.
Transferring an engineering formula to Excel without parentheses. For example, if the term e−x² that appears in the bell curve is written as =EXP(-A1^2), Excel calculates e(−x)² = ex². For A1 = 2 the expected value is about 0.018, but the result comes out about 54.6. The correct forms are =EXP(-(A1^2)) or =EXP(0-A1^2). In every exponent expression with a minus sign, the placement of the parentheses should be thought through, and the result compared with a hand-calculated value.
3.2.5Cell references
A formula often does not stay in a single cell. If the same calculation is to be done for all the rows of a column, the formula is written once and copied down. The addresses in the copied formula change by themselves according to the new position. Knowing the rule of this change is perhaps the most important step in using Excel correctly. This section covers the three types of reference, how they behave when copied, and the most common reference error.
3.2.5.1Types of reference
A cell reference is the address a formula writes in order to use the value of another cell. It has three types:
- A relative reference,
A1: when the formula is copied, both the column letter and the row number shift as much as the formula shifts. - An absolute reference,
$A$1: points to the same cell wherever the formula is copied. - A mixed reference,
$A1orA$1: only the column or only the row is fixed; the other part shifts.
The meaning of the dollar sign is simple: $ locks the part immediately after it. In $A$1 there are two signs; both the column and the row are locked. In $A1 there is a sign only before the letter A; the column is locked and the row is free. In A$1, the row is locked and the column is free. The dollar sign has nothing to do with currency; it is only a lock symbol.
References are not limited to a single cell on the same sheet. A range is written with two addresses (A1:A10), a cell on another sheet with the sheet name (Sales!B2), and a cell given a meaningful name with that name (VAT_Rate). These last two forms are covered in 3.2.5.8.
3.2.5.2References when filling down
The fastest way to copy a formula is the fill handle. The handle is the small square at the bottom-right corner of the selected cell. When the mouse is brought to this square, the pointer turns into a thin plus sign. When the handle is dragged down, the formula is copied to the cells below; when it is dragged right, it is copied to the cells on the right.
Let us run a small experiment to see the difference between the reference types. Let cells A1:A4 hold 5, 10, 15, and 20. In B1 type =A1, in C1 =$A$1, and in D1 =A$1. All three formulas point to A1 and all three give 5. Then B1:D1 is selected and dragged down with the fill handle to row 4. Figure 3.2.11 shows the result.
A1 shifts down one row at each row (A2, A3, A4) and gives 5, 10, 15, 20. $A$1 and A$1 keep the row locked, so they point to A1 in every row and always give 5.| Row | B (relative) | C (absolute) | D (mixed, row locked) |
|---|---|---|---|
| 1 | =A1 → 5 | =$A$1 → 5 | =A$1 → 5 |
| 2 | =A2 → 10 | =$A$1 → 5 | =A$1 → 5 |
| 3 | =A3 → 15 | =$A$1 → 5 | =A$1 → 5 |
| 4 | =A4 → 20 | =$A$1 → 5 | =A$1 → 5 |
The table shows an interesting result: when filled down, A$1 behaves the same as $A$1. The reason is that in filling down, only the row number wants to shift. If the row is locked, the address does not change. The column lock has no effect, because the column does not shift anyway. The difference between the two references appears only when the formula is filled right.
3.2.5.3References when filling right
This time let the data be in row 1: A1:D1 holds 5, 7, 9, and 11. Four reference types are typed into cells A3:A6: =A1, =$A$1, =A$1, and =$A1. All four give 5. Then A3:A6 is selected and filled right as far as column D.
A$1 shift along the columns (B1, C1, D1) and give 7, 9, 11. $A$1 and $A1 keep the column locked, so they always point to A1.In filling right, only the column letter wants to shift. In A1 and A$1 the column is free: they move to B1, C1, D1. In $A$1 and $A1 the column is locked: they always stay at A1. This time $A1 behaves like an absolute reference. The rule that comes out of the two experiments is this:
$A$1never shifts in any direction.A$1does not shift when filled down and shifts when filled right.$A1does not shift when filled right and shifts when filled down.A1shifts in both directions.
3.2.5.4The copying rule
The fill handle carries a formula to adjacent cells. A formula can also be copied to a distant cell with Ctrl+C and Ctrl+V. The rule is the same: Excel finds the column and row difference between the source cell and the target cell and adds this difference to the unlocked parts of the formula.
The copying rule. Suppose a formula is copied to a cell with column difference Δc and row difference Δr. In each reference in the formula, a column letter without $ in front of it shifts by Δc. A row number without $ in front of it shifts by Δr. Parts marked with $ do not change.
Cell C3 holds the formula =A1+$B$2+B$1+$A2. The formula is copied to E7. What is the formula in E7?
- Difference. From C to E is 2 columns right (Δc = 2), from 3 to 7 is 4 rows down (Δr = 4).
A1. Both parts are free: A + 2 = C, 1 + 4 = 5 →C5.$B$2. Both parts are locked →$B$2stays as it is.B$1. Column free, row locked: B + 2 = D, row 1 →D$1.$A2. Column locked, row free: A stays, 2 + 4 = 6 →$A6.
Result: =C5+$B$2+D$1+$A6. Each reference is treated separately; no single rule is applied to the formula as a whole.
This rule works in the opposite direction too. When a formula is copied up or left, the differences are negative, and the addresses shift backward. If the shift runs off the sheet, for example if =A1 is copied up one row, Excel cannot find a valid address and gives a #REF! error.
Cutting and pasting (Ctrl+X), by contrast, differs from copying. The references in a moved formula do not change; the formula keeps pointing to the same cells. The rule is only for copied formulas.
To try out the behavior of the reference types, you can use the Excel Cell References simulator on the course page. In the simulator, a formula is selected and dragged with the fill handle, and the formula produced in each cell and its result are seen at the same time.
3.2.5.5Mixed reference: the multiplication table
The clearest use of a mixed reference is in tables filled in two directions at once. In a multiplication table each cell is the product of the number at the head of its row and the number at the head of its column. Let A2:A4 hold 4, 5, 6 and B1:D1 hold 1, 2, 3. Can a single formula typed into B2 fill the whole table?
The formula will have two references. The first points to the number at the head of the row. This number is always in column A, but its row must change with the cell: $A2. The second points to the number at the head of the column. This number is always in row 1, but its column must change with the cell: B$1. The formula is =$A2*B$1.
=$A2*B$1 typed in B2 has been filled into B2:D4. In D4, the last cell filled, the formula is =$A4*D$1 and the result is 6 × 3 = 18. $A locks the column and $1 locks the row.| Row | B | C | D |
|---|---|---|---|
| 2 | =$A2*B$1 → 4 | =$A2*C$1 → 8 | =$A2*D$1 → 12 |
| 3 | =$A3*B$1 → 5 | =$A3*C$1 → 10 | =$A3*D$1 → 15 |
| 4 | =$A4*B$1 → 6 | =$A4*C$1 → 12 | =$A4*D$1 → 18 |
Looking at Table 3.2.6 row by row makes the rule plain. Going right, only the column letter of B$1 changes (B → C → D). Going down, only the row number of $A2 changes (2 → 3 → 4). A single formula gives the right result in all nine cells.
Using a fully absolute reference such as =$A$2*$B$1 in a multiplication table. When this formula is copied across the whole table, every cell gives 4 × 1 = 4. Conversely, a fully relative formula such as =A2*B1 is wrong too: copied to C3 it becomes =B3*C2. Because B3 and C2 hold formulas of their own, the error compounds: B3 = 5 × 4 = 20, C2 = 4 × 2 = 8, and C3 = 20 × 8 = 160. The correct value is 10. The right reference type is found with the question: “In which direction must this value stay fixed?”
3.2.5.6The F4 key
Instead of typing the dollar signs by hand, the F4 key can be used. While a formula is being edited and the cursor is on a reference, each press of F4 turns the reference type into the next one. The cycle completes in four presses and the reference returns to its first form. Table 3.2.7 shows the cycle for the reference E1 in the formula =B2*E1.
| F4 press | Formula | Column (E) | Row (1) |
|---|---|---|---|
| Not pressed | =B2*E1 | shifts | shifts |
| 1. | =B2*$E$1 | constant | constant |
| 2. | =B2*E$1 | shifts | constant |
| 3. | =B2*$E1 | constant | shifts |
| 4. | =B2*E1 | shifts | shifts |
F4 works only while a formula is being edited and the cursor is inside a reference or right next to it. On many laptops the function keys are assigned to things like volume or brightness, so Fn+F4 is needed. On a Mac the shortcut is different. The $ sign can always be typed by hand too.
3.2.5.7A relative-reference error in a copied formula
Using a relative reference in the wrong place leads to one of the sneakiest errors in Excel. It is sneaky because Excel gives no error message; since the results are numbers, they look right at first glance. Let us follow it with an example.
The prices of three items are in B2:B4: notebook 200, pen 150, eraser 80. The discount rate is kept in a single cell: E1 = 20%. The discounted-price formula will be typed into C2 and copied down. The first attempt is =B2*(1-E1). In C2 the result is 200 × (1 − 0.2) = 200 × 0.8 = 160; this is correct. What happens when the formula is copied down?
=B2*(1-E1) in C2 is copied down, it becomes =B3*(1-E2) in C3. Because E2 is empty, no discount is applied and C3 shows the price itself (150).| Cell | Relative: formula | Result | Absolute: formula | Result |
|---|---|---|---|---|
| C2 | =B2*(1-E1) | 200 × 0.8 = 160 | =B2*(1-$E$1) | 200 × 0.8 = 160 |
| C3 | =B3*(1-E2) | 150 × 1 = 150 | =B3*(1-$E$1) | 150 × 0.8 = 120 |
| C4 | =B4*(1-E3) | 80 × 1 = 80 | =B4*(1-$E$1) | 80 × 0.8 = 64 |
In the relative form both references have shifted one row. B2 becoming B3 is what we want, because each row must take its own price. E1 becoming E2, however, is the error. E2 is empty and Excel counts an empty cell as 0. The formula calculates 150 × (1 − 0) = 150; the discount is never applied. The same happens in C4.
The fix is to lock the rate cell. In the formula in C2 the cursor is placed on E1 and F4 is pressed once: =B2*(1-$E$1). The price reference stays relative and the rate reference becomes absolute. When the formula is copied down, B3 and B4 shift but $E$1 stays in place. The results are 160, 120, and 64.
=B4*(1-$E$1) → 80 × 0.8 = 64. If the rate in E1 is changed to 30%, all three results update at once.The absolute reference has one more benefit. If the rate is raised to 30%, only E1 is changed; the three results become 140, 105, and 56 at once. If the rate had been written into each formula separately, all three formulas would have had to be corrected one by one.
In a stationery order, B2:B6 hold the quantity and C2:C6 the unit price (₺): pen 12 × 8; notebook 5 × 30; eraser 20 × 4.5; ruler 6 × 12.75; folder 10 × 22. The VAT rate is 20% in F1. The amount will go in column D and the amount with VAT in column E, and the formulas will be copied down to row 6.
- Amount.
=B2*C2in D2. Both references must shift to their own row on every row; both stay relative. Results: 12 × 8 = 96; 5 × 30 = 150; 20 × 4.5 = 90; 6 × 12.75 = 76.5; 10 × 22 = 220. - Amount with VAT.
=D2*(1+$F$1)in E2. The amount shifts with the row; the rate is fixed. Results: 96 × 1.2 = 115.2; 150 × 1.2 = 180; 90 × 1.2 = 108; 76.5 × 1.2 = 91.8; 220 × 1.2 = 264. - Check. The formula in E6 should be
=D6*(1+$F$1). If this is what the formula bar shows, the copying is correct. - Totals.
=SUM(D2:D6)= 96 + 150 + 90 + 76.5 + 220 = 632.5 ₺.=SUM(E2:E6)= 759 ₺. The difference 759 − 632.5 = 126.5 ₺ is the VAT, which equals 632.5 × 0.2.
An easy way to catch errors of this kind is to make the formulas visible instead of the results. The Formulas → Formula Auditing → Show Formulas command, or the Ctrl+` shortcut, shows the formula itself in every cell in place of the result. If all the formulas in a column should point to a single rate cell, check whether that reference stays the same on every row. When the same command is given once more, the view returns to normal.
Checking only the first row of a copied formula. A relative-reference error does not show at all in the first row; the result in C2 is 160 in both forms. The error appears only in the second and later rows. After a formula is copied, the formula of at least one middle row and of the last row should be opened and looked at too.
3.2.5.8References to another sheet and named ranges
In large workbooks the data, calculation, and report are often on separate sheets. If a formula is to use a cell on another sheet, the sheet name is written in front of the address with an exclamation mark between them: Sales!B2 is cell B2 of the Sales sheet. If the sheet name contains a space, the name is put in single quotes: 'Sales 2024'!B2. While writing a formula, clicking the other sheet's tab and selecting the cell makes Excel itself write this address.
A named range is a meaningful name given to a cell or a range. The name is used in a formula in place of the address and always points to the same cell; that is, it behaves like an absolute reference.
The shortest way to name a cell is to select the cell, type the name in the Name Box, and press Enter. The Formulas → Defined Names → Define Name command does the same job; the Name Manager lists all the names in the workbook. Spaces cannot be used in names, so words are joined with an underscore: VAT_Rate. A name must start with a letter or an underscore and must not look like a cell address; for example VAT1 is not accepted because it looks like a column name and a row number.
The formula in Figure 3.2.16 is =Sales!B2*VAT_Rate. Because B2 on the Sales sheet holds 1000 and the cell named VAT_Rate holds 0.2, the result is 1000 × 0.2 = 200. =Sales!B2*Settings!$B$1 gives the same result, but the reader sees at once what is multiplied by what. Because a name behaves like an absolute reference, VAT_Rate stays in place when the formula is copied.
3.2.6Basic and logical functions
Typing =B2+B3+…+B101 to add up a hundred numbers in a column is both tiring and error-prone. Excel has ready-made functions for frequent calculations like this. This section covers the structure of a function, the five most-used functions, and the logical functions used for making decisions.
3.2.6.1The structure of a function and basic functions
A function is a ready-made formula that does a particular calculation and is called by its name. After the function name a parenthesis is opened, and the values that go into the calculation, the arguments, are written inside the parentheses. In English-language Excel the arguments are separated by commas: =IF(B2>=60,"Pass","Fail").
On a computer set to Turkish (and in several other regional settings), Excel uses localized function names and separates arguments with semicolons, because the comma is the decimal separator there: the same formula is written =EĞER(B2>=60;"Pass";"Fail"), and =TOPLA(1,5;2) adds 1,5 and 2 to give 3,5. When a file is opened in another language of Excel, function names and separators are translated automatically; inside the file the formula is stored independently of the language. A formula example found on the internet, however, must be adapted by hand for an Excel of a different language.
| Function | Example | What it does |
|---|---|---|
| SUM | =SUM(B2:B10) | Adds the numbers in the range. |
| AVERAGE | =AVERAGE(B2:B10) | Gives the arithmetic mean of the numbers. |
| MAX | =MAX(B2:B10) | Gives the largest number. |
| MIN | =MIN(B2:B10) | Gives the smallest number. |
| COUNT | =COUNT(B2:B10) | Counts the cells that contain numbers. |
| COUNTA | =COUNTA(B2:B10) | Counts all cells that are not empty. |
| COUNTIF / SUMIF | =COUNTIF(B2:B10,">=50") | Counts or adds the cells that meet a condition. |
| TODAY | =TODAY() | Gives today's date. |
A function can be written in three ways. The first is to type its name directly: when =SU is typed, Excel lists the functions that start with SU, and the Tab key completes the selected one. The second is to choose the function from a list with Formulas → Insert Function; the box that opens explains what each argument is. The third is the Home → AutoSum button. This button finds the numbers above the selected cell and writes the =SUM(…) formula itself. Its shortcut is Alt+=.
3.2.6.2Functions on the same data
How the basic functions behave toward text and empty cells matters for interpreting the results correctly. Let the range B2:B7 hold 12, 7, the text “absent”, 20, an empty cell, and 5. When the five functions are applied to the same range, Figure 3.2.17 results.
With B2:B7 = 12, 7, “absent”, 20, empty, 5, let us find the results of the five functions step by step.
- Which cells are numbers? 12, 7, 20, and 5. “absent” is text and B6 is empty; neither enters the calculation.
- SUM. 12 + 7 + 20 + 5 = 44.
- AVERAGE. The total is divided by the count of numbers: 44 / 4 = 11. The divisor is 4, not 6; if the empty cell were counted as 0, the divisor would be 5 and the result would be 8.8.
- MAX and MIN. The largest number is 20 and the smallest is 5.
- COUNT. The number of cells containing numbers: 4. COUNTA, which counts all cells that are not empty, also counts the text and gives 5.
The difference between an empty cell and a cell containing 0 is decisive in an average. If a student did not take the exam, the cell is left empty and does not enter the average. If the student took the exam and got 0, 0 is typed into the cell and pulls the average down. In the two cases the table may look the same, but the class average comes out different.
Mistaking COUNT for “number of filled cells”. COUNT counts only numbers; if COUNT is used to find the number of students in a list of names, the result is 0. For the number of records in a column with text, COUNTA is used.
3.2.6.3The IF function
In some calculations the result depends on a condition: if the grade is 60 or above, “Pass” is written, otherwise “Fail”. Decisions like this are made with the IF function.
The IF function takes three arguments: =IF(logical_test, value_if_true, value_if_false). A logical test is an expression whose result is TRUE or FALSE. If the test is TRUE, the second argument is returned; if FALSE, the third.
=IF(B2>=60, "Pass", "Fail")In this formula the test is B2>=60. If it is true, the text “Pass” is returned; if false, the text “Fail”. Text is written inside double quotes in formulas. If the quotes are forgotten, Excel takes the word Pass for a name and gives a #NAME? error. Figure 3.2.18 shows the decision structure of the function as a flowchart.
B2>=60 is tested; if the test is true, “Pass” is returned, otherwise “Fail”.When the formula is typed into C2 and copied down, each row tests its own score. Let A2:B4 hold Ali 75, Can 45, and Ece 60. Table 3.2.10 shows the evaluation of each row.
| Cell | Score read | Test | Result |
|---|---|---|---|
| C2 | B2 = 75 | 75 >= 60 → TRUE | Pass |
| C3 | B3 = 45 | 45 >= 60 → FALSE | Fail |
| C4 | B4 = 60 | 60 >= 60 → TRUE | Pass |
The third row shows how much the choice of comparison operator matters. >= includes equality; Ece, who scored 60, passes. Had > been typed in the formula, the test would be 60 > 60 → FALSE and Ece would show “Fail”. Scores at the pass boundary are the best test values for checking whether a formula is written correctly.
The values IF returns need not be text. A number or another formula can be returned as well. For example, the formula =IF(B2>=1000,B2*0.1,0) gives the 10% discount amount on purchases of 1000 ₺ and above, and 0 below that. If B2 = 1250 the result is 125; if B2 = 800 it is 0.
3.2.6.4AND, OR, NOT, and nested IF
Some decisions depend on several conditions. A rule such as “a student passes if the grade is at least 60 and attendance is at least 70%” cannot be written with a single comparison. Excel has three logical functions for combining conditions:
- AND: gives TRUE if all the conditions are TRUE, and FALSE if at least one is FALSE.
- OR: gives TRUE if at least one condition is TRUE, and FALSE if all are FALSE.
- NOT: reverses a single condition; it turns TRUE into FALSE and FALSE into TRUE.
Let a student's grade be B2 = 72, attendance C2 = 65 (as a percentage), and D2 hold 0. Table 3.2.11 shows the results of various formulas.
| Formula | Result | Description |
|---|---|---|
=AND(B2>=60,C2>=70) | FALSE | 72 >= 60 true, 65 >= 70 false; the two are not both true. |
=OR(B2>=60,C2>=70) | TRUE | At least one is true. |
=NOT(B2>=60) | FALSE | TRUE is reversed. |
=IFERROR(B2/D2,"Cannot calculate") | Cannot calculate | 72 / 0 gives an error; text is shown instead. |
=IF(B2>=85,"AA",IF(B2>=70,"BB","CC")) | BB | Nested IF: the value of the first true condition is returned. |
=IF(AND(B2>=60,C2>=70),"Pass","Fail") | Fail | AND is used as the test of IF. |
The last row is the most frequently used pattern: AND or OR is used not to give a result on its own but as the test of IF. The student's grade is sufficient but attendance is insufficient; because AND gives FALSE, IF returns the third argument.
When more than two outcomes are needed, IFs are nested. A second IF is placed in the value_if_false part of an IF. Excel tests the conditions from left to right and returns the value of the first true condition; it never looks at the later conditions.
What does the formula =IF(B2>=85,"AA",IF(B2>=70,"BB","CC")) return for B2 = 72, 90, and 69?
- B2 = 72. Outer IF: 72 >= 85 → FALSE; move to the third argument, that is, the inner IF. Inner IF: 72 >= 70 → TRUE → BB.
- B2 = 90. Outer IF: 90 >= 85 → TRUE → AA. The inner IF is never evaluated.
- B2 = 69. 69 >= 85 → FALSE; 69 >= 70 → FALSE → CC.
Parentheses are checked by counting: each IF opens a parenthesis and closes its own. Since the formula has two IFs, there are two closing parentheses at the end.
Starting the conditions from the low threshold in a nested IF. In the formula =IF(B2>=70,"BB",IF(B2>=85,"AA","CC")) a student with 90 also passes the first test and gets “BB”; the “AA” condition is never reached. Conditions must be written starting from the highest threshold and going down.
With many tiers a nested IF grows long and becomes hard to read. In Microsoft 365 there is also the IFS function for this job: =IFS(B2>=85,"AA",B2>=70,"BB",TRUE,"CC"). This function tries test–value pairs in order. The TRUE test in the last pair gives the value used if none of the earlier conditions holds. Another way to handle tiered thresholds is the approximate-match lookup described in 3.2.7.4.
3.2.6.5IFERROR
Some formulas give an error with certain inputs. In a division the denominator may be 0, or a lookup may be searching for a value that is not in the list. The IFERROR function is used to show a meaningful result instead of the error value in such cases.
The IFERROR function takes two arguments: =IFERROR(value, value_if_error). If the first argument does not produce an error, its result is returned; if it does, the second argument is returned.
In the example in Table 3.2.11, B2/D2 = 72 / 0 cannot be calculated and gives #DIV/0!. IFERROR catches this error and shows the text “Cannot calculate”. If D2 held 4, 72 / 4 = 18 would not give an error; in that case IFERROR would return 18 as it is.
IFERROR hides the error but does not remove its cause. Why the denominator is 0 must still be investigated. Besides, this function catches all kinds of errors. A #NAME? error caused by a typo is also shown as “Cannot calculate”, and the real problem is overlooked. That is why IFERROR is used where an error is expected and its meaning is known.
3.2.7Conditional counting, summing, and lookup
In real tables most questions contain a condition. “How many students are there in the Electrical department?”, “What is the total of these students' scores?”, “What is Ece's score?” This section covers the conditional counting and summing functions that answer such questions, and the lookup functions that fetch a value from a table. The same example list is used throughout the section: six students with Name, Dept, and Score columns. Ali (Electrical, 72), Ece (Computer, 91), Can (Electrical, 85), Deniz (Computer, 64), Burak (Mechanical, 78), and Selin (Electrical, 58). The list is in A1:C7; row 1 is the header.
3.2.7.1COUNTIF and SUMIF
COUNTIF counts the cells in a range that meet a particular criterion: =COUNTIF(range, criteria). SUMIF adds up the values in the rows that meet the criterion: =SUMIF(criteria_range, criteria, sum_range). In SUMIF the criterion is tested in one column and the values to be summed are taken from another column in the same rows.
How does the formula =SUMIF(B2:B7,"Electrical",C2:C7) move through the rows?
- Row 2. B2 = Electrical → meets the criterion; C2 = 72 is added to the total. Running total 72.
- Row 3. B3 = Computer → does not match; C3 is skipped.
- Row 4. B4 = Electrical → matches; 72 + 85 = 157.
- Rows 5 and 6. Computer and Mechanical → both skipped.
- Row 7. B7 = Electrical → matches; 157 + 58 = 215.
With the same criterion, =COUNTIF(B2:B7,"Electrical") gives 3. The ratio of the two is the average of the Electrical students: 215 / 3 ≈ 71.7. This average can also be found directly with =AVERAGEIF(B2:B7,"Electrical",C2:C7).
In SUMIF, the two ranges must be the same size and in the same rows. If the criterion is tested in B2:B7, the sum range must also be C2:C7; if C3:C8 is typed, each criterion is matched with the score one row below, and the result is silently wrong. If the sum range is omitted, the criterion range itself is summed. =SUMIF(C2:C7,">=70") adds up the scores of 70 and above: 72 + 91 + 85 + 78 = 326.
3.2.7.2Writing criteria and multi-condition functions
A criterion can be text, a number, or a comparison. Comparison criteria are written inside double quotes. Table 3.2.12 shows the commonly used forms together with the results on the example list.
| Formula | Meaning | Result |
|---|---|---|
=COUNTIF(B2:B7,"Electrical") | Equal to Electrical | 3 |
=COUNTIF(B2:B7,"<>Electrical") | Anything other than Electrical | 3 |
=COUNTIF(C2:C7,">=80") | Scores of 80 and above | 2 |
=COUNTIF(C2:C7,"<60") | Scores below 60 | 1 |
=COUNTIF(B2:B7,"E*") | Departments that start with E (asterisk: any string) | 3 |
=COUNTIF(C2:C7,">="&F1) | The threshold is taken from cell F1 (if F1 = 80) | 2 |
The syntax in the last row matters. If the threshold is in a cell, the comparison sign is written inside quotes and joined to the cell address with the & operator. If ">=F1" is typed, Excel looks for the word “F1” and matches no number. Criteria are not case-sensitive: “electrical” and “Electrical” count as the same.
When several conditions are searched at once, multi-condition functions are used. COUNTIFS takes range–criterion pairs and counts the rows that meet all of them at once. In SUMIFS the sum range is written first, followed by the range–criterion pairs.
How many students in the Electrical department have a score of 70 or above? What is the total of these students' scores?
- Formulas.
=COUNTIFS(B2:B7,"Electrical",C2:C7,">=70")and=SUMIFS(C2:C7,B2:B7,"Electrical",C2:C7,">=70"). - First condition. Electrical rows: Ali 72, Can 85, Selin 58.
- Second condition. Of these, 70 and above: Ali 72 and Can 85. Selin is eliminated.
- Results. Count 2, total 72 + 85 = 157.
In multi-condition functions the conditions are joined by AND: a row must meet all the conditions to be counted.
3.2.7.3Exact match with VLOOKUP
Fetching the information of a particular record from a table is a common job: finding a name from a student number, a price from a product code, or a score from a student's name. VLOOKUP solves this by searching in the first column of the table.
VLOOKUP takes four arguments: =VLOOKUP(lookup_value, table_array, col_index_num, range_lookup). It searches for the lookup value from top to bottom in the first column of the table; in the row where it finds it, it returns the value in the table's col_index_num-th column. If the last argument is 0 (FALSE), an exact match is made; if it is 1 (TRUE), an approximate match.
=VLOOKUP("Ece",A2:B5,2,0): the lookup value “Ece”, the table A2:B5 (the search is made in the first column), column number 2 (Score), and 0 for an exact match.A2:B5 hold Ali 72, Ece 91, Can 85, Deniz 64. What do =VLOOKUP("Ece",A2:B5,2,0) and =VLOOKUP("Mert",A2:B5,2,0) return?
- A2. “Ali” ≠ “Ece” → move to the next row.
- A3. “Ece” = “Ece” → found; the search stops.
- Result. The row found is the 2nd row of the table. Because the 2nd column of the table is B, B3 is returned: 91.
- “Mert”. None of A2, A3, A4, and A5 is “Mert”. After all the rows have been tried, the result is #N/A (value not found).
The column number is counted not by the sheet's column letter but by the table's own columns. If the table is C5:F20, C is the 1st, D the 2nd, and E the 3rd column. Because this number is typed into the formula as a constant, when a new column is inserted in the middle of the table the number points to the wrong column. Another limit of VLOOKUP is that it can look only to the right. The searched column is always the first column of the table; a value to the left of the first column cannot be fetched.
Leaving out the fourth argument. If this argument is omitted, Excel does an approximate match. In an unsorted list of names, an approximate match can return a wrong person's score without any error. In searches for names, codes, or numbers, the last argument should always be 0.
In an exact match too, the lookup value must be typed exactly. A trailing invisible space (“Ece ”) breaks the match and the result is #N/A. Capitalization makes no difference: a search for “ece” also returns 91. If you want to show a message instead of an error for values that are not in the list, IFNA is used: =IFNA(VLOOKUP(D2,A2:B5,2,0),"No record"). IFNA catches only the #N/A error; because it does not hide other errors, it is safer than IFERROR.
3.2.7.4Approximate match with VLOOKUP
The right use for approximate match is where a value falls into a range: a grading scale, a tax bracket, a shipping-rate table. In these tables the lookup value is often not found exactly in the table; what is found is which bracket it falls into.
Let D2:E6 hold a grading scale. In the first column the lower thresholds are sorted from smallest to largest: 0 → F, 50 → D, 60 → C, 70 → B, 85 → A. The letter for a score is found with this formula:
=VLOOKUP(B2, $D$2:$E$6, 2, TRUE)The scale is locked with $, because when the formula is copied down every row must look at the same scale. The rule of approximate match is this: in the first column, the largest threshold that is less than or equal to the lookup value is found, and that row's value is returned.
What are the letter grades for scores 72, 85, 49, and −5?
- 72. The thresholds 0, 50, 60, and 70 are less than or equal to 72; 85 is not. The largest suitable threshold is 70 → B.
- 85. Equality counts too: 85 ≤ 85. The largest suitable threshold is 85 → A.
- 49. Only 0 qualifies, because 50 > 49 → F.
- −5. No threshold is less than or equal to −5 → #N/A.
Had an exact match been used, all scores not in the table, such as 72 and 49, would give #N/A. What the −5 result teaches is this: the smallest threshold in the scale must be the smallest possible value (here 0). Invalid scores can be prevented from the start with data validation, described in 3.2.11.4.
In an approximate match Excel does not scan the table row by row; it does a binary search. It looks at the value in the middle of the table and, if the lookup value is smaller, continues in the upper half, otherwise in the lower half. This method is very fast on large tables, but it depends on the first column being sorted from smallest to largest. On an unsorted scale Excel gives no error; it may return a wrong letter. That is why the scale is sorted before an approximate match is used.
3.2.7.5XLOOKUP and FILTER
Microsoft 365 and Excel 2021 have new functions that remove the limits of VLOOKUP. These functions do not work in Excel 2019 and earlier versions, so the version used by the people who will open the file matters.
XLOOKUP takes the array to search and the array to return separately: =XLOOKUP(lookup_value, lookup_array, return_array). By default it does an exact match. FILTER returns all the rows of a range that meet a condition: =FILTER(array, include).
=XLOOKUP("Ece",A2:A5,B2:B5) → 91
=FILTER(A2:B5,B2:B5>=80) → Ece 91 / Can 85XLOOKUP has no column number; the column to be returned is indicated directly. The formula does not break when a column is added to the table. The lookup array may also be to the right of the return array: if the names are in column B and the scores in column A, =XLOOKUP("Ece",B2:B5,A2:A5) still gives 91. VLOOKUP cannot make this lookup. If the lookup value is not found, XLOOKUP also gives #N/A; but a message can be written as the fourth argument: =XLOOKUP("Mert",A2:A5,B2:B5,"No record").
FILTER, on the other hand, returns not a single value but a table of results. The result spreads over as many rows and columns as needed, starting from the cell where the formula is typed. This behavior is called spilling.
=FILTER(A2:B5,B2:B5>=80) typed in D2 spills its two-row, two-column result into D2:E3: Ece 91 and Can 85.If there is a filled cell in the way of a spilled result, Excel cannot place the result and gives a #SPILL! error. When the cell in the way is emptied, the result settles into place by itself. Only the first cell of the spilled range holds the formula; the other cells show the same formula in faded color in the formula bar and cannot be edited individually. When the source data changes, the spilled result updates too: if Deniz's score rises from 64 to 82, the FILTER result grows to three rows.
Typing other data below a spilled result. FILTER may be returning two rows today, but when the data changes it can grow to five. A total row typed right below it then blocks the result's path, and the whole result becomes #SPILL!. Enough empty space must be left below and to the right of spilling formulas.
3.2.8Dates, times, and formula errors
Date and time calculations look confusing at first glance, but once you know how Excel stores them they turn into simple arithmetic. Formula errors are not random either; each error value reports a particular cause. This section first covers how dates and times are stored as numbers, then the error values and ways to fix them.
3.2.8.1Date and time
Excel stores every date as a date serial number: the date 1/1/1900 is 1 and each following day is one more. A time is stored as a fraction of a day: 0.5 is half a day, that is, 12:00.
=B2-A2 as 14 days. A time is a fraction of a day: 0.5 → 12:00.The benefit of this representation is clear: because dates are numbers, they can be calculated with arithmetic. The difference of two dates gives the number of days between them. Adding a number to a date gives a later date: 3/15/2024 + 30 = 4/14/2024. When a date cell is changed to General format, the stored serial number appears; this is an easy way to tell whether a cell really holds a date or text.
A2 holds 2/1/2024 and B2 holds 3/1/2024. What does =B2-A2 give? What would the result have been if the same month range were in 2023?
- Serial numbers. 2/1/2024 = 45323, 3/1/2024 = 45352.
- Difference. 45352 − 45323 = 29 days. 2024 is a leap year; February has 29 days.
- 2023. 2023 is not a leap year; the same difference is 28 days.
The result cell sometimes takes on a date format by itself, and instead of 29 a meaningless date such as 1/29/1900 appears. In that case the cell's number format is simply set to General or Number; the calculation is correct.
The main date and time functions and rules are these:
=TODAY()gives today's date and=NOW()gives the date and time. Both update at every recalculation. In tracking delays, the formula=TODAY()-C2finds the days elapsed since the due date anew every day.=DATE(2024,3,15)builds a date from a year, a month, and a day. It is used to combine year, month, and day information that sits in separate columns.- A date stored as text (if “3/15/2024” sits left-aligned) is not counted in calculations; subtraction may give a
#VALUE!error. Such data usually arises when it is imported from another system. - Times, being fractions of a day, can be added too. The duration between 09:00 and 11:45 is found with
=B2-A2and shows as 02:45; this is 2.75 hours or 165 minutes.
A lab assistant worked 9 hours a day for five days. The daily durations are typed as 09:00 in B2:B6. What does =SUM(B2:B6) show? If the hourly pay is 150 ₺, how is the weekly pay calculated?
- Total. 5 × 9 = 45 hours. The stored value is 45 / 24 = 1.875 days.
- The standard time format. The
h:mmformat drops whole days and shows only the remaining hours: 45 hours = 1 day + 21 hours → 21:00 appears in the cell. - The right format. The Custom format code is set to
[h]:mm. The square brackets stop the hours from resetting at 24: 45:00. - Pay. The stored value is in days. To convert it to hours, multiply by 24:
=B7*24*150= 1.875 × 24 × 150 = 6750 ₺.
Multiplying the time total directly by 150 (1.875 × 150 = 281.25) gives a wrong result. A duration stored in days must first be converted to hours.
3.2.8.2Error values
An error value is a special result beginning with # that appears in a cell when a formula cannot be calculated. Each error value points to a different kind of problem.
| Error | Example | Cause | Fix |
|---|---|---|---|
#DIV/0! | =B2/C2, C2 = 0 | Division by zero; an empty cell also counts as 0. | Check the denominator, or =IF(C2=0,"",B2/C2). |
#NAME? | =SUMM(B2:B4) | Excel does not recognize the name: a typo or text without quotes. | =SUM(B2:B4); text goes inside quotes. |
#VALUE! | =B2*2, B2 = “12 TL” | Arithmetic on text. | Only 12 in the cell; the unit is shown with a number format. |
#REF! | =B2+#REF! | The cell or column the formula used has been deleted. | Undo with Ctrl+Z, or retype the reference. |
#N/A | =VLOOKUP("Selin",A2:B4,2,0) | The lookup value is not in the list. | Check the spelling, add the record, or use IFNA. |
##### | 1250000 in a narrow column | The value does not fit in the column; not a real error. | The column is widened. |
#SPILL! | =FILTER(…) | There is a filled cell in the way of the spilled result. | The cell in the way is emptied. |
Two more errors can be added to this list. #NUM! appears in a numerically invalid operation; for example =SQRT(-4) cannot take the square root of a negative number. #NULL! appears where the intersection of two ranges is expected but there is none, and it usually comes from typing a space instead of a colon.
An important property of error values is that they propagate. Every formula that uses a cell with an error gives an error too. A #VALUE! in B2 makes the column total that adds B2, and the report cell that uses that total, erroneous as well. That is why in a chain of errors the fix starts at the cell at the head of the chain.
3.2.8.3Finding and fixing errors
When a cell with an error is selected, a small warning icon appears next to it. The icon's menu explains the type of error and offers an option for following the calculation step by step. The Formula Auditing group on the Formulas tab also helps find the source of the error: the Trace Precedents command shows with arrows which cells the selected formula uses. By following these arrows you reach the head of the chain.
=B2/C2 in D2, C2 = 0, so #DIV/0! appears. The other rows are 300 / 5 = 60 and 90 / 3 = 30. Fix: =IF(C2=0,"",B2/C2).Below the table in Figure 3.2.27, =AVERAGE(D2:D4) is typed into D5. What appears? How is the error removed?
- Propagation. D2 holds #DIV/0!. AVERAGE cannot skip an error value in the range; #DIV/0! appears in D5 as well.
- Source. When D5 is selected and Trace Precedents is used, the arrows point to D2:D4; used once more from D2, they point to B2 and C2. The problem is the 0 in C2.
- Fix. D2 is changed to
=IF(C2=0,"",B2/C2)and copied down. D2 now returns an empty text. - New result. AVERAGE ignores the text and averages only 60 and 30: (60 + 30) / 2 = 45.
IF returning an empty text is a deliberate choice. Had it returned 0, AVERAGE would count that 0 as well and give a misleading result such as (0 + 60 + 30) / 3 = 30.
The most common cause of the #REF! error is deleting a column used by formulas. Excel cannot put another cell in place of the deleted cell and marks the reference inside the formula as #REF!. This error is fixed by undoing the deletion immediately with Ctrl+Z. If the values in a column are no longer needed, clearing its content instead of deleting the column preserves the references.
Mistaking a cell that shows ##### for an error. It is not an error value; because a number or date does not fit in the column, Excel fills it with marks instead of cutting it off. The value is stored correctly and formulas keep using it. When the column is widened, the value appears. The only exception is a negative date or time result; in that case ##### remains however wide the column is made.
3.2.9Data-entry tools
Tools that speed up data entry and cut down repetitive work are the second leg of using Excel efficiently. This section covers AutoFill, commonly used shortcuts, Flash Fill, and the Excel table.
3.2.9.1AutoFill
AutoFill is the extension of the value, formula, or pattern in the selected cells to adjacent cells when the fill handle is dragged. If Excel recognizes the pattern in the selection, it produces a data series; if it does not, it copies the value.
Excel works out the series from the first two values of the selection. If 2 and 5 are selected and dragged, the step is calculated as 5 − 2 = 3 and 8, 11, 14 follow. If 10 and 20 are selected, 30, 40, 50 follow. With dates each drag advances one day; day names such as Monday and month names such as January are also recognized. If a single number is selected and dragged, it is copied; if Ctrl is held while dragging, a series increasing by 1 is created.
When the drag ends, the AutoFill Options button appears at the bottom right. This button can be used to change the result: Copy Cells, Fill Series, Fill Formatting Only, or Fill Without Formatting. When a formula is dragged, relative references change according to the rule described in 3.2.5.2. In a long column, double-clicking the fill handle instead of dragging is also enough: the formula is copied automatically down to the last row where the column to its left is filled.
Not checking the first and last values of a filled series. For example, when a course code such as “CS-101” is dragged, Excel takes the trailing number for a pattern and produces “CS-102”, “CS-103”; yet the aim was to copy the code. Looking at the last cell after filling shows at once whether the pattern was understood correctly.
3.2.9.2Shortcuts and Flash Fill
| Action | Shortcut |
|---|---|
| Undo | Ctrl+Z |
| Format Cells | Ctrl+1 |
| Create a table | Ctrl+T |
| Turn the filter on / off | Ctrl+Shift+L |
| Flash Fill | Ctrl+E |
| Find and Replace | Ctrl+H |
| Go to the end of the data block | Ctrl+arrow key |
The shortcut in the last row saves a lot of time in long lists. Ctrl+↓ jumps from the active cell to the last filled cell where the data ends. Ctrl+Shift+↓ goes the same way while selecting; a column of thousands of rows is thus selected with a single keystroke.
Flash Fill learns the pattern in a column from an example. Let column A hold full names such as “Ayşe Yılmaz”, “Mehmet Demir”, and “Zeynep Kaya”. “Ayşe” is typed by hand in B2, then Ctrl+E is pressed in B3. Excel guesses the pattern as “the part up to the first space” and fills column B with Mehmet and Zeynep. The command can also be given from Data → Data Tools → Flash Fill.
Flash Fill has two limits. First, the results are fixed values, not formulas; when a name in column A changes, column B is not updated. Second, Excel guesses the pattern, and the guess may not be right on every row. For a person with two given names such as “Ali Rıza Can”, only “Ali” may come. The filled rows should therefore be reviewed one by one.
Find and Replace (Ctrl+H) replaces a text with another throughout the sheet. Before a bulk replacement, the scope of the search should be checked with the Options button: only the selected area, the whole sheet, or the whole workbook? If “Match entire cell contents” is not checked, a search for “Ali” also finds and replaces “Alican”.
3.2.9.3The Excel table
A data range with headers can be turned into a smart structure with Excel's table feature. A cell inside the range is selected and the Insert → Table command is given, or Ctrl+T is pressed. In the box that opens, the option stating that the first row is the header is checked and OK is clicked.
An Excel table is a range made of columns with headers that has been turned into a named, automatically expanding data structure. The columns of the table can be referred to in formulas by name instead of by address; this is called a structured reference.
The benefits of converting to a table are these:
- Automatic expansion. A new row or column typed right below or to the right of the table joins the table. Formulas, charts, and PivotTables that refer to the table cover the new data too.
- Filter and sort. A drop-down button is added to every header cell.
- Structured reference. If the table's name is Table1 and one of its columns is Sales,
=SUM(Table1[Sales])adds the whole Sales column. Within a row, the value in the same row is referred to as=[@Qty]*[@Price]. When the formula is typed into one cell, it is copied automatically to the whole column. - Total row. When the Total Row box on the Table Design tab is checked, a summary row is added below the table. For each column one of the functions such as sum, average, or count is chosen.
- Style. Banded rows and consistent colors make reading easier.
The sales values in Figure 3.2.30 are 120, 85, 40, and 30; the total row shows 120 + 85 + 40 + 30 = 275. As soon as a sales value is typed in the Compass row, the total row updates too. Had the same table been a plain range, the range of the total formula would have had to be extended by hand.
3.2.10Sorting and filtering
The first step in drawing information out of a list is to arrange it according to the question at hand. Sorting changes the order of the records; filtering shows only certain records. Neither changes the data itself; but if sorting is done wrongly, it can corrupt the data permanently.
3.2.10.1Sorting
Sorting is the rearrangement of the records in a list according to the values of one or several columns, keeping each row intact. Sorting by several columns is called a multi-level sort.
Sort direction is named according to the data type. Text is sorted from A to Z or Z to A, numbers from smallest to largest or largest to smallest, and dates from oldest to newest or newest to oldest. To sort by a single column, a cell in that column is selected and the A→Z or Z→A button on the Data tab is pressed. For a multi-level sort the Data → Sort dialog is opened.
In the Sort box the My data has headers option must be checked. This option keeps the header row out of the sort. If the check mark is removed, the headers “Name, Dept, Score” are sorted like data and may end up mixed into the middle of the list. Excel also sorts numbers and numbers stored as text in the same column as separate groups; inconsistent data types spoil a sort.
With Turkish language settings, text is sorted according to the Turkish alphabet: Ç comes after C, Ğ after G, I after H, İ after I, Ö after O, Ş after S, and Ü after U. When the names Selin, Can, Çağla, Ali, İrem, and Burak are sorted A to Z, the result is Ali, Burak, Can, Çağla, İrem, Selin. A program that sorts letters by their code order on the computer throws Ç and İ to the end of the alphabet and gives the order Ali, Burak, Can, Selin, Çağla, İrem.
3.2.10.2Keeping rows intact when sorting
In a list each row carries the whole information of one record. In sorting, these rows must move as a whole. Ali's department and score must stay on Ali's row after sorting too. Figure 3.2.32 shows the correct sorting of a five-student list by score.
Ali (Electrical, 72), Ece (Computer, 91), Can (Electrical, 85), Deniz (Computer, 64), and Burak (Mechanical, 78) are sorted first by Dept from A to Z, and within the same dept by Score from largest to smallest. What is the result?
- First level. The depts are in alphabetical order Computer < Electrical < Mechanical. The Computer students come first, then Electrical, and Mechanical comes last.
- Second level, only within the same dept. Computer: Ece 91 > Deniz 64. Electrical: Can 85 > Ali 72. Mechanical has only one person: Burak 78.
- Result. Ece, Deniz, Can, Ali, Burak.
The second level decides the order only among rows that are equal at the first level. Burak's score is higher than Deniz's and Ali's, but because Mechanical comes later in the alphabet, he stays at the end of the list.
The most dangerous error in sorting is selecting only one column and sorting. In this case Excel shows a Sort Warning and offers two options: Expand the selection and Continue with the current selection. If the second option is chosen, only that column is sorted; the other columns stay in place.
Choosing “Continue with the current selection” in the sort warning. The resulting table looks tidy and there is no error message; but the records have been mixed up. If the file is saved and closed, the correct pairing can never be found again. In the warning, Expand the selection must always be chosen, and if the error is noticed it must be undone at once with Ctrl+Z.
3.2.10.3Filtering
Filtering is showing only the rows in a list that meet certain criteria and temporarily hiding the others. A filter does not delete or change the data; it only narrows the view.
The filter is turned on by selecting a cell inside the list and using the Data → Filter command or Ctrl+Shift+L. A drop-down button appears on the right of every header cell. Clicking the button opens the list of values in that column. The rows of values whose check mark is removed are hidden.
Besides the list of values, the filter menu also has condition filters. Depending on the column's data type, the menu shows Text Filters (Contains, Begins With, Equals), Number Filters (Greater Than, Less Than, Between, Top 10), or Date Filters (This Month, Last Year, Between). If filters are applied to several columns, the conditions narrow the list together: for a row to be visible it must meet the conditions in all the columns.
In the six-student list (Ali Electrical 72, Ece Computer 91, Can Electrical 85, Deniz Computer 64, Burak Mechanical 78, Selin Electrical 58), first a Dept = Electrical filter and then a Score > 80 filter is applied. What is seen at each step?
- Start. The filter has been turned on, but there is no condition: all 6 records are visible.
- Dept = Electrical. Ali 72, Can 85, and Selin 58 are visible; 3 of 6 records. The row numbers become 1, 2, 4, 7 and proceed with gaps.
- Score > 80. Number Filters → Greater Than → 80. Of the remaining three records only Can (85) meets the condition: 1 of 6 records.
- Clear. Data → Clear removes all filters; all 6 records come back.
In a filtered list, copying, deleting, and formatting affect only the visible rows. If the visible rows are selected and copied, the rows hidden by the filter are not copied; rows deleted while a filter is on are likewise only the visible ones. With manually hidden rows the situation is different: when such a range is copied, the hidden rows are copied too.
3.2.10.4Filters and SUBTOTAL
What does a SUM formula below a filtered list give? The expected answer is the total of the visible rows. Yet SUM also adds the hidden rows. For a summary that respects the filter, the SUBTOTAL function is used.
SUBTOTAL is a function that calculates a summary value without counting the rows hidden by a filter: =SUBTOTAL(function_num, range). The function number selects which calculation is done: 1 average, 2 count, 4 maximum, 5 minimum, 9 sum.
Let us take a new list of six records: Selin (Computer, 78), Can (Electrical, 85), Çağla (Computer, 91), Ali (Electrical, 64), İrem (Mechanical, 70), Burak (Computer, 55). The scores are in C2:C7. Three formulas are typed below the list:
C9: =SUM(C2:C7)
C10: =SUBTOTAL(9,C2:C7)
C11: =SUBTOTAL(1,C2:C7)| Step | Visible records | SUM | SUBTOTAL(9) | SUBTOTAL(1) |
|---|---|---|---|---|
| Start | all 6 records | 443 | 443 | 443 / 6 ≈ 73.8 |
| Sort: Dept A→Z, Score largest to smallest | Çağla 91, Selin 78, Burak 55, Can 85, Ali 64, İrem 70 | 443 | 443 | 73.8 |
| Filter: Dept = Computer | Çağla 91, Selin 78, Burak 55 | 443 | 91 + 78 + 55 = 224 | 224 / 3 ≈ 74.7 |
| Second filter: Score > 75 | Çağla 91, Selin 78 | 443 | 91 + 78 = 169 | 169 / 2 = 84.5 |
| Clear | all 6 records | 443 | 443 | 73.8 |
Each row of the table verifies a rule. Sorting does not change the results, because the formulas point to the range C2:C7 and the values in the range have only changed places. A filter does not change SUM either; SUM also adds the hidden rows and always gives 443. SUBTOTAL, on the other hand, calculates only what is visible. When the filter is cleared all the rows come back and SUBTOTAL is 443 again.
The function numbers of SUBTOTAL come in two groups, 1–11 and 101–111. The number 9 skips only the rows hidden by a filter. The number 109 also skips manually hidden rows. The total row of an Excel table uses the 109 version of SUBTOTAL behind the scenes; that is why, when the table is filtered, the total row also shows only what is visible.
3.2.11Conditional formatting, PivotTables, and data validation
Making the important values in a list visible to the eye, summarizing the list by group, and preventing wrong data from being entered into it are three complementary jobs of data analysis. Excel offers conditional formatting, the PivotTable, and data validation for these jobs, respectively.
3.2.11.1Conditional formatting
Conditional formatting is a rule that ties a cell's format to that cell's value. When the value changes, the format changes by itself.
The commands are collected in the Home → Conditional Formatting menu. The main rule types are:
- Highlight Cells Rules. Applies a format according to a certain threshold: Greater Than, Less Than, Between, Equal To, Text that Contains, Duplicate Values.
- Top/Bottom Rules. Marks the largest or smallest few values, or those above the average.
- Data bars. Draws a bar inside the cell proportional to the value.
- Color scales. Shows low and high values with a color gradient.
- Icon sets. Indicates a value's position in the range with icons such as arrows, circles, or flags.
- Formula rule. With New Rule → Use a formula to determine which cells to format, any formula that gives TRUE or FALSE can be written as the condition.
The formula rule is the most flexible type. For example, to color the whole row of a student list, A2:C7 is selected and the rule formula =$C2<60 is typed. The formula is written relative to the top-left cell of the selection and applied as if copied to the other cells. $C locks the column, so each cell looks at the score in column C of its own row. Because the row number is free, each row tests its own score. This is another use of the mixed reference in 3.2.5.1.
Moderation is needed in conditional formatting. If five rules and ten colors are applied to the same range, the eye cannot pick out the important value. Color alone should not carry meaning; red and green are hard to tell apart for readers with color blindness. Writing a note beside a rule or using icons reduces this problem.
3.2.11.2Thresholds of icon sets
Let the scores of seven students be in B2:B8: 72, 91, 85, 64, 78, 58, 45. Four different rules can be applied to these scores. If the cell rule “Less Than 60” is chosen, 58 and 45 get a red fill. In data bars the longest bar belongs to the largest value (91). In the color scale the lowest value (45) gets the lightest tone and the highest (91) the darkest. In the icon set, each value falls into one of three groups. But how are the groups decided?
The default thresholds of a three-icon set are 67% and 33%. These percentages are applied not to the values themselves but to the range between the smallest and the largest value:
threshold = smallest + percentage × (largest − smallest)
A three-icon set (▲ 67% and above, ● 33%–67%, ▼ below 33%) is applied to the scores 72, 91, 85, 64, 78, 58, 45. Let us find the thresholds and each score's icon.
- Range. Smallest 45, largest 91; range 91 − 45 = 46.
- Upper threshold. 45 + 0.67 × 46 = 45 + 30.82 = 75.82 ≈ 75.8.
- Lower threshold. 45 + 0.33 × 46 = 45 + 15.18 = 60.18 ≈ 60.2.
- ▲ cells. 75.82 and above: 91, 85, 78.
- ● cells. Between 60.18 and 75.82: 72 and 64.
- ▼ cells. Below 60.18: 58 and 45.
The thresholds change with the data. If the lowest score drops from 45 to 30, the range widens to 91 − 30 = 61. The upper threshold falls to 30 + 0.67 × 61 ≈ 70.9 and the score 72 moves from ● to ▲; although 72 itself has not changed, its icon has. If fixed thresholds are wanted, in the Manage Rules → Edit Rule box the type is changed from “Percent” to “Number” and fixed values such as 75 and 60 are typed.
Mistaking the 67% in an icon set for “the best 67% of the scores”. The threshold is computed not from the ranking of the values but from the distance between the smallest and the largest value. In the example three of the seven scores got ▲; that ratio has nothing to do with 67%. If a threshold by ranking is wanted, the rule type “Percentile” is chosen.
3.2.11.3PivotTables
To summarize a list by group, a separate SUMIF or COUNTIF formula can be written for each group. As the number of groups grows, this way becomes tiring. The PivotTable does the same job without formulas, by dragging fields.
A PivotTable is an interactive table that places the columns of a list into row, column, filter, and value fields and produces summaries such as grouped totals, averages, and counts. It does not change the source data itself.
To create a PivotTable, a cell inside the list is selected and the Insert → PivotTable command is given. The source list must have headers and contain no empty rows. Excel opens an empty PivotTable on a new sheet and the PivotTable Fields pane on the right. The pane lists the headers of the source list as fields; below it are four boxes: Filters, Columns, Rows, and Values.
The six-student list (Ali Electrical 72, Ece Computer 91, Can Electrical 85, Deniz Computer 64, Burak Mechanical 78, Selin Electrical 58) is summarized by department.
- Dept → Rows. Each dept is listed once: Computer, Electrical, Mechanical, and at the bottom Grand Total.
- Score → Values. The default summary of a numeric field is the sum. Computer 91 + 64 = 155, Electrical 72 + 85 + 58 = 215, Mechanical 78; Grand Total 155 + 215 + 78 = 448.
- Value Field Settings → Average. Computer 155 / 2 = 77.5; Electrical 215 / 3 ≈ 71.7; Mechanical 78.0; Grand Total 448 / 6 ≈ 74.7.
- Name → Values. The default summary of a text field is counting: Computer 2, Electrical 3, Mechanical 1; 6 people in total.
The average in the Grand Total row needs attention. 74.7 is the average of the six scores: 448 / 6. The average of the three department averages, however, is (77.5 + 71.7 + 78) / 3 ≈ 75.7. That calculation counts the crowded Electrical group and the one-person Mechanical group with equal weight. The PivotTable uses the right weighting itself.
A PivotTable and formulas give the same result: the Electrical total 215 can also be found with =SUMIF(B2:B7,"Electrical",C2:C7). The difference is this: formulas update by themselves when the source data changes, but a PivotTable does not. When a new record is added to the source, the PivotTable is right-clicked and Refresh is chosen. If the source is defined as an Excel table, new rows are covered automatically on refresh.
3.2.11.4Data validation
The quality of an analysis depends on the quality of the data entered. If 150 is typed in a grade column and “Electrcial” in a dept column, all later calculations are affected. Data validation makes it possible to catch wrong data at the moment it is entered.
Data validation restricts the values that can be entered into a cell with a rule. The rule can be a list, a number or date range, a text length, or a formula. The explanation shown when the cell is selected is called the input message, and the warning that opens on an entry that breaks the rule is called the error alert.
Adding a drop-down list to a dept column takes six steps:
- Selecting the range. The cells to be validated (for example B2:B4) are selected; Data → Data Tools → Data Validation is opened.
- The list rule. On the Settings tab, List is chosen in the Allow box. In the Source box the options are typed separated by commas (
Electrical,Computer,Mechanical) or a range holding the options is indicated (=$E$2:$E$4). - Result. When the cell is selected an arrow appears on its right; the user chooses only one of the values in the list.
- Error alert. On the Error Alert tab the style, title, and message are written: Style Stop, title “Invalid group”, message “Choose a group from the list.”
- Invalid entry. If “Banana”, which is not in the list, is typed, the Stop style rejects the entry; Retry returns the cell to editing.
- Choosing the style. How strict the alert is depends on the style.
=$E$2:$E$4). The separator depends on regional settings; it is a comma in English settings.Linking the source to a cell range makes maintaining the list easier. When a new dept is added, only the list in column E is updated. The range is locked with $ signs; so when the rule is applied to several cells, each cell looks at the same list.
Data validation has a limit: the rule checks only entries typed by hand. Values copied from elsewhere and pasted can get past the rule. Invalid values entered earlier are not flagged automatically either. To find them, the Data Validation → Circle Invalid Data command is used.
3.2.12Charts
A table gives exact numbers; a chart shows the trend, the comparison, and the outlier at a glance. But a chart of the wrong type or drawn carelessly can hide the data, or even leave a false impression. This section covers choosing the chart that suits the purpose of the data and making the chart clear.
3.2.12.1Choosing a chart type
The chart type is chosen not by how the data looks but by the question the chart will answer. Table 3.2.16 matches the basic questions with the chart types that suit them.
| Purpose | Suitable chart | Example question |
|---|---|---|
| Comparing categories | Column or bar chart | Which department has the higher average? |
| Showing change over time | Line chart | How have monthly sales changed? |
| Part-to-whole relationship | Pie chart with few categories, or a percent bar | What percentage of the budget went to materials? |
| Relationship of two numeric variables | Scatter (XY) chart | Does the grade rise as study time rises? |
| Shape of a variable's distribution | Histogram | In which ranges do the scores cluster? |
A chart is inserted by selecting the range that holds the data and choosing a type from the Charts group of the Insert tab. The Recommended Charts button shows the types Excel suggests by looking at the data. In a column chart the categories go on the horizontal axis and the values on the vertical axis. A bar chart shows the same thing with horizontal bars and is more readable with long category names.
The pie chart is the most misused type. If the sum of the parts does not form a meaningful whole (for example the scores of five students), a pie chart is meaningless. When the number of categories goes beyond five or six, it becomes hard to compare the sizes of the slices by eye; in that case a sorted bar chart is better. The scatter chart and the line chart are also confused. In a line chart the horizontal axis is a category axis and the points are evenly spaced. In a scatter chart the horizontal axis is a true numeric axis. If the measurements are not evenly spaced, for example if they were taken at 1, 2, 5, and 10 seconds, a line chart distorts the time axis.
3.2.12.2A clear and honest chart
In a good chart the reader sees at a glance what is shown. For this, the following elements of the chart are reviewed:
- Title. Says what the chart shows: not “Chart1” but “Monthly sales (thousand ₺)”.
- Axes and units. Axis titles state the meaning and unit of the values.
- Source data. It is checked that the right range and series are selected; a total row must not be accidentally drawn as a category.
- Scale. The axis limits are set so as not to make differences look bigger or smaller than they are.
- Color. Serves to separate series, but should not carry meaning alone.
- Simplicity. Three-dimensional effects, shadows, and needless decoration are removed; they make values harder to read.
January, February, and March sales are 96, 98, and 97 thousand ₺. If the vertical axis starts at 95, how many times as long does the February column look compared with the January column? What is the real difference as a percentage?
- Apparent heights. Because the axis starts at 95, the column height is the part of the value above 95: January 96 − 95 = 1, February 98 − 95 = 3, March 97 − 95 = 2.
- Apparent ratio. The February column looks 3 times as long as the January column: 3 / 1.
- Real ratio. 98 / 96 ≈ 1.021; February sales are only about 2.1% more than January's.
In column and bar charts the axis must start at 0, because the reader compares the value with the length of the column. In a line chart, since the aim is to show the slope, the axis does not have to start at 0. Excel sometimes starts the axis from a value other than 0 by itself; this is fixed with the Format Axis → Bounds → Minimum setting.
3.2.13Reporting, workbook management, and data layout
A workbook is often shared with others, printed, or used for years. This section covers preparing a workbook for printing, managing sheets, protecting it from change, and building a data layout suited to analysis from the start.
3.2.13.1Printing and page layout
A table that looks fine on screen may be split into several pages when printed; the last column may land on a separate page. Before printing, the output is checked in the preview on the File → Print screen. The page-layout settings are collected on the Page Layout tab:
- Print area. Makes only the selected range print: Page Layout → Print Area → Set Print Area.
- Orientation. For wide tables, landscape is chosen.
- Scaling. If the Width box in the Scale to Fit group is set to “1 page”, the table is shrunk to fit the page width.
- Repeat titles. In the box opened with the Print Titles button, row 1 is chosen as Rows to repeat at top; the header row is printed on every page of a multi-page printout.
- Page breaks. View → Page Break Preview shows with blue lines where the pages are split; the lines can be dragged to change the split.
Scaling means shrinking, and shrinking has a limit. Let the printable width of a landscape A4 page be about 27.7 cm. When a table 35 cm wide is fitted to this width, the scale drops to 27.7 / 35 ≈ 79%. The text shrinks by the same ratio; 11-point text falls to about 8.7 points. If the scale falls below 60%, the printout becomes unreadable; in that case it is better to split the table or leave unneeded columns out of the print area.
3.2.13.2Workbook management
Sheet operations are done from the menu that opens when a sheet tab is right-clicked: Insert, Delete, Rename, Move or Copy, Tab Color, Hide, and Unhide.
- Renaming. The tab is double-clicked and a short name that describes the content is typed. Sheet references in formulas update to the new name automatically.
- Move or Copy. Transfers the sheet to another position in the workbook or to another workbook. If “Create a copy” is checked, the sheet is copied, not moved.
- Tab color. Groups the data, calculation, and report sheets by color.
- Hiding and unhiding. Removes helper sheets from view. Anyone can bring a hidden sheet back with right-click → Unhide; so hiding is not a security measure.
- Links. Formulas that refer to another workbook depend on the location of that file. If the source file is moved or renamed, the link breaks. References of this kind are used carefully and sparingly.
3.2.13.3Protection and collaboration
A sheet can be protected to prevent formulas from being deleted by accident. Sheet protection has two steps. The reason is that in Excel every cell is marked Locked by default; but this lock has no effect until protection is turned on.
- Unlocking the input cells. The cells the user may change (for example the quantities) are selected. On the Format Cells → Protection tab, the Locked mark is cleared.
- Protecting the sheet. The Review → Protect Sheet command is given; an optional password is typed. Now locked cells cannot be changed, and unlocked cells can be typed into.
In the example in Figure 3.2.47 the amounts are calculated with formulas such as =B2*40: 3 × 40 = 120, 5 × 40 = 200, 2 × 40 = 80. The user can change the quantities but cannot touch the formulas.
In Excel the levels of protection differ from one another:
- Sheet protection prevents cells and some operations from being changed. Its aim is to prevent accidental changes; it is not a strong security measure.
- Workbook structure protection (Review → Protect Workbook) prevents adding, deleting, and moving sheets and unhiding hidden sheets.
- File encryption (File → Info → Protect Workbook → Encrypt with Password) asks for a password to open the file. This is the real protection for files that carry confidential information. If the password is forgotten, the file cannot be recovered.
There are tools for collaboration too. Comments (Review → New Comment) are for asking and answering questions on a cell. If the file is stored in a cloud location such as OneDrive or SharePoint, several people can edit at the same time. Version History also makes it possible to go back to earlier states of the file.
3.2.13.4Good data layout
Most of the tools described in these notes — sorting, filters, SUMIF, VLOOKUP, PivotTables — assume that the data is kept in a certain layout. If the layout is broken, the tools either do not work or silently give wrong results. A data sheet suited to analysis follows four rules:
- Each row represents a single record and each column a single variable.
- Headers are on a single row; they are short, unique, and meaningful. The unit is stated in the header: “Quantity (kg)”.
- Raw data has no empty rows, merged cells, or subtotals.
- Raw data, calculations, and report outputs can be kept on separate sheets.
Which Excel tools break on the table on the left in Figure 3.2.48? How are the same questions answered in the layout on the right?
- Merged header. Sorting and filtering do not work because of the merged cell; converting to an Excel table does not recognize the headers either.
- Empty row. Excel treats adjacent data as a whole. An empty row splits the list in two; Ctrl+T or a PivotTable takes only the upper part.
- The text “12 kg”. Because it is text it does not enter SUM, and in arithmetic it gives #VALUE!.
- Subtotal row. When the column is summed, the subtotal is added once more and the result is doubled.
- In the tidy table. The total for Apple is
=SUMIF(B2:B4,"Apple",C2:C4)= 12 + 15 = 27 kg; all the quantities=SUM(C2:C4)= 12 + 8 + 15 = 35 kg. The totals sit not inside the data but in a separate cell.
These rules may look laborious at first. But a tidy data sheet saves struggling from scratch with every new question: the same list is sorted today, filtered tomorrow, and then becomes the source of a PivotTable. Another benefit of tidy data is that it transfers easily to other tools; a statistics program or a programming language can read this table as it is.
3.2.14Summary
- A workbook consists of one or more worksheets. A cell address is written with the column letter and row number (C3); a range is indicated by its two corner cells (B4:D6 = 3 × 3 = 9 cells). A sheet has 1,048,576 rows and 16,384 columns.
- Excel left-aligns text and right-aligns numbers and dates; a left-aligned number has been stored as text and does not enter calculations. A number format changes only the display; calculations use the value in the formula bar.
- A formula begins with an equals sign and can contain constants, references, operators, and functions. Operator precedence: parentheses, negation, percent, exponent, multiplication–division, addition–subtraction, concatenation, comparison; left to right at the same level. In Excel
=-2^2is 4. - A relative reference (A1) shifts when copied, an absolute reference ($A$1) stays fixed, and in a mixed reference ($A1, A$1) only the part marked with $ stays fixed. F4 cycles through the types. In formulas that refer to a single rate cell, that reference must be absolute; otherwise Excel produces a wrong result without an error.
- SUM, AVERAGE, MAX, MIN, and COUNT ignore text and empty cells. IF returns one of two values according to a test; AND, OR, and NOT combine conditions; in a nested IF the conditions start from the high threshold. IFERROR hides the error but does not remove its cause.
- COUNTIF and SUMIF count and add by a criterion; for several conditions COUNTIFS and SUMIFS are used. VLOOKUP searches in the first column and returns a column to its right; in an exact match the last argument is 0. An approximate match is used in sorted scale tables. XLOOKUP can look in both directions; FILTER spills its result.
- Dates are serial numbers, times are fractions of a day; the difference of dates is found by subtraction. Each error value points to a cause: #DIV/0!, #NAME?, #VALUE!, #REF!, #N/A, #SPILL!. Errors propagate to the formulas that use them.
- AutoFill works out a series from the first two values; Flash Fill learns from an example but produces values. An Excel table expands by itself and allows structured references.
- In sorting the rows must move as a whole; in a multi-level sort the second criterion works only within equal groups. A filter hides rows, it does not delete them; conditions narrow together. SUM also adds hidden rows; SUBTOTAL calculates only what is visible.
- Conditional formatting ties format to value; the thresholds of icon sets are computed from the range between the smallest and the largest value. A PivotTable gives grouped summaries without formulas and must be refreshed when the source changes. Data validation prevents invalid entries from the start.
- The chart type is chosen by the question asked: columns for comparison, lines for time, a pie with few slices for part-to-whole, scatter for relationships, a histogram for the shape of a distribution. The axis of a column chart must start at 0.
- Before printing, the print area, scale, and repeated titles are set. Sheet protection prevents accidental changes; it does not provide secrecy, and for secrecy the file is encrypted. In a good data layout each row is a record and each column a variable; there are no empty rows, merged cells, or subtotals.
| Calculation | Rule | Example |
|---|---|---|
| Number of cells in a range | (column difference + 1) × (row difference + 1) | C3:F10 → 4 × 8 = 32 |
| Operator precedence | parentheses, sign, %, ^, * /, + − | =2+3*(4-1)^2 → 29 |
| Copying a formula | parts without $ shift by Δc, Δr | C3 → E7: =A1+$B$2+B$1+$A2 → =C5+$B$2+D$1+$A6 |
| Average | sum of the numbers ÷ count of numbers | 12, 7, “absent”, 20, empty, 5 → 44 / 4 = 11 |
| Approximate match | the largest threshold less than or equal to the lookup value | 72 → threshold 70 → B |
| Date difference | difference of the serial numbers | 2/1/2024 → 3/1/2024: 29 days |
| Hourly pay | duration (days) × 24 × hourly rate | 1.875 × 24 × 150 = 6750 ₺ |
| Icon threshold | smallest + percentage × (largest − smallest) | 45 + 0.67 × 46 ≈ 75.8 |
3.2.15Key terms
- workbook
- worksheet
- sheet tab
- active cell
- name box
- formula bar
- range
- data type
- logical value (TRUE/FALSE)
- freeze panes
- border
- fill
- wrap text
- number format
- formula
- constant
- operator
- operator precedence
- negation
- exponent
- concatenation (&)
- cell reference
- relative reference
- absolute reference
- mixed reference
- named range
- fill handle
- Show Formulas
- function
- argument
- logical test
- criteria
- exact match
- approximate match
- spill
- date serial number
- error value
- AutoFill
- data series
- Flash Fill
- table
- structured reference
- total row
- sort
- multi-level sort
- filtering
- SUBTOTAL
- conditional formatting
- data bars
- color scales
- icon sets
- PivotTable
- data validation
- drop-down list
- input message
- error alert
- column / bar chart
- scatter chart
- histogram
- print area
- sheet protection
3.2.16Test Yourself
The formula
=A1+$B$2+B$1+$A2in cell C3 is copied and pasted into D5. What is the formula in D5?Answer
From C to D is 1 column right, from 3 to 5 is 2 rows down: Δc = 1, Δr = 2.
A1→ B3;$B$2does not change;B$1→ C$1 (only the column shifts);$A2→ $A4 (only the row shifts). Result:=B3+$B$2+C$1+$A4.What do the formulas
=-3^2+10and=10-3^2give in Excel? Why do they differ?Answer
In the first, the leading minus is negation and is applied before the exponent: (−3)^2 = 9, 9 + 10 = 19. In the second the minus is subtraction and comes after the exponent: 3^2 = 9, 10 − 9 = 1. For the mathematical result −3² + 10 = 1,
=-(3^2)+10must be written.B2:B6 hold 40, “absent”, 70, empty, 90. What do
=AVERAGE(B2:B6),=COUNT(B2:B6), and=COUNTA(B2:B6)give? What would the average be if 0 had been typed instead of “absent”?Answer
Only 40, 70, and 90 are numbers: AVERAGE = 200 / 3 ≈ 66.7; COUNT = 3; COUNTA also counts the text: 4. If 0 is typed, the 0 enters the calculation as a number: 200 / 4 = 50.
In the six-student list in 3.2.7 (B2:B7 dept, C2:C7 score), what do
=COUNTIF(B2:B7,"<>Electrical")and=SUMIF(C2:C7,">=70")give?Answer
The ones other than Electrical are Ece, Deniz, and Burak: 3. Those with a score of 70 and above are 72, 91, 85, and 78; since no sum range is given, the scores themselves are added: 72 + 91 + 85 + 78 = 326.
With the scale 0 → F, 50 → D, 60 → C, 70 → B, 85 → A, what does the formula
=VLOOKUP(B2,$D$2:$E$6,2,TRUE)return for the scores 59 and 84? What would happen if the last argument were 0?Answer
59: the largest threshold less than or equal to it is 50 → D. 84: the largest suitable threshold is 70 (85 > 84) → B. In an exact match, neither is found in the table exactly, so #N/A is returned.
A project is run by working five days a week, from 08:30 to 17:30 each day. The daily duration is found with
=B2-A2and five days are summed. If the total cell has theh:mmformat, what appears? What is done for the correct display?Answer
The daily duration is 17:30 − 08:30 = 9 hours; weekly 45 hours = 1.875 days.
h:mmdrops the whole day and shows 45 − 24 = 21 hours: 21:00. When the format code is set to[h]:mm, 45:00 appears.In the list in 3.2.10.4 (Selin Computer 78, Can Electrical 85, Çağla Computer 91, Ali Electrical 64, İrem Mechanical 70, Burak Computer 55) a Dept = Electrical filter is applied. What do SUM, SUBTOTAL(9), and SUBTOTAL(1) give?
Answer
SUM also adds the hidden rows: 443. The visible rows are Can 85 and Ali 64: SUBTOTAL(9) = 149, SUBTOTAL(1) = 149 / 2 = 74.5.
The scores are 35, 50, 65, 80, 95, 100. The default three-icon set (67% and 33%) is applied. What are the thresholds; which icon do 65 and 80 get?
Answer
The range is 100 − 35 = 65. Upper threshold 35 + 0.67 × 65 = 78.55; lower threshold 35 + 0.33 × 65 = 56.45. 80 ≥ 78.55 → ▲; 65 is between the two thresholds → ●. 35 and 50 get ▼, and 95 and 100 get ▲.
In a PivotTable the department averages come out as Computer 77.5 (2 people), Electrical 71.7 (3 people), Mechanical 78 (1 person). Why is the average in the Grand Total row 74.7 and not 75.7?
Answer
The overall average is the sum of the six scores divided by six: 448 / 6 ≈ 74.7. The simple average of the three averages, (77.5 + 71.7 + 78) / 3 ≈ 75.7, gives every department the same weight regardless of head count. The one-person Mechanical group would be overcounted and the three-person Electrical group undercounted.
In a name–score list a student selects only the Score column, sorts it largest to smallest, and says “Continue with the current selection” in the warning. What happens, and how is it fixed?
Answer
Only the scores change places and the names stay; each name is paired with someone else's score. Excel gives no error. It is undone at once with Ctrl+Z; in the sort warning “Expand the selection” is chosen so that the rows move as a whole.
3.2.17Further reading
- Microsoft Support, Excel training pages (support.microsoft.com): short, up-to-date explanations with examples, in many languages, for formulas, functions, tables, PivotTables, and charts.
- M. Alexander and D. Kusleika, Microsoft Excel 365 Bible (Wiley, 2022): treats the functions touched on only briefly in these notes, dynamic-array formulas, PivotTables, and charts in reference-book detail.
- K. W. Broman and K. H. Woo, “Data Organization in Spreadsheets”, The American Statistician 72(1), 2018: a short, practical account of the rules for keeping data in a spreadsheet consistent, rectangular, and ready for analysis.
- C. Nussbaumer Knaflic, Storytelling with Data (Wiley, 2015): shows with examples how to choose the chart type, strip away needless elements, and direct the reader's attention to the right place.
3.2.18References
- Microsoft Support, Basic tasks in Excel.
- Microsoft Support, Overview of formulas in Excel.
- Microsoft Support, Sort data in a range or table.
- M. Alexander, D. Kusleika, Microsoft Excel 365 Bible, Wiley, 2022.
- K. W. Broman, K. H. Woo, “Data Organization in Spreadsheets”, The American Statistician, 72(1), 2–10, 2018.
- C. Nussbaumer Knaflic, Storytelling with Data: A Data Visualization Guide for Business Professionals, Wiley, 2015.