Analyzing and Summarizing Data

Turn a table of raw records into an answer. You plan an analysis from its question, then sort and filter rows, add calculated columns, combine tables with lookups and joins, and group and aggregate data with spreadsheet functions, SQL GROUP BY and pivot tables. You calculate summary statistics, percentages, rates and weighted averages, check every result against totals and row counts, and state what the numbers show and what they cannot show. Examples work in Excel, Google Sheets and any common SQL database.

BeginnerLesson 5 of 7 in Data Analytics Foundations Course

What you will learn

  1. Turn an analysis question into a plan of metric, groups and filters, then sort and filter the data in a spreadsheet and in SQL so that the rows that answer the question are in view.
    • Plan the analysis from the question
      Identify the metric, the groups, the filters and the table grain that an analysis question needs, and outline the steps before calculating anything.
    • Sort data to reveal order and extremes
      Sort rows by one or more columns in a spreadsheet and with ORDER BY in SQL, keep rows intact, and recognize when the data type spoils the order.
    • Filter rows with one or more conditions
      Keep only the rows an analysis needs with spreadsheet filters and the SQL WHERE clause, combine conditions with AND, OR and parentheses, and handle dates, blanks and hidden rows correctly.
  2. Add columns that compute a new value for every row, such as revenue, profit margin, month or a size category, with spreadsheet formulas and SQL expressions.
    • Calculate new columns from existing ones
      Build row-level calculations with spreadsheet formulas and SQL expressions, including arithmetic, dates and text, and avoid errors from references, division and rounding.
    • Classify rows with conditions and divide safely
      Create category and flag columns with IF and CASE, order the conditions correctly, and protect ratios against division by zero and missing values.
  3. Bring related tables together on a shared key, with lookups in a spreadsheet and joins in SQL, and recognize when combining adds, loses or repeats rows.
    • Identify keys and relationships between tables
      Recognize primary and foreign keys and the relationships between tables, check that keys are unique and match exactly, and tell adding columns apart from appending rows.
    • Look up values from another table in a spreadsheet
      Use XLOOKUP and VLOOKUP with exact matches to bring values from a reference table into the data, handle missing matches, and use approximate matching only for bands.
    • Combine tables with joins and check the result
      Explain inner and left joins, predict which rows a join keeps, recognize and avoid repeated rows after a one-to-many join, and check row counts and totals.
  4. Summarize many rows into counts, totals and averages, overall and per group, with spreadsheet functions, SQL GROUP BY and pivot tables, and handle blanks and missing values correctly.
    • Aggregate a column with count, sum, average, minimum and maximum
      Apply the basic aggregate functions in spreadsheets and SQL, count rows, values and distinct values correctly, and know how blanks and NULLs change the results.
    • Count and sum with conditions
      Use COUNTIFS, SUMIFS and AVERAGEIFS with text, number and cell-based criteria to build summary tables in a spreadsheet, and write the same conditional totals in SQL.
    • Group rows and aggregate them in SQL
      Write GROUP BY queries with aggregate functions, filter rows with WHERE and groups with HAVING, follow the logical order of a query, and aggregate in two steps when a question needs it.
    • Summarize data with a pivot table
      Build a pivot table with rows, columns, values and filters to answer an analysis question, choose the right summary function, and keep the pivot table complete and up to date.
  5. Describe a numeric column with measures of center and spread, and compare groups fairly with percentages, rates and weighted averages.
    • Describe the center and spread of a numeric column
      Calculate the count, mean, median, mode, minimum, maximum, range and standard deviation, choose between mean and median, and treat outliers with care.
    • Calculate percentages, rates and weighted averages
      Calculate shares of a total, percent change and rates per base, distinguish percent from percentage points, and combine group averages and rates with the correct weights.
  6. Verify every result with totals, row counts and independent recalculation before sharing it, then answer the analysis question in clear numbers with the context and limits a reader needs.
    • Check results before sharing them
      Verify an analysis by reconciling totals and row counts, recalculating samples by hand or with a second method, testing plausibility and documenting the steps.
    • Interpret and report what the summary shows
      State the answer to the analysis question with the right numbers, comparisons and context, avoid claims the summary cannot support, and name the limits of the data.

Analyzing and Summarizing Data study guide

6 chapters

1

Plan an analysis and organize the data

A useful analysis starts with a question and a table whose rows you understand. You will translate the question into a metric, groups, filters, and a comparison, then organize the relevant records. Sorting makes rankings visible; filtering decides which records belong in the answer. Both depend on keeping rows intact and recognizing real numbers, dates, and missing values before trusting the view on screen.

1.1 Plan the analysis from the question

A table becomes useful when you know what you want to find. Analysis organizes, transforms, and summarizes cleaned data to answer a question. Its result becomes the input for a chart, dashboard, or recommendation.

Turn the question into four decisions

For “Which region had the highest revenue in March 2026?”, make the decisions explicit:

PartDecision
MetricSum of quantity times unit price
DimensionRegion
FilterOrders dated in March 2026
ComparisonRank regions from highest to lowest revenue

A metric is the number you calculate. A dimension supplies the groups. A filter sets the records included, and the comparison tells you how to judge the results. Define the metric precisely: revenue before discounts differs from revenue after discounts. Record how returns, cancellations, and tax are treated so a second analyst can calculate the same number.

Check what one row represents

The grain is what one row stands for. One order per row lets a row count measure orders. One order line per row does not: an order containing three products occupies three rows. Counting those rows would report three lines as three orders.

Here are ten March orders, one row per order. Prices are in dollars. In a spreadsheet, the six input columns are A through F, data occupy rows 2 through 11, and the revenue calculation goes in G.

order_idorder_dateregioncategoryquantityunit_price
10012026-03-02NorthBooks215
10022026-03-02SouthGames140
10032026-03-05NorthGames340
10042026-03-09EastBooks115
10052026-03-12SouthBooks415
10062026-03-15EastToys225
10072026-03-20NorthToys125
10082026-03-22SouthGames240
10092026-03-28EastGames140
10102026-03-30NorthBooks515
Plan the operations before running them

First select March dates. Calculate each order's revenue from its quantity and unit price, group by region, sum the calculated field, and sort the regional totals in descending order. The row revenues are 30, 40, 120, 15, 60, 50, 25, 80, 40, and 75. Their total is 535. The grouped answer is North 250, South 180, and East 105.

In a spreadsheet, this path uses a filter, a formula column, and either conditional functions or a pivot table. In SQL, it uses WHERE, a multiplication expression, GROUP BY, and ORDER BY. A spreadsheet makes small-table exploration easy to inspect; SQL works directly with database tables and saves repeatable queries.

Keep source records unchanged by working in a separate sheet, copy, or query. Save the question, definitions, and operations alongside the result. Producing a convenient total before deciding what it measures is a common way to answer a different question from the one asked.

Key Takeaways

  • Define the metric, dimension, filter, and comparison before calculating.
  • Table grain determines what a row count measures.
  • Keep the source unchanged and save enough detail to repeat the analysis.
  • Check that the final summary answers the original question.

1.2 Sort data to reveal order and extremes

Sorting puts records in an order that makes rankings and extremes easier to see. Ascending runs from smallest to largest, A to Z, or oldest to newest; descending reverses that order. The values in a record stay together.

Sort complete records

In Excel, use Data > Sort; in Google Sheets, use Data > Sort range. Select the whole range, including every column that belongs to each record, and identify the header row. An Excel table keeps its row fields together during a sort.

If you sort only the revenue column, an amount can move beside the wrong order id. The total can remain 535 even though the records are now incorrect. Check a few complete rows after sorting, including an id, a date, and its amount. A row count alone cannot catch this mistake.

Use a second field to resolve ties

Suppose four records have region and revenue values East 15, North 30, East 50, and North 120. Sort by region ascending, then revenue descending. The result is East 50, East 15, North 120, North 30. The first field forms the main blocks; the second orders records inside each block.

SQL expresses the same rule as:

SELECT order_id, region,
       quantity * unit_price AS revenue
FROM orders
ORDER BY region ASC, revenue DESC;

ASC is the default. The alias revenue names the calculated result and can be used in ORDER BY. This query returns a sorted result without rearranging the stored table. Without ORDER BY, SQL gives no guaranteed row order, even when repeated runs happen to look the same.

Find the top records

For the March orders, revenue descending begins with order 1003 at 120, order 1008 at 80, and order 1010 at 75. To return three rows, PostgreSQL, MySQL, and SQLite support an ending such as ORDER BY revenue DESC LIMIT 3; SQL Server uses SELECT TOP 3 with the ordering clause.

A cutoff may fall inside a tie. Add a second field, such as order_id ASC, when you need a predictable choice among equal revenues. Returning three rows and returning every record tied for third place are different requests; a simple row limit addresses the first.

Check the values behind the display

Numbers stored as text can sort as “10”, “100”, “9”. Real numbers sort as 9, 10, 100. Text dates written as “03/12/2026” may follow character order instead of time order. Convert the column to the proper type during cleaning; changing the visible number format alone does not reliably convert text.

The spreadsheet SORT function returns a sorted copy in another location. Excel uses 1 for ascending and −1 for descending in its sort-order argument. Google Sheets uses TRUE and FALSE. The copy updates when the referenced data change.

Before treating the display as a ranking of the full data set, check active filters and the selected range. A correctly sorted visible subset can still omit the record with the highest value.

Key Takeaways

  • Sort the complete range and keep headers separate from data.
  • A second sort field gives an order within ties.
  • SQL row order is guaranteed only when you request it with ORDER BY.
  • Real numeric and date types are needed for numeric and date order.
  • Check filters and cutoff ties when reporting top records.

1.3 Filter rows with one or more conditions

A filter decides which records belong in an analysis. Spreadsheet filters hide nonmatching rows; SQL WHERE returns matching rows. Neither operation deletes the source records.

Build conditions that match the question

SQL comparisons include =, <>, >, <, >=, and <=. Use IN for a list, LIKE for a text pattern, and IS NULL for missing values. Text literals use straight single quotes, as in WHERE region = 'North'. Spreadsheet filter menus offer text, number, and date conditions.

AND requires every condition to hold. OR requires at least one. Among the March orders, North and Books gives two orders, 1001 and 1010. North or Books gives six: the four North orders plus the two Books orders elsewhere. An order meeting both parts of an OR belongs in the result once.

SQL evaluates AND before OR. Compare these conditions:

WHERE category = 'Books'
   OR category = 'Toys' AND region = 'East'

This includes every Books order plus East Toys orders: five rows. To include East records only, group the categories first:

WHERE (category = 'Books' OR category = 'Toys')
  AND region = 'East'

That keeps two rows. category IN ('Books', 'Toys') can replace the parenthesized OR.

Include the whole date period

BETWEEN includes both endpoints. With timestamps, an upper endpoint written as March 31 may mean midnight at the start of that day, leaving out its later records. Use an inclusive start and an exclusive next-period start:

WHERE order_date >= '2026-03-01'
  AND order_date < '2026-04-01'

Date literal syntax varies by database. The boundary logic keeps every moment in March without guessing the last possible time on March 31.

Handle missing and inconsistent values

discount = NULL is not a true comparison. Use discount IS NULL. A missing discount also satisfies neither discount < 5 nor discount >= 5, so those two conditions do not cover all records when missing values exist. Give missing values their own group or exclude them deliberately.

Inspect distinct text values before filtering. Capitalization and trailing spaces can affect matches differently across tools and database settings. Standardize the keys and labels during cleaning so “North” and a variant with an extra space do not depend on matching behavior.

Total the records you can see

In Excel and Google Sheets, =SUM(G2:G11) still includes rows hidden by a filter. =SUBTOTAL(9, G2:G11) sums the rows the filter leaves visible. Filtering the March table to North leaves four orders: SUM remains 535, while SUBTOTAL gives 250.

Alternatively, =FILTER(A2:G11, C2:C11="North") returns a matching copy in a new location; a sum over that copy covers only those returned records. Record the before-and-after counts and state the filter beside the result. An old active filter can otherwise make a later analysis silently cover the wrong population.

Key Takeaways

  • AND requires all conditions; OR includes records meeting either condition.
  • Use parentheses when combining AND and OR.
  • Filter timestamps with an inclusive start and an exclusive next-period start.
  • Test SQL missing values with IS NULL.
  • SUBTOTAL can sum visible filtered rows; SUM includes hidden rows.
  • Record the filter and its resulting row count.
2

Create calculated fields

An analysis often needs values that the source table does not store directly. Quantity and price produce revenue; dates produce month labels; a rule produces an order-size category. You will build these fields in spreadsheets and SQL, keep references and units consistent, and test boundaries and missing values. The calculations stay at the row level until you deliberately combine them into a summary.

2.1 Calculate new columns from existing ones

A calculated field adds a value to each record using the fields already there. Revenue from quantity and unit price is a row-level calculation. It still leaves one row per order; a regional total comes later.

Build and fill a formula

With quantity in E and unit price in F, enter =E2*F2 in G2. Filling down changes the relative references to =E3*F3, then =E4*F4. Check the first and last filled cells to make sure the formula covers the data and refers to each row's inputs.

A rate stored in one fixed cell needs an absolute reference, such as $J$1. The dollar signs lock both its column and row when the formula is copied. In an Excel table, =[@Quantity]*[@UnitPrice] identifies fields by name and fills the calculated column automatically. Keep inputs in their own columns so a revised quantity can update the result.

In SQL, the expression and its label belong in SELECT:

SELECT order_id, quantity * unit_price AS revenue
FROM orders
WHERE quantity * unit_price > 50;

The alias names an output column; it does not add a stored column. The same query's WHERE is processed before that output alias exists, so repeat the expression there.

Keep the denominator attached to the metric

An order contains three games, each priced at 40 with a unit cost of 28. Revenue is 120, total cost is 84, and profit is 36. Two useful ratios describe different comparisons:

MetricCalculationResult
Profit marginProfit divided by revenue30%
MarkupProfit divided by costAbout 42.9%

Both use the same profit. Switching the denominator changes what the result means; label the calculated field with the ratio you actually used.

Create grouping labels from dates and text

Spreadsheets use YEAR(B2) and MONTH(B2) for date parts, or TEXT(B2, "yyyy-mm") for a label such as “2026-03”. WEEKDAY(B2) provides a day-of-week number. In PostgreSQL and MySQL, EXTRACT(MONTH FROM order_date) returns the month number; date functions differ across databases. Grouping by month number alone mixes March in different years, so keep the year too.

Text formulas can build a combined key. Joining store “S04” and month “2026-03” with a hyphen produces “S04-2026-03”. Spreadsheets can use & or CONCATENATE; many SQL dialects offer CONCAT, and several support ||. Use the same construction in both tables you will match.

Preserve decimals until the final display

PostgreSQL, SQL Server, and SQLite can discard the fractional part when both division inputs are integers. 45 / 60 can therefore give 0. Use 45 * 1.0 / 60, or convert to a decimal type, to obtain 0.75. Spreadsheet =45/60 keeps the fraction.

Round only reported results. Three exact thirds sum to 1; rounding each to 0.33 first produces 0.99. Number formatting can shorten the display while retaining the underlying precision. A formula such as ROUND(value, 2) rounds to two decimal places; use it on a final output when the rounded value itself is needed. Check one calculated row by hand before using the column in a summary.

Key Takeaways

  • Calculated fields work on individual records before aggregation.
  • Relative references move when filled; absolute references stay fixed.
  • Profit margin uses revenue as its denominator; markup uses cost.
  • Keep year with month when dates span more than one year.
  • Use decimal division in SQL and round final outputs only.

2.2 Classify rows with conditions and divide safely

Rules can turn numeric fields into groups you can count or compare. A conditional calculated field assigns a label by testing each row. A flag records whether a row meets one condition, often as 1 or 0.

Make boundaries complete

Classify revenue as Large at 100 or more, Medium at 50 or more but below 100, and Small below 50. In a spreadsheet, with revenue in G:

=IF(G2>=100, "Large", IF(G2>=50, "Medium", "Small"))

IFS offers another form:

=IFS(G2>=100, "Large", G2>=50, "Medium", TRUE, "Small")

The SQL expression follows the same order:

CASE
  WHEN quantity * unit_price >= 100 THEN 'Large'
  WHEN quantity * unit_price >= 50 THEN 'Medium'
  ELSE 'Small'
END AS order_size

These tests use the first true condition. If the test for 50 comes first, revenue of 120 becomes Medium and never reaches the Large branch. Test the most restrictive threshold first, or write nonoverlapping ranges.

For the March revenues, 120 is Large; 60, 50, 80, and 75 are Medium; the other five are Small. The counts are 1, 4, and 5, totaling ten. A boundary test matters: revenue of exactly 50 is Medium. Rules using “below 50” and “above 50” would leave that value out.

Keep unknown values distinct

An unknown revenue needs an Unknown label, not a size inferred from missing information. In SQL, a comparison with NULL is not true, so a final ELSE 'Small' would otherwise collect missing revenue too. Add a first branch that checks missing inputs, such as WHEN quantity IS NULL OR unit_price IS NULL THEN 'Unknown'.

Include a fallback deliberately. A SQL CASE without ELSE returns NULL when nothing matches. Omitting the false result of IF produces FALSE in Excel and a blank default in Google Sheets. An explicit final result makes the classification easier to inspect.

Use flags to count a condition

For each order, CASE WHEN status = 'Returned' THEN 1 ELSE 0 END creates a return flag. Five flags of 1, 0, 0, 1, and 0 sum to 2 returned orders. Their mean is 0.4, or 40%. This works because every included row contributes either one event or no event; define any treatment of unknown status before assigning the values.

Protect a ratio at its denominator

Orders divided by visits is undefined on a day with zero visits. With orders in B and visits in C, =IF(C2=0, "", B2/C2) leaves the result blank for that case. In SQL, use orders * 1.0 / NULLIF(visits, 0). NULLIF turns a zero denominator into NULL, giving a missing result instead of a divide-by-zero error.

A blank or NULL here means an unavailable ratio, not a measured rate of zero. Broad IFERROR handling can also hide a misspelled formula or a broken reference. Test the expected problem directly, then inspect boundary rows, unknowns, and the category counts.

Key Takeaways

  • IF and CASE use the first true condition.
  • Include each boundary value in exactly one category.
  • Handle unknown inputs before assigning ordinary category labels.
  • Averaging a 0/1 flag gives the share of included rows meeting its condition.
  • Guard zero denominators explicitly and keep unavailable rates distinct from zero.
3

Combine data from several tables

Orders, products, and customers often live in separate tables. Bringing them together requires a clear key and an understanding of how many matches each row can have. You will check those relationships, retrieve values with spreadsheet lookups, and follow inner and left joins. The central check is whether the combined table still represents the records you intended to analyze, with each amount counted the right number of times.

3.1 Identify keys and relationships between tables

Related tables need a reliable way to identify the same entity. A customer name is useful for display but can belong to two people or appear in different forms. An identifier such as customer_id makes the match explicit.

Identify the one side and the many side

A primary key uniquely identifies rows in its own table. A foreign key in another table refers to that identifier. In a customers table, each customer id appears once. In an orders table, the same customer id can appear on many orders.

RelationshipMeaningExample
One-to-oneAt most one match on either sideA row and its single supplementary record
One-to-manyOne row can match several on the other sideCustomer to orders
Many-to-manySeveral rows can match several othersOrders and products, connected by order lines

Repeated customer ids are expected in orders; they are a problem in a reference table meant to contain one row per customer. Check uniqueness where the relationship requires it:

SELECT COUNT(*) AS rows,
       COUNT(DISTINCT customer_id) AS different_ids
FROM customers;

If the table has 1,200 rows but 1,195 different ids, investigate duplicate or missing identifiers. Equality of these counts is useful only alongside a missing-key check, because distinct counts skip NULL. In a spreadsheet with filled keys, compare COUNTA(A2:A1201) with COUNTA(UNIQUE(A2:A1201)).

Match the full key

A targets table with one record per store per month needs both store and month. This composite key distinguishes “S04” in March from “S04” in April. Match both fields, or construct “S04-2026-03” in both tables using the same rules. A store id alone would leave several possible targets.

Standardize keys before combining. In spreadsheet lookups, the number 1001 and text “1001” can fail to match; “C-001”, “C001”, and “C001 ” are also different representations. SQL may convert types or ignore some spaces depending on its settings. Clean formats, spaces, and types so your result does not rely on those differences.

Choose whether to add columns or rows

A lookup or join adds related fields by matching keys. Adding each customer's name to an orders table with a unique customer reference keeps one row per order. Starting from customers and attaching their orders can repeat customer details and change the grain.

Appending stacks records with the same structure, such as January sales below February sales. SQL UNION ALL retains every row; UNION also removes duplicate output rows. The selected columns need the same order and compatible types. If two legitimate sales records happen to have identical selected values, removing one changes the total.

Before combining, write what one row represents in each input and what you expect it to represent in the output. Then choose keys and a relationship that produce that result. This expectation gives you a concrete row-count check after the operation.

Key Takeaways

  • Primary keys identify rows uniquely; foreign keys refer to those identifiers.
  • Check uniqueness on the side expected to have one row per key.
  • A composite key needs every field that identifies the record.
  • Lookups and joins add matched fields; appending stacks records.
  • Predict the output grain before combining tables.
  • UNION removes duplicate output rows; UNION ALL preserves them.

3.2 Look up values from another table in a spreadsheet

A lookup brings a value from a reference table into a main table. For each sales row, a product code can retrieve the product's name or price. The match must return the value for that exact product.

Read the lookup inputs

Suppose the Products sheet has codes in A, names in B, and prices in C, with records in rows 2 through 50. The main sheet's product code is in B2:

=XLOOKUP(B2, Products!$A$2:$A$50, Products!$C$2:$C$50, "Not found")

The inputs are the value to find, the key range to search, the range to return from, and a result for a missing match. XLOOKUP uses exact matching by default in current Excel and Google Sheets. The two ranges must line up row by row. Absolute references keep them fixed when the formula fills down; B2 moves to B3 for the next sale.

The reference table contains P01 Notebook at 3.50, P02 Pen at 1.20, and P03 Folder at 2.80. For a sale of four P03 items, the lookup returns 2.80 and the calculated revenue is 11.20. P07 is absent, so the formula returns “Not found”.

Use exact VLOOKUP for identifiers

The equivalent older function is:

=VLOOKUP(B2, Products!$A$2:$C$50, 3, FALSE)

VLOOKUP searches the first column of the selected range. The 3 means its third column, and FALSE requests an exact match. Omitting the last input allows approximate matching, which can silently return the wrong product on an unsorted id column.

FunctionReturning a fieldExact-match setting
XLOOKUPSeparate return range can be on either sideDefault, or match mode 0
VLOOKUPColumn number within the range, to the right of its first columnFALSE

Inserting a column inside a VLOOKUP range can change what its fixed column number returns. Check the formula after structural edits.

Investigate missing and duplicate matches

#N/A usually signals no match. Check whether the reference really lacks the code, or whether spaces, text-versus-number types, or code formats differ. IFNA can replace this particular error with a visible label; IFERROR catches other errors too and can hide unrelated faults.

Count missing labels, for example =COUNTIF(H2:H500, "Not found"), and report what they affect. Do not replace unknown prices with zero simply to make a total calculate.

The default search returns the first exact match. Two P03 reference rows with different prices make the result ambiguous, even if the lookup shows no error. Verify key uniqueness before trusting the returned values.

Use approximate matching for ordered bands

A threshold table of 0 Small, 50 Medium, and 100 Large classifies 75 as Medium and 120 as Large. Here the intended rule is the largest threshold not above the input. XLOOKUP match mode −1 implements exact-or-next-smaller matching. VLOOKUP with TRUE can do the same when its threshold column is sorted ascending. This is useful for numeric bands, while product identifiers need exact matching.

Key Takeaways

  • XLOOKUP uses separate search and return ranges and defaults to exact matching.
  • Use FALSE in VLOOKUP for an exact identifier match.
  • Lock reference ranges before filling a lookup down.
  • Investigate missing matches and check that reference keys are unique.
  • Approximate matching is useful for defined bands with the correct threshold rule.

3.3 Combine tables with joins and check the result

A join combines table records whose keys match. Unlike a spreadsheet lookup's usual first-match result, a join returns every match. Predicting those matches is essential before counting rows or summing amounts.

Choose the records to retain

Consider customers C1 Ana, C2 Ben, C3 Chen, and C4 Dara. Orders are O1 for C1, O2 for C1, O3 for C2, and O4 for C5.

OperationResult
Orders inner join customersO1, O2, O3: three matched rows
Orders left join customersAll four orders; O4 has no customer name
Customers left join ordersC1 twice, C2 once, C3 once, C4 once: five rows

An inner join keeps matched records only. A left join keeps every left-table row, attaching the right-table fields when they exist and NULL when they do not. Choose the left table from the population your question must retain. To list every order, including orders with unknown customers, start with orders and left join customers.

A basic statement is:

SELECT o.order_id, c.name
FROM orders AS o
LEFT JOIN customers AS c
  ON o.customer_id = c.customer_id;

The aliases o and c show where each field comes from; ON identifies the matching columns. The result is a new view of the data, not a replacement for either input table.

Recognize repeated amounts

Suppose order 501 has an order total of 90 and three lines; order 502 has a total of 40 and one line. Attaching the lines produces four rows. Order 501's total appears on each of its three rows, so summing that field gives 310 instead of the original 130.

This repetition is fan-out. The join can be correct for studying lines while the sum is wrong for studying orders. Sum order totals in the orders table, or first summarize lines to one row per order before joining. A distinct sum is not a general repair: two different orders can have the same total and both need counting.

Count actual matches

After customers left join orders, a customer with no order still has a result row. COUNT(*) counts that row as one. COUNT(o.order_id) counts the non-NULL order ids and gives zero for the customer without orders.

To find unmatched customers, test order_id IS NULL in the joined result. Test the right table's key, not a field such as telephone number that can be missing even in a matched record. In the example, C3 and C4 have no orders; O4's C5 is instead an unmatched customer reference when starting from orders.

Check the relationship against the output

A plain left join produces at least as many rows as its left input. If every right key should be unique, the row count should stay the same. Extra rows show repeated right-side keys; fewer rows suggest an additional filter or a different operation. Compare key counts, unmatched rows, and a source total before and after. Equal totals alone cannot establish that each individual record was matched correctly.

Key Takeaways

  • An inner join keeps matches; a left join preserves every left record.
  • Each matching right row produces an output row, so joins can repeat amounts.
  • Summarize at the intended grain before adding totals.
  • After a left join, count a right-side id to count matches.
  • Use NULL in the right key to identify unmatched rows.
  • Check row counts and totals against the expected relationship.
4

Group and aggregate data

A summary turns a long list of records into a small table that answers a question. You will choose counts, totals, and averages, then calculate them for the whole table or for selected groups. Spreadsheet conditional functions, SQL grouping, and pivot tables offer different ways to build the same result. Missing values, table grain, and the choice of summary function determine what the final numbers actually mean.

4.1 Aggregate a column with count, sum, average, minimum and maximum

An aggregate function reduces many input values to one result. The right function depends on whether you need a total, a count, an average, or an extreme, and on what a row represents.

Choose the quantity to summarize

For the ten March revenues, the count is 10, sum 535, mean 53.5, minimum 15, and maximum 120. With revenue in G2:G11, spreadsheet functions are SUM, COUNT, AVERAGE, MIN, and MAX over that range. A SQL summary can calculate them together:

SELECT COUNT(*) AS orders,
       SUM(quantity * unit_price) AS revenue,
       AVG(quantity * unit_price * 1.0) AS mean_revenue,
       MIN(quantity * unit_price) AS smallest_revenue,
       MAX(quantity * unit_price) AS largest_revenue
FROM orders;

The decimal factor protects the average in databases such as SQL Server, where AVG of integer input returns an integer. Rounding a truncated result afterwards cannot restore the missing fraction.

Count rows, filled fields, and different values
NeedSpreadsheetSQL
Numeric cellsCOUNTDepends on the column's type and missing values
Nonempty cellsCOUNTACOUNT(column) for non-NULL values
Empty cellsCOUNTBLANKCount records meeting IS NULL
All recordsCount a fully filled id fieldCOUNT(*)
Different nonmissing idsUNIQUE plus a count over filled idsCOUNT(DISTINCT id)

Ten orders can come from five customers. Counting rows answers “How many orders?” at order grain; counting distinct customer ids answers “How many customers ordered?” In Google Sheets, COUNTUNIQUE is also available. Check blanks separately before counting a UNIQUE result, because a missing key can appear as a distinct entry.

Understand what missing values do

For SQL ratings 4, 5, NULL, 3, NULL, COUNT(*) is 5, COUNT(rating) is 3, the sum is 12, and AVG(rating) is 4. The average uses the three known values. Replacing unknown ratings with zero changes the denominator and produces 2.4, a different claim about the data.

Spreadsheet AVERAGE also skips blank cells and text in a referenced range, while including numeric zero. A text entry “10” beside numeric 20 can therefore produce an average of 20 instead of 15. Compare COUNT with COUNTA when a numeric column unexpectedly contains fewer counted values than filled cells. Then inspect its data types.

Respect the grain and the field's meaning

In an order-lines table, use distinct order ids for an order count. Average order value is total order revenue divided by the number of orders, not the number of lines. A running balance is already a total at a point in time; adding every running balance does not give the period's sales.

A summary can look reasonable while its denominator counts the wrong thing. Put the counted entity into the column label, such as “Orders”, “Order lines”, or “Known ratings”, so the result states what was included.

Key Takeaways

  • Choose an aggregate that matches the metric and table grain.
  • COUNT(*) counts SQL rows; COUNT(field) counts non-NULL field values.
  • COUNT(DISTINCT field) counts different non-NULL values.
  • Missing values and zeros have different effects on an average.
  • Inspect numeric columns for values stored as text.

4.2 Count and sum with conditions

Conditional functions build a summary without moving the original records. Each row contributes only when its values meet the criteria. A result table can then list regions, categories, or other groups in a layout you control.

Put the ranges in the right order

COUNTIFS takes pairs of criterion ranges and criteria. SUMIFS starts with the range to add, followed by those pairs. AVERAGEIFS follows the same pattern with an average range:

=COUNTIFS(C2:C11, "North", G2:G11, ">50")
=SUMIFS(G2:G11, C2:C11, "North", D2:D11, "Books")
=AVERAGEIFS(G2:G11, C2:C11, "North")

For the March table, these return 2 orders, 105 revenue, and mean revenue of 62.5. The first function counts the North revenues of 120 and 75. The second adds North Books revenues of 30 and 75. The third divides North's total 250 by its four orders.

All criterion pairs inside one COUNTIFS, SUMIFS, or AVERAGEIFS use AND: every condition must hold on the same row. Make each range begin and end on matching rows. Comparing one row's region with another row's revenue would not describe a record.

Write criteria precisely

Text and comparison criteria use straight double quotes: "North", ">50", or "<>Returned". A cell can supply the criterion directly, such as I2. To combine an operator with a cell's value, use ">"&H1. The wildcard "*book*" matches text containing “book”; these spreadsheet text criteria ignore capitalization.

The singular functions can use a different argument order. In SUMIF(criteria_range, criterion, sum_range), the sum range comes last. In SUMIFS, it comes first. Read the function name before editing or copying a formula.

Fill a group summary safely

Put North, South, and East in I2:I4. In J2 enter:

=SUMIFS($G$2:$G$11, $C$2:$C$11, I2)

Fill down. The data ranges stay fixed, while I2 becomes I3 and I4. The results are 250, 180, and 105. Compare their sum with the direct source total of 535. If new records extend beyond row 11, expand the ranges or use a growing table reference.

Avoid counting an OR overlap twice

North or Books includes six March orders. Separate counts give four North orders plus four Books orders, but two orders belong to both. Subtract the overlap once: four plus four minus two gives six. The overlap is the result of COUNTIFS with North and Books together. Simply adding the separate counts would report eight.

Express a conditional sum in SQL

A condition can sit inside an aggregate:

SUM(CASE WHEN region = 'North'
         THEN quantity * unit_price ELSE 0 END)

Each North record contributes revenue and every other record contributes zero. For a conditional count, contribute 1 for a match and 0 otherwise. This lets one query return several named conditional totals side by side. Check the labels actually present in the source, especially spaces, before treating a missing group total as zero activity.

Key Takeaways

  • SUMIFS puts the sum range first and combines criteria with AND.
  • Keep every criterion range aligned with the summarized range.
  • Lock source ranges while letting the group criterion move.
  • An OR count needs overlapping records counted once.
  • CASE inside SUM can create a conditional total or count in SQL.

4.3 Group rows and aggregate them in SQL

GROUP BY creates one result row for each observed combination of group values. Aggregate functions then summarize the records in each group. The output has a new grain, such as one row per region.

Build a grouped query
SELECT region, COUNT(*) AS orders,
       SUM(quantity * unit_price) AS revenue
FROM orders
GROUP BY region
ORDER BY revenue DESC;

For the March orders, the result is North with 4 orders and 250 revenue, South with 3 and 180, and East with 3 and 105. The group counts total ten and revenues total 535.

Selected fields must describe the group or summarize its records. A category column beside a regional total is ambiguous when a region contains several categories. Include category in GROUP BY if you want one row per region-category combination. The March table has eight observed combinations; South has no Toys record, so grouping does not create that combination.

Filter records before groups, or groups after totals
ClauseApplies toExample
WHEREIndividual input rowsKeep Games orders
HAVINGGroups after aggregationKeep regions with at least four orders

WHERE category = 'Games' leaves North revenue 120 from one order, South 120 from two, and East 40 from one. A different query with no category filter and HAVING COUNT(*) >= 4 keeps North only.

To total each region's Games orders and keep regional Games revenue above 100:

SELECT region, SUM(quantity * unit_price) AS revenue
FROM orders
WHERE category = 'Games'
GROUP BY region
HAVING SUM(quantity * unit_price) > 100
ORDER BY revenue DESC;

North and South remain, tied at 120. Moving the revenue condition into WHERE would test individual orders, changing the question.

Follow the logical processing order

The useful order for reasoning is FROM and joins, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, then the row limit. The database may execute a more efficient physical plan, but this logical order explains why a SELECT alias is available for sorting and generally unavailable in the same query's WHERE.

For a mean, use AVG(quantity * unit_price * 1.0) to retain decimal results where integer inputs would otherwise truncate them. Treat NULL group labels deliberately: they form a group of their own. Show it as Unknown or exclude it with an explicit record count.

Summarize at two levels when needed

Customer A places orders of 60 and 40, B one of 50, and C three of 10. Total revenue is 180 across six orders, giving 30 per order. To find the average per customer, first sum by customer: A 100, B 50, C 30. Average those three totals to get 60. A saved intermediate table or a WITH clause can hold the first summary.

Inspect distinct group values before running the query. Text variants can split or combine groups differently across database settings; clean them and compare the observed groups with the groups your question expects.

Key Takeaways

  • GROUP BY changes the result grain to one row per group combination.
  • Select grouping fields or aggregate expressions in a grouped query.
  • WHERE filters records; HAVING filters completed groups.
  • Use the logical query order to reason about aliases and aggregates.
  • An average per customer may need customer totals before the final average.
  • Inspect missing and inconsistent group labels.

4.4 Summarize data with a pivot table

A pivot table builds a grouped spreadsheet summary by placing fields in a few areas. It is useful when you want to rearrange comparisons and inspect totals without writing a separate formula for each group.

Start with a complete source

Use one header row, one record per row, and a clear rectangular range. Remove source subtotal and total rows: a pivot treats them as records and counts their amounts again. Avoid merged cells and blank separators inside the source.

Select the range, then choose Insert > PivotTable in Excel or Insert > Pivot table in Google Sheets. Place fields according to the question:

AreaPurposeMarch revenue question
RowsGroups down the sideRegion
ColumnsOptional groups across the topCategory
ValuesField and summary functionSum of revenue
FiltersRestrict included recordsAnalysis period

With region in Rows and Sum of revenue in Values, the March result is North 250, South 180, East 105, and grand total 535. Sorting the summarized values shows the ranking.

Check the summary function

A numeric field can summarize by Sum, Average, Min, or Max. Do not assume the selected function matches your question. Excel may choose Count when the field has text or blanks, so an apparent revenue summary can actually show how many filled cells it contains.

To count orders, use a fully filled order-id field. Excel's Count counts nonempty cells; Google Sheets offers COUNTA for nonempty cells and COUNT for numeric cells. Counting a price field with blanks would miss records whose prices are unknown.

Read a two-dimension summary

Add category to Columns. North has Books 105, Games 120, and Toys 25; South has Books 60 and Games 120; East has Books 15, Games 40, and Toys 50. Column totals are Books 180, Games 280, and Toys 75.

The empty South–Toys cell means no source records occupy that combination. A recorded order with revenue zero would be a different case, even if a display setting makes both cells look empty or zero.

Understand an average grand total

Choose Average of revenue instead. North is 62.5 from four orders, South 60 from three, and East 35 from three. The grand total is 53.5 because the pivot averages all ten source records. Averaging the three displayed means gives 52.5 and incorrectly gives the four-order group the same weight as each three-order group.

Check updates and source coverage

After source changes, verify the pivot is current. In Excel, use Refresh when automatic refresh is unavailable or off; supported versions also offer Auto Refresh for local workbook data. Google Sheets updates pivot results when cells in the source range change. In either tool, records added outside a fixed source range can still be omitted. An Excel table source grows with added rows, while a fixed range needs inspection and expansion.

Compare the pivot grand total and order count with direct source calculations. A refresh updates the selected source; it cannot fix a range that excludes new records.

Key Takeaways

  • Place groups in Rows or Columns and the metric plus function in Values.
  • Keep source totals out of the records summarized by the pivot.
  • Count a filled identifier when counting records.
  • An average grand total uses source records and their group sizes.
  • Verify both refresh behavior and source-range coverage.
5

Calculate and interpret summary statistics

Two groups can have the same average and very different data. Counts and measures of spread help you see that difference, while percentages and rates let you compare groups with different sizes. You will choose a useful measure of center, investigate unusual values, and calculate comparisons with a clearly named denominator. Combining group summaries also requires the right weights, especially when their sizes differ.

5.1 Describe the center and spread of a numeric column

A numeric column needs more than one average to describe it well. Center tells you where values sit; spread tells you how different they are. The count shows how much data the summary represents.

Calculate a small set of measures

Eight bike trips lasted 6, 8, 9, 10, 12, 12, 15, and 58 minutes. Their total is 130 minutes.

MeasureMeaningTrip result
MeanSum divided by count16.25 minutes
MedianMiddle sorted value, or mean of two middle values11 minutes
ModeMost frequent value12 minutes
Minimum and maximumSmallest and largest6 and 58 minutes
RangeMaximum minus minimum52 minutes

For the median, the fourth and fifth values are 10 and 12, giving 11. Spreadsheet functions include AVERAGE, MEDIAN, MODE or Excel's MODE.SNGL, MIN, and MAX. In SQL, AVG, COUNT, MIN, and MAX are common; median and standard-deviation function names and syntax vary by database.

Choose a useful center

The 58-minute trip is an outlier, far from the others. It pulls the mean upward: seven of the eight trips are shorter than the mean. The median better describes the middle of these trips.

Without 58, the total is 72 across seven trips, so the mean is about 10.29 minutes and the median is 10. This shows the effect of the long trip; it does not justify deleting it. Check whether the ride was real, recorded incorrectly, or affected by a return problem. Keep, correct, or exclude it according to that evidence and record the decision.

The mean is useful for roughly symmetric data and questions connected to totals, because multiplying the mean by its count recovers the sum. The median is useful for skewed durations, incomes, or prices. A large mean–median gap is a reason to inspect the distribution, not a complete description of its shape.

A mode can describe categories, such as the most frequent payment method. More than one category can tie: Books and Games each occur four times in the March orders. Numeric data with few repeats may have no useful mode.

Describe variation

The sets 48, 50, 52 and 30, 50, 70 both have mean 50. Their sample standard deviations are 2 and 20. Standard deviation describes spread around the mean in the original units; a larger value means more spread. It is based on squared distances, so it is not the ordinary average of absolute distances.

Use STDEV.S when treating the records as a sample and STDEV.P for the entire population of interest. Their calculations divide squared deviations by the count minus one and the count, respectively, before taking the square root. Here the purpose is to interpret the measure, not calculate it by hand.

Quartiles divide sorted data into quarters. The median is the second quartile; the interquartile range is the third quartile minus the first and measures the middle half's spread. A percentile locates a chosen percentage in the distribution. Tools can use different interpolation methods, including QUARTILE.INC and QUARTILE.EXC, so use a consistent method when comparing results.

Report counts alongside the center and spread. One unusual trip affects a three-trip mean much more than a 300-trip mean.

Key Takeaways

  • Report count, center, and spread together.
  • The median is less sensitive to extreme values than the mean.
  • Investigate an outlier before deciding to remove it.
  • Standard deviation describes spread around the mean in the original units.
  • Use the sample or population standard deviation for the population you mean to describe.
  • IQR measures the spread of the middle half; quartile methods can differ.
  • A mode can describe categories and may have ties.

5.2 Calculate percentages, rates and weighted averages

Percentages and rates make comparisons readable only when their denominators are clear. A share, a change, and a rate answer different questions. Combining them across groups requires the size of each group's base.

Separate shares, changes, and percentage points

A share is a part divided by the relevant total. North's share of March revenue is 250 divided by 535, about 46.7%. South is about 33.6% and East 19.6%. The rounded values total 99.9%; the unrounded shares total 100%.

Percent change compares a new value with its old value:

percent change=new−oldold×100%

Revenue rising from 80 to 100 increases by 25%. Falling from 100 to 80 decreases by 20%. The absolute difference is 20 in either direction, but the old value changes. A zero old value makes this percent-change formula undefined.

A percentage-point change subtracts percentages directly. A conversion rate moving from 4% to 5% rises by 1 percentage point. Its relative increase is 25%, because the increase of 1 is a quarter of the original 4. Name the kind of change in the report.

Compare events against the same base

Store A has 18 complaints from 12,000 orders; Store B has 9 from 4,500. Per 1,000 orders, the rates are 1.5 and 2.0. B has fewer complaints but a higher rate. A fair comparison needs the same event definition, period, denominator, and scale.

Do not let a large raw count stand in for a high rate. A busier store can have more complaints simply because it handles more orders. Report the counts too, so readers can see the bases behind the rates.

Weight averages by the records they represent

Region X has 200 orders averaging 50; Y has 50 orders averaging 90. Recover each region's total: 10,000 and 4,500. Divide the combined 14,500 by 250 orders to get 58. The simple average of the two means, 70, incorrectly gives the two regions equal weight.

weighted mean=∑(group count×group mean)∑group count

The weights must count the observations used in those means. If a group average excludes missing ratings, use its known-rating count, not every record in that group.

Pool rates from totals

Page A converts 100 of 5,000 visits; B converts 10 of 100. The rates are 2% and 10%, but the overall rate is 110 conversions divided by 5,100 visits, about 2.2%. Averaging the two percentages gives 6% and overweights the smaller page.

A whole-table ratio follows the same logic. Orders with profit 50 on revenue 100 and profit 100 on revenue 1,000 have an overall margin of 150 divided by 1,100, about 13.6%. Their individual margins average to 30%, which answers a different question. In SQL, use SUM(profit) * 1.0 / NULLIF(SUM(revenue), 0); in a spreadsheet, divide the profit total by the revenue total after checking the denominator.

Label the denominator, such as “share of March revenue” or “complaints per 1,000 orders”. A percentage without that base can describe a different population from the one a reader assumes.

Key Takeaways

  • A share divides a part by its named total.
  • Percent change uses the old value as its base.
  • Percentage points measure the direct difference between percentages.
  • Compare rates using consistent definitions and denominator scales.
  • Weight group means by the counts used to calculate them.
  • Combine rates and whole-table ratios from numerator and denominator totals.
6

Check results and state the answer

A plausible number can still come from a broken range, a repeated join row, or the wrong denominator. You will build checks into the analysis, compare independent calculations, and account for missing records. Then you will turn the checked summary into a direct answer with its period, metric, group sizes, and limits. Subgroup comparisons help you avoid conclusions that an overall total alone would encourage.

6.1 Check results before sharing them

Build checks into the analysis before sharing its results. A formula can return a believable number even when its range misses rows or a join repeats amounts. Each operation needs an expectation you can compare with its output.

Reconcile totals and counts

For the March orders, regional revenues 250, 180, and 105 sum to 535. Their order counts 4, 3, and 3 sum to ten. Compare both with the source filtered to the same period and definition.

A mismatch can reveal lost records, repeated records, or groups that overlap. A match is useful evidence but is not enough on its own: sorting only one column can corrupt row relationships while leaving every total unchanged. Also, a positive and a negative error can cancel.

Write an expected count before filtering or joining. Four North orders should remain after the March table is filtered to North. A left join from ten orders to a reference with one customer row per id should return ten rows. Twelve rows indicate repeated right-side keys. A left join from customers to orders can legitimately increase the count because one customer has many orders.

Inspect individual records

Choose a few records and recalculate them directly. Order 1003 has three units at 40, producing revenue 120. North's four revenues are 30, 120, 25, and 75, giving 250. Check a lookup against the reference table by eye, including one missing code and one boundary case for a numeric band.

A spot-check should test the operation that could fail. For a filled formula, inspect early and late rows; for a classification, inspect each boundary; for a join, inspect repeated and unmatched keys. Checking only convenient ordinary rows can leave the fault untouched.

Compare independent routes

Calculate the regional summary with SUMIFS, a pivot table, or a SQL query and compare the results. Use the same metric and filter, but independently select the ranges or records. Two outputs built from the same incomplete intermediate table can agree while both omit the same orders.

If they disagree, compare period boundaries, source ranges, data types, missing values, and grain before changing the answer. Save the calculation or query that resolves the difference.

Account for missing values and plausibility

Count blank or NULL inputs, “Not found” lookup results, and joined records whose right-side key is NULL. Explain how these records affect the reported metric. A matched row can have another missing right-side field, so a blank name alone is not a reliable unmatched-row test.

Check the magnitude and units of the result. A share of a nonnegative whole is between 0% and 100%; a percent change can exceed 100% or be negative. From 50 to 150 is an increase of 200%. Investigate unexpected negative quantities and dates outside the analysis period, using the field's definition to decide what is valid.

Keep the question, metric definition, filters, formulas or queries, source period, and decisions together. This record lets someone repeat the work and explains such choices as excluding an invalid trip or keeping an unknown-region group.

Key Takeaways

  • Reconcile group totals and counts with the same filtered source.
  • Predict row-count changes from the operation and relationship.
  • Spot-check formulas, matches, and classification boundaries.
  • Cross-check with an independently built method.
  • Count missing and unmatched records and document their treatment.

6.2 Interpret and report what the summary shows

A report should answer the question in numbers that a reader can place in context. State the metric, period, group, and comparison directly, then add the information that changes how the result should be interpreted.

State the answer and comparison

“In March 2026, North had the highest revenue: 250 from four orders, or about 46.7% of the total 535. South followed at 180 and East at 105.” This statement gives the ranking and the scale of the result.

North's revenue exceeds South's by 70. Relative to South, the gap is about 39%. The comparison base matters: a percentage using North as the denominator would answer how far South falls below North, a different question. Use consistent decimal places and round final figures only; 46.7% is more useful here than many displayed decimal places.

Describe associations without inventing causes

Suppose discount users spend more per order. They may spend more because of the discount, or people planning large purchases may seek discounts. A summary of these records establishes the observed difference, not which explanation caused it. Write “average order value was higher among discount users” and identify what further evidence would be needed to explain why.

Inspect the mix behind an overall rate

An overall comparison can reverse the comparison within subgroups. Consider two teams receiving different mixes of warm and cold leads:

TeamWarm leads convertedCold leads convertedOverall
A90 of 100: 90%10 of 100: 10%100 of 200: 50%
B255 of 300: 85%5 of 100: 5%260 of 400: 65%

A has the higher conversion rate for both lead types. B has the higher overall rate because three quarters of its leads are warm, compared with half of A's. Warm leads convert much more often for both teams. This reversal is called Simpson's paradox. The aggregate describes each team's actual mix; it does not isolate performance for a shared lead mix.

Break results down by a relevant subgroup before crediting a team or policy for the overall difference. Calculate each rate from its own numerator and denominator, then inspect how much each subgroup contributes to the total.

Show the information behind the summary

Give the group sizes with averages and rates. An unusual order can move a three-order mean much more than a 300-order mean. A small observed difference is not enough to establish a stable difference in the wider population.

State limitations that affect the answer: the time period, exclusions, missing or unmatched rows, and the metric's definition. For example, “Excludes 12 orders without a region, representing 2% of revenue.” Report that consequence, not merely that some data were missing.

Choose a small sorted table or a key figure when it carries the answer clearly. It can become the input for a later chart or dashboard, with the same definitions and checks preserved.

Key Takeaways

  • Answer with the metric, period, group, comparison, and group sizes.
  • Name the comparison base for a relative difference.
  • An observed association does not establish its cause.
  • Inspect relevant subgroups because different mixes can reverse an overall comparison.
  • State exclusions, missing data, and metric choices that affect interpretation.
  • Use consistent precision and round only reported values.

Analyzing and Summarizing Data examples

6 Walkthroughs

1

From a question to the right rows

11 steps
Plan a regional revenue comparison, then sort and filter the records without losing their meaning.
  1. 1
    IntroductionStart with an answerable question

    “Which region had the highest revenue in March 2026?” needs a regional summary of March orders. Before calculating, decide what revenue includes (the metric) and what one row represents (the grain). Those choices determine which records to keep, which field to create, and whether a row count measures orders or order lines, so your totals mean what you say they mean.

  2. 2
    ExplanationName the four decisions

    The metric is summed revenue, calculated from quantity times unit price. The dimension is region. The filter keeps March dates, and the comparison ranks regional totals.

    Write these decisions together. If one method includes cancellations and another excludes them, their totals can disagree even when both calculations run correctly.

  3. 3
    ExampleCheck the grain before counting

    In the March example, one row represents one order, so ten rows represent ten orders. An order-lines table would need a different count because an order containing several products can occupy several rows.

    For the revenue question, the planned sequence is filter dates, calculate revenue, group by region, sum, rank, and check.

  4. 4
    ChallengeCount the entity the question names

    A service table records one row per task performed during a visit. Visit V8 has three tasks and V9 has two. How many visits do those five rows represent, and what field would identify the count?

    ---reveal---

    There are two visits. Count distinct visit ids, because the five rows represent tasks. A simple row count would measure work items instead of visits.

  5. 5
    ExplanationMove whole records together

    To sort in a spreadsheet, select the complete record range and identify its header row. Moving only the revenue cells can attach correct amounts to the wrong orders.

    A total may stay unchanged after that mistake, so check an id and its associated fields after sorting. In SQL, ORDER BY sorts the output and leaves the stored records in place.

  6. 6
    ExampleSort within each region

    Four records show East 15, North 30, East 50, and North 120. Sorting region ascending and revenue descending gives East 50, East 15, North 120, North 30.

    The first field forms the regional blocks; the second orders the amounts inside each block. Use ORDER BY region ASC, revenue DESC for that SQL result.

  7. 7
    ChallengeExplain a surprising ranking

    A revenue column sorts ascending as “12”, “120”, “8”. What should you investigate before reporting the smallest amount?

    ---reveal---

    The amounts may be stored as text and sorted character by character. Convert them to real numeric values during cleaning, then sort again. Reversing the sort would reverse the wrong kind of order rather than repair it.

  8. 8
    ExplanationMake mixed conditions explicit

    SQL checks AND before OR. A condition for Books or Toys in East needs parentheses around the category alternatives: (category = 'Books' OR category = 'Toys') AND region = 'East'.

    Without those parentheses, Books from every region could enter the result. In the March example, the grouped condition gives two rows instead of five.

  9. 9
    TipInclude the whole final day

    A date-time value later on March 31 exceeds the midnight boundary written as '2026-03-31'. Select March with order_date >= '2026-03-01' AND order_date < '2026-04-01'.

    The next-month boundary includes the final day without guessing its last timestamp. Use IS NULL separately when a missing date or field needs attention.

  10. 10
    ChallengePlan, filter, and check one result

    You need the three highest-revenue North orders in March. What order of operations gives the requested records, and how would you total only visible filtered spreadsheet rows?

    ---reveal---

    Select March and North, calculate revenue, sort it descending, then take three rows, using an id to resolve a tied cutoff if needed. Use SUBTOTAL(9, range) for a visible filtered sum; SUM over the original range still includes hidden rows.

  11. 11
    RecapKeep the population and order clear

    Define the metric and grain before selecting records. Filter to the intended population, then sort complete records with real numeric or date types. Check mixed conditions, timestamp endpoints, and tie rules. Save the filter and count with the result so the next calculation uses the same population.

2

Build reliable calculated columns

10 steps
Create revenue and category fields, test their boundaries, and keep ratios meaningful.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionAdd information to each record
  2. 2
    ExplanationFill formulas without moving fixed inputs
  3. 3
    ExampleKeep margin and markup separate
  4. 4
    TipRetain dates and decimals correctly
  5. 5
    ChallengeRepair a formula that drifts
  6. 6
    ExplanationLet the most restrictive test run first
  7. 7
    ChallengeKeep an unknown out of a size band
  8. 8
    ExampleInterpret a flag and an unavailable rate
  9. 9
    ChallengeCombine a calculated amount and a rule
  10. 10
    RecapTest references, boundaries, and bases
3

Combine tables without repeating totals

12 steps
Trace keys, lookup matches, and join rows before using combined data in a summary.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionPredict what the combined table contains
  2. 2
    ExplanationFind the one and many sides
  3. 3
    ExampleMatch a store and its period
  4. 4
    ChallengeChoose rows or matched fields
  5. 5
    ExplanationRead an exact lookup
  6. 6
    ExampleRetrieve a price, then calculate
  7. 7
    ChallengeDiagnose a silent lookup choice
  8. 8
    ExampleTrace inner and left matches
  9. 9
    Key InsightA retained row can mean no order
  10. 10
    ExampleSee why a total repeats
  11. 11
    ChallengeChoose a combination and its checks
  12. 12
    RecapCheck matching before measuring
4

Build and verify grouped summaries

15 steps
Use counts, conditional formulas, SQL grouping, and pivot tables to answer one analysis question.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionReduce records to the right summary
  2. 2
    ExplanationChoose what your count measures
  3. 3
    ExampleKeep unknown ratings out of the mean
  4. 4
    ChallengeCount orders at line grain
  5. 5
    ExplanationAlign conditional ranges
  6. 6
    ExampleFill a summary from group labels
  7. 7
    ChallengeRemove the overlap in an OR count
  8. 8
    ExplanationGive each group its own result
  9. 9
    ExampleFilter records, then filter totals
  10. 10
    ChallengeChoose the two levels of aggregation
  11. 11
    ExplanationMap the question into a pivot
  12. 12
    Key InsightAn average total uses the source records
  13. 13
    ChallengeInvestigate an unchanged pivot
  14. 14
    ChallengeChoose a summary that answers the question
  15. 15
    RecapMatch every aggregate to its base
5

Choose fair statistics and comparisons

16 steps
Describe a numeric column and combine shares, rates, and group averages with the right denominator.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionDecide what the summary should describe
  2. 2
    ExampleCalculate the mean trip time
  3. 3
    ExampleFind the two middle positions
  4. 4
    ExplanationIdentify the most frequent value
  5. 5
    ExampleMeasure the full observed span
  6. 6
    Key InsightSee the influence of one long trip
  7. 7
    ExplanationCompare spread around the same mean
  8. 8
    ExplanationFocus on the middle half
  9. 9
    ChallengeChoose and defend a center
  10. 10
    ExplanationName the kind of percentage
  11. 11
    ExampleUse a common rate scale
  12. 12
    ChallengeDistinguish points from relative growth
  13. 13
    ExampleRecover totals from group means
  14. 14
    ExampleCombine the underlying counts
  15. 15
    ChallengeUse the observations behind the means
  16. 16
    RecapChoose a base before calculating
6

Check the answer and report its meaning

10 steps
Reconcile records, investigate disagreements, and interpret overall and subgroup results.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionTreat checks as part of the analysis
  2. 2
    ExampleReconcile two kinds of totals
  3. 3
    TipPredict the count before the operation
  4. 4
    ChallengeInvestigate two agreeing totals
  5. 5
    ExplanationGive a direct, interpretable answer
  6. 6
    ChallengeDescribe a difference without assigning a cause
  7. 7
    ExampleInspect the subgroup rates
  8. 8
    Key InsightExplain the reversal through the mix
  9. 9
    ChallengeDecide whether a report is ready
  10. 10
    RecapKeep the checks with the conclusion

Analyzing and Summarizing Data practice questions

50 Practice Questions in 5 sets

Set 1: Practice 1: Choose the right operation10 Practice Questions

Question 1 of 10

A delivery table has one row per parcel. A shipment can contain several parcels. What does COUNT(*) measure?
  1. Number of shipments
  2. Number of parcels
  3. Number of customers
  4. Number of delivery days
Show answerHide answer
Answer: B
Each row represents a parcel, so counting rows gives the parcel count. A shipment can occupy several rows and needs its own identifier to be counted separately. Treating the row count as shipments would count a multi-parcel shipment more than once.

Question 2 of 10

A numeric duration field needs the longest jobs first. What SQL ordering gives that result?
  1. ORDER BY duration ASC
  2. ORDER BY job_id DESC
  3. ORDER BY job_id ASC
  4. ORDER BY duration DESC
Show answerHide answer
Answer: D
Descending duration puts larger durations before smaller ones, which is the requested ranking. Ascending duration would put the shortest jobs first. Sorting by the job identifier orders labels instead of the measured duration, even if the ids happen to reflect entry order.

Question 3 of 10

A row records 6 units priced at 14 each. What is its revenue?
  1. 84
  2. 20
  3. 70
  4. 98
Show answerHide answer
Answer: A
Revenue multiplies the number of units by the price of one unit, so six units at 14 produce 84. Adding quantity to price gives 20, but those inputs describe different kinds of quantities and cannot be added to obtain revenue. The calculation produces an amount for this row before any grouping.

Question 4 of 10

A customer reference is intended to have one row per customer. What property must its customer_id have?
  1. It increases with every order date.
  2. It matches the customer’s full name.
  3. It identifies each customer uniquely.
  4. It repeats for each product purchased.
Show answerHide answer
Answer: C
The customer id must identify one customer record without ambiguity. Repetition is expected in an orders table when a customer orders again, but not as a second row for the same id in this reference. A name is a display field and can be shared by different customers.

Question 5 of 10

What fourth argument makes VLOOKUP search for an exact product identifier?
  1. TRUE
  2. FALSE
  3. 1
  4. -1
Show answerHide answer
Answer: B
FALSE requests an exact match in VLOOKUP, which is the appropriate rule for a product identifier. TRUE enables approximate matching and needs a suitable ordered reference. A nearby identifier is a different product, so a plausible returned value is not enough to establish the right match.

Question 6 of 10

A pivot is intended to count service visits, but its Count of optional satisfaction score is 27 while all 32 visit ids are filled. What change makes it count visits reliably?
  1. Count the visit-id field.
  2. Sum the satisfaction scores.
  3. Average the score field.
  4. Count the blank score cells.
Show answerHide answer
Answer: A
Counting the filled visit-id field measures all 32 visits, while counting an optional score measures only the 27 nonempty scores. The five missing scores explain the smaller count without establishing that five visits are absent. Summing or averaging scores would answer a different question about the ratings.

Question 7 of 10

A rate rises from 8% to 10%. How much is the increase in percentage points and in relative percent?
  1. 2 percentage points; 20%
  2. 25 percentage points; 2%
  3. 20 percentage points; 2%
  4. 2 percentage points; 25%
Show answerHide answer
Answer: D
Subtracting the two rates gives two percentage points. Relative growth divides that increase by the old rate of eight, giving 25%. Using the new rate of ten as the denominator produces 20%, but percent change is measured against the starting value, not the ending one.

Question 8 of 10

Repair times are 4, 5, 6, 7, and 43 minutes. What median and range describe these records?
  1. 6 minutes; 43 minutes
  2. 13 minutes; 39 minutes
  3. 6 minutes; 39 minutes
  4. 13 minutes; 43 minutes
Show answerHide answer
Answer: C
The sorted middle value is six minutes, and subtracting the minimum four from the maximum 43 gives a range of 39 minutes. Thirteen is the mean, pulled upward by the long repair. Using the maximum as the range would ignore the starting point of the observed values.

Question 9 of 10

Site A records 24 purchases from 400 visits and Site B records 18 from 100 visits. A report gives the combined rate as 12%. What rate should replace it, and what caused the error?
  1. 8.4%; the site rates were equally weighted.
  2. 10.5%; the site rates were equally weighted.
  3. 8.4%; missing visits were counted as purchases.
  4. 12.0%; the purchase counts should be averaged.
Show answerHide answer
Answer: A
The sites total 42 purchases from 500 visits, giving 8.4%. The reported 12% averages the separate 6% and 18% rates and gives the smaller site equal influence. The combined visit base weights the sites according to the opportunities for a purchase; no missing visits are stated.

Question 10 of 10

A left join adds one customer record to each of 80 orders. The reference is supposed to be unique by customer id, but the result has 86 rows. What should be investigated first?
  1. Missing customer ids in the orders table
  2. A descending sort on the result table
  3. Repeated customer ids in the reference
  4. A revenue column with six blank values
Show answerHide answer
Answer: C
With at most one right-side match per order, the left join should retain 80 rows. Extra rows show that some order keys found multiple reference matches. Missing matches retain a row with NULL right-side fields; they do not explain the six additional output rows in this join.
Set 2: Practice 2: Apply definitions and boundaries10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

What SQL condition keeps only East records whose category is Tools or Parts?
  1. region = 'East' AND category = 'Tools' OR category = 'Parts'
  2. region = 'East' OR category IN ('Tools', 'Parts')
  3. region = 'East' AND category IN ('Tools', 'Parts')
  4. region = 'East' AND category = 'Tools' AND category = 'Parts'
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Three daily rows have purchases and visits of (0, 0), (2, 10), and (6, 20). Daily rates use decimal division and NULLIF to guard zero visits. What does AVG of those daily rates return, and does it equal the combined purchase rate?
  1. 25%; no, the combined rate is about 26.7%.
  2. 16.7%; no, the combined rate is about 26.7%.
  3. 25%; yes, the combined rate is also 25%.
  4. 26.7%; yes, the combined rate is also 26.7%.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Customers are K1, K2, and K3. Orders are R1 for K1, R2 for K1, and R3 for K4. After customers left join orders and grouping by customer, what are K3’s COUNT(*) and COUNT(order_id)?
  1. 0 and 0
  2. 0 and 1
  3. 1 and 1
  4. 1 and 0
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

What SQL clause keeps only groups whose total revenue exceeds 900?
  1. WHERE SUM(revenue) > 900
  2. HAVING SUM(revenue) > 900
  3. WHERE revenue > 900
  4. ORDER BY SUM(revenue) > 900
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

You need total energy use by building in a pivot table. What belongs in Values?
  1. Energy use summarized by Count
  2. Building summarized by Count
  3. Energy use summarized by Average
  4. Energy use summarized by Sum
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

Regions are in C2:C20 and amounts in F2:F20. What formula totals North amounts greater than 60?
  1. =SUMIFS(C2:C20, F2:F20, "North", F2:F20, ">60")
  2. =SUMIFS(F2:F20, C2:C20, "North", F2:F20, ">=60")
  3. =SUMIFS(F2:F20, C2:C20, "North", F2:F20, ">60")
  4. =SUMIFS(F2:F20, C2:C20, "North")
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Members who use a reminder app complete more tasks than members who do not. What conclusion is supported by this summary alone?
  1. The app caused members to complete more tasks.
  2. App users completed more tasks in these records.
  3. The app had no effect on task completion.
  4. Nonusers would improve if assigned the app.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A question asks, “Which category had the most returned units in May?” What metric and grouping answer it?
  1. Sum of returned quantity by category
  2. Count of returned orders by category
  3. Sum of all quantity by return status
  4. Count of returned records by month
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A day has 0 visits and 0 purchases. What result should a guarded purchases-per-visit calculation show?
  1. A measured rate of 0%
  2. A measured rate of 100%
  3. An unavailable rate
  4. A measured rate of 1%
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Which statistic can identify the most common support channel when the values are email, chat, and phone?
  1. Mean
  2. Median
  3. Range
  4. Mode
Show answerHide answer

Save this lesson to see this answer.

Set 3: Practice 3: Diagnose misleading summaries10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A table has one row per item in an order. You need average total order revenue for June. What calculation answers the question?
  1. June item-revenue total divided by June item rows
  2. June average item price divided by distinct June orders
  3. June distinct-order count divided by item-revenue total
  4. June item-revenue total divided by distinct June orders
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

After sorting only a spreadsheet’s customer-name column, order amounts remain in their original cells. What integrity problem has occurred?
  1. The number of orders must have increased.
  2. Names can now be beside the wrong orders.
  3. Amounts must now have larger numeric totals.
  4. The customer names must have become numeric.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A SQL report groups three years of records by EXTRACT(MONTH FROM event_date) and produces only 12 groups. What is needed for separate calendar-month results?
  1. Sort by month descending first.
  2. Round the month number first.
  3. Group by both year and month.
  4. Group by the month name only.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Invoice I1 totals 75 and has two lines; I2 totals 45 and has three lines; I3 totals 75 and has one line. A join attaches all lines to invoices. What is the correct invoice-revenue total?
  1. 195
  2. 360
  3. 120
  4. 150
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Twelve orders are West, nine are returned, and four are both West and returned. How many are West or returned?
  1. 21
  2. 17
  3. 13
  4. 4
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A pivot shows average durations of 16 minutes from 2 jobs and 28 minutes from 6 jobs. What is its Average grand total for these eight jobs?
  1. 22 minutes
  2. 24 minutes
  3. 44 minutes
  4. 25 minutes
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Two samples have mean duration 30 minutes. Their sample standard deviations are 2 and 11 minutes. What comparison is supported?
  1. The second sample is more spread out around 30.
  2. The second sample has the higher mean duration.
  3. The first sample must contain more observations.
  4. The first sample has the larger maximum duration.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

There are orders O1 for C1, O2 for C1, O3 for C2, and O4 for C9. The customer reference has two C1 rows, one C2 row, and no C9. For orders left join customers, what are total output rows and unmatched-order rows?
  1. 4 and 1
  2. 5 and 0
  3. 6 and 1
  4. 5 and 1
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A formula table and a SQL query disagree on quarterly revenue. Their metric definitions match, but the spreadsheet range stops before the final day’s records. What correction should be made first?
  1. Average the two outputs before reporting.
  2. Expand the source range and recalculate.
  3. Round both outputs to fewer decimal places.
  4. Exclude the final day from the SQL source.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Team P converts 72 of 80 easy cases and 12 of 40 hard cases. Team Q converts 136 of 160 easy cases and 4 of 20 hard cases. How do within-type and overall rankings compare?
  1. P leads in each type; Q leads overall.
  2. Q leads in each type; P leads overall.
  3. P leads in each type and overall.
  4. Q leads in each type and overall.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Practice 4: Combine methods and check the conclusion10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A timestamp column contains a record at 2026-09-30 18:20. What condition includes that record and all other September timestamps while excluding October?
  1. event_time >= '2026-09-01' AND event_time < '2026-10-01'
  2. event_time BETWEEN '2026-09-01' AND '2026-09-30'
  3. event_time > '2026-09-01' AND event_time < '2026-09-30'
  4. event_time >= '2026-09-01' AND event_time <= '2026-10-01'
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Revenue values are NULL, 80, 150, 220, and 0. A CASE checks >= 80 for Medium, then >= 200 for Large, and otherwise Small. After correcting the rule to keep Unknown separate and Large at 200 or more, what counts should result?
  1. Unknown 0; Small 2; Medium 3; Large 0
  2. Unknown 1; Small 1; Medium 3; Large 0
  3. Unknown 1; Small 1; Medium 2; Large 1
  4. Unknown 1; Small 2; Medium 1; Large 1
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Three orders have revenue and profit of (50, 20), (150, 30), and (300, 30). A report gives overall margin as 23.3%. What should the margin be, and why?
  1. 19.0%; total profit is divided by total cost.
  2. 16%; total profit is divided by total revenue.
  3. 23.3%; each order’s margin has equal weight.
  4. 10%; the largest order represents all orders.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A filled-down lookup misses product P01 only in later rows. Its reference range has shifted from A2:A40 to A8:A46, while P01 is in A2. What repair addresses the cause?
  1. Use approximate matching for the ids.
  2. Replace missing matches with zero.
  3. Sort the returned prices descending.
  4. Make both reference ranges absolute.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Two monthly tables contain complete transaction records with identical selected values for some separate transactions. What SQL operation combines both months while retaining every record?
  1. UNION
  2. COUNT(DISTINCT amount)
  3. UNION ALL
  4. An inner join on amount
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

You need the number of different known device ids in a SQL table. What expression provides it?
  1. COUNT(device_id)
  2. COUNT(DISTINCT device_id)
  3. COUNT(*)
  4. SUM(device_id)
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A log has 20 tickets. Twelve are urgent, nine are online, and five are both. Review is needed for every ticket that is urgent or online, plus all remaining tickets with a missing priority. Exactly two missing-priority tickets are outside that union. How many need review?
  1. 18
  2. 16
  3. 20
  4. 23
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Approved expenses are A: 30 and 50; B: 45 and 35; C: 100. C also has an unapproved expense of 90. You need the mean approved account total among accounts with approved totals at least 80. What is it?
  1. About 52.00
  2. About 100.00
  3. About 116.67
  4. About 86.67
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A SQL column contains ratings 2, NULL, 8, 5, NULL, 5. What are COUNT(rating) and AVG(rating)?
  1. 6 and 5
  2. 4 and 3.33
  3. 4 and 5
  4. 6 and 3.33
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Source orders A, B, C, and D have totals 40, 60, 80, and 100, respectively, one row per order. A summary contains ids A, B, B, and D with amounts 40, 60, 80, and 100. Both count and amount total match the source. What check is needed before trusting it?
  1. Confirm the amount total is still 280.
  2. Compare each id-amount pair with its source record.
  3. Confirm the row count is still four.
  4. Round the amount total to a whole number.
Show answerHide answer

Save this lesson to see this answer.

Set 5: Practice 5: Trace calculations across several stages10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Two sales in dollars have quantity, unit price, and unit cost of (2, 35, 21) and (3, 20, 12). What is their overall profit margin?
  1. 40%
  2. 60%
  3. 66.7%
  4. 25%
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Jobs J1 and J2 both have duration 45 minutes, while J3 has duration 30. You need the two longest jobs with ids ascending within duration ties. What ORDER BY clause fits?
  1. ORDER BY duration ASC, job_id ASC
  2. ORDER BY duration DESC, job_id ASC
  3. ORDER BY job_id ASC, duration DESC
  4. ORDER BY duration DESC, job_id DESC
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A discount field can be missing. What SQL condition selects exactly the records with no known discount?
  1. discount = NULL
  2. discount = 0
  3. discount <> 0
  4. discount IS NULL
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A target table has one row per facility and month. It contains two months for each facility. You attach targets to daily records using facility alone and then total the targets. What change addresses the matching problem?
  1. Match facility alone, then total every joined row.
  2. Match month alone, then average every joined row.
  3. Match facility and month, then total at target grain.
  4. Match facility and month, then total every daily row.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A sorted threshold reference has 0 Basic, 40 Standard, and 90 Extended. What does an exact-or-next-smaller lookup return for 70?
  1. Basic
  2. Extended
  3. Not found
  4. Standard
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A spreadsheet range contains numeric 18, text "12", numeric 30, and one blank. What does AVERAGE of that range return?
  1. 24
  2. 15
  3. 20
  4. 18
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Completed jobs by team have durations: Cedar 20 and 35 minutes; Elm 50 minutes. Cedar also has an unfinished 100-minute job. You need teams with total completed-job time above 45 minutes. What result should appear?
  1. Cedar 155; Elm 50
  2. Elm 50 only
  3. Cedar 55; Elm 50
  4. Cedar 55 only
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Paid invoices by account are A: 40 and 80; B: 70; C: 20 and 30. An analyst groups by account after applying WHERE amount > 60. What average account revenue does that query produce, and what is the intended average across all three accounts?
  1. 80; 75
  2. 75; 80
  3. 75; 75
  4. 50; 80
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Workshop A has 6 incidents in 2,000 operating hours; B has 8 in 4,000 hours. What are the higher-rate workshop and the combined rate per 1,000 hours?
  1. B; about 2.33
  2. A; about 2.50
  3. B; about 2.50
  4. A; about 2.33
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A regional average is based on 4 known values, with 3 additional values missing. What count should accompany that average?
  1. 4 known values; 3 missing
  2. 7 known values; 0 missing
  3. 3 known values; 4 missing
  4. 1 group value; 6 missing
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

85 Key Terms, each with its definition

A

Absolute reference
An absolute reference is a spreadsheet reference whose marked row, column, or both stay fixed when the formula is copied.
A shared tax-rate cell remains the same input for each order when both its row and column are locked.
Aggregation
Aggregation is reducing multiple records to summary values such as a count, total, average, minimum, or maximum.
Summing all March revenue produces one value, while summing by region produces a value for each region.
Alias
An alias is a temporary output name assigned to a field, table, or expression in a SQL query to make its role clearer.
Naming quantity times unit price as revenue lets the final ORDER BY refer to that calculated output.
Analysis
Analysis is the process of organizing, transforming, and summarizing data to answer a specific question.
An analyst summarizes March orders by region to find where revenue was highest during that month.
AND condition
An AND condition is true only when every connected condition is true for the record being tested.
A row must have region North and category Books to enter the North Books revenue calculation.
Appending
Appending is stacking compatible records as new rows, such as combining monthly sales tables with the same field structure.
UNION ALL appends February orders after January orders while retaining every selected record.
Approximate match
An approximate match uses a defined nearest-value rule when an exact key is absent, often to assign a numeric threshold band.
The next-smaller rule maps 75 to the band beginning at 50 when thresholds are 0, 50, and 100.
Ascending order
Ascending order runs from smaller to larger numbers, earlier to later dates, or A to Z for ordinary alphabetic text.
An ascending date sort lists the earliest March orders before the records from the end of the month.
Association
An association is an observed relationship between features or groups in data, without establishing that one causes the other.
Higher spending among discount users describes an association that may also reflect who seeks discounts.

B

Boundary value
A boundary value is a value at the point where a classification changes, requiring an explicit choice of which category includes it.
Revenue exactly 50 enters Medium when the rule says at least 50, so no value is left between bands.

C

Calculated field
A calculated field is a new value computed for each record from its inputs, such as revenue from quantity and unit price.
Adding a revenue formula supplies an amount for every order before regional totals are calculated.
CASE expression
A CASE expression is SQL’s way to choose an output from ordered conditions, using the result of the first true branch.
The test for a Large order comes before the Medium threshold so an amount of 120 receives Large.
Causation
Causation means that a change in one factor produces a change in another; an ordinary summary comparison alone cannot establish it.
The order summary does not isolate a discount’s effect from differences between the customers using it.
Common table expression
A common table expression is a named query result defined with WITH for use within a larger SQL statement.
A WITH result can hold customer totals so the next query step averages one total per customer.
Comparison
A comparison is the relationship an analysis examines between values, such as a ranking, a gap between groups, or a change over time.
The question asks for the highest regional revenue, so the comparison is a ranking of group totals.
Composite key
A composite key is a combination of fields that identifies a record when one field alone is not enough to distinguish it.
A store’s monthly target needs both store id and month because the same store appears in several periods.
Conditional aggregate
A conditional aggregate summarizes only the contributions from records meeting one or more stated criteria.
A North Books revenue formula adds amounts only from records whose region and category both match.
Conditional field
A conditional field is a calculated column whose output depends on tests of the current record, such as an amount threshold.
An order-size field labels revenue at least 100 as Large and lower revenues according to other bands.
COUNT(*)
COUNT(*) is a SQL aggregate that counts every input row, including rows containing NULL values in one or more fields.
Five rating records give COUNT(*) of five even when two of the rating values are unknown.
COUNT(column)
COUNT(column) is a SQL aggregate that counts the input rows whose value in the named field is not NULL.
Ratings 4, 5, NULL, 3, NULL give COUNT(rating) of three, the number of ratings available for the mean.
COUNTA
COUNTA is a spreadsheet function that counts nonempty cells, including numeric values and text that COUNT does not count.
A higher COUNTA than COUNT in an amount column prompts a check for numbers stored as text.
Criterion
A criterion is a condition used to decide whether a record contributes to a filter, count, sum, or other calculation.
The criterion greater than 50 excludes an amount of exactly 50, while at least 50 includes it.
Cross-check
A cross-check is an independent calculation or method used to compare an analysis result with another route to the same answer.
A separately built SQL query is compared with a spreadsheet summary using the same metric definition.
Cross-table
A cross-table is a summary organized by two dimensions, with one set of groups in rows and another across columns.
A region-by-category cross-table shows each regional revenue total divided among Books, Games, and Toys.

D

Denominator
A denominator is the base in a fraction or ratio that defines what the numerator is being compared with.
Total visits are the denominator for a conversion rate, while total orders are the base for a return share.
Descending order
Descending order runs from larger to smaller numbers, later to earlier dates, or Z to A for ordinary alphabetic text.
A descending revenue sort puts the largest order first and makes the highest values easy to inspect.
Dimension
A dimension is a field that divides records into groups for comparison, such as region, product category, or calendar month.
Using region as the dimension gives one revenue total for North, one for South, and one for East.
Distinct count
A distinct count measures how many different values occur in a field, instead of counting every occurrence of those values.
Ten orders can represent five customers when some identified customers placed more than one order.

E

Exact match
An exact match is a lookup result selected because the reference key matches the requested key, without using a nearby threshold.
VLOOKUP with FALSE looks for product P03 itself and does not accept a neighboring product code.
Exclusive upper boundary
An exclusive upper boundary excludes the endpoint itself while allowing every qualifying value below that endpoint.
Using a date before April 1 includes every March timestamp without specifying the last instant of March.

F

Fan-out
Fan-out is the repetition of an input record in a join result because it matches several records on the other side.
An order with three lines repeats its order total three times after the lines are attached.
Filter
A filter selects records meeting stated conditions, narrowing the population included without deleting the source data.
A March date filter excludes April orders from the result while leaving them in the source table.
Flag
A flag is a field indicating whether a record meets a condition, often using 1 for an event and 0 for no event.
Summing a returned-order flag counts returns; averaging the flag gives the share of included orders returned.
Foreign key
A foreign key is a field or set of fields in one table that refers to a key identifying records in a related table.
The customer id in an orders record points to the customer’s details in a separate reference table.

G

Grain
The grain of a table is what one record represents, such as an order, an order line, a customer, or a day.
At order-line grain, a purchase containing three products occupies three records but remains one order.
Grand total
A grand total is the overall pivot summary calculated from the contributing source records using the selected function.
An average grand total uses all contributing order values and therefore reflects unequal group sizes.
GROUP BY
GROUP BY is a SQL clause that collects records sharing grouping values so aggregates can return one result per observed group.
Grouping ten March orders from three regions by region turns those records into three regional totals and their counts.
Group size
A group size is the count of observations contributing to a group’s statistic, giving context for averages and rates.
One unusual order affects a mean from three orders much more than a mean from 300 orders.

H

HAVING
HAVING is a SQL clause that filters groups after aggregation, using conditions such as a minimum count or group total.
A HAVING condition can retain only regions whose combined revenue exceeds the reporting threshold.

I

Inner join
An inner join returns records with matches on both sides of its condition and omits records that have no matching partner.
An order for a customer id absent from the reference is excluded by an inner join to customers.
Integer division
Integer division is division that returns a whole-number result for integer inputs in some SQL systems, discarding the fraction.
Converting an input to a decimal prevents a ratio of 45 to 60 from being truncated to zero.
Interquartile range
The interquartile range is the third quartile minus the first quartile, describing the spread of the middle half of the data.
An analyst reports IQR with the median when a few extreme durations would dominate a full-range comparison.

J

Join
A join is an operation that combines records from tables according to a matching condition, returning each qualifying match.
Joining orders to customers adds customer information beside order fields in a single query result.

L

Left join
A left join preserves every left record and returns its right-side matches, using NULL right-side fields when none exists.
Starting from customers with a left join retains customers who placed no orders during the period.
Lookup
A lookup is a search for a key in a reference range that returns a value from the corresponding record in another field.
A product-code lookup retrieves a folder’s unit price before the sales row calculates its revenue.

M

Many-to-many relationship
A many-to-many relationship allows several records on each side to relate to several on the other, often through a connecting table.
Order lines connect orders containing several products with products that appear in several orders.
Markup
Markup is profit divided by cost, expressing how much the selling amount exceeds the cost relative to that cost.
Profit of 36 on cost of 84 gives about 42.9% markup, even though the margin for that order is 30%.
Mean
The mean is the sum of numeric values divided by their count, with every included value contributing to the result.
A long bike trip pulls the mean duration upward even when most of the trips remain relatively short.
Median
The median is the middle sorted value, or the mean of the two middle values when there is an even number of observations.
When the two middle durations in a sorted list of trips are 10 and 12 minutes, their median is 11 minutes.
Metric
A metric is a defined numeric measure used to answer a question, such as order count, total revenue, or average duration.
A revenue metric that excludes canceled orders lets a spreadsheet and a SQL query use the same definition.
Mode
The mode is the most frequent numeric value or category in a data set; more than one value can tie for highest frequency.
When Books and Games each appear in four March orders and no category appears more often, both are modes of the category column.
Multi-level sort
A multi-level sort orders by a primary field, then uses additional fields to order records tied on earlier fields.
Sort by region first and then by revenue descending to rank orders separately inside each region.

N

NULL
NULL is SQL’s marker for a missing or unknown value; ordinary comparisons with it are not true and need a missing-value test.
A missing discount needs IS NULL; it will not enter either discount below five or discount at least five.
NULLIF
NULLIF is a SQL function that returns NULL when its two inputs are equal and otherwise returns the first input.
NULLIF(visits, 0) makes a zero visit count unavailable as a denominator before the rate is calculated.

O

One-to-many relationship
A one-to-many relationship links one record on one side to several possible records on the other, with the shared key repeated there.
One customer can place several orders, so the orders table can repeat that customer’s identifier.
OR condition
An OR condition is true when at least one connected condition is true, including when more than one is true.
North or Books includes a North Games order and a South Books order, with each included once.
Outlier
An outlier is an observation far from the others that calls for investigation before it is kept, corrected, or excluded.
A 58-minute ride among much shorter trips could be real or could reflect a problem recording the return.
Overlap
An overlap is the set of records meeting more than one selection condition, which must be handled when separate counts are added.
Adding North and Books counts includes North Books orders twice unless their shared count is subtracted.

P

Percent change
Percent change is the new value minus the old value, divided by the old value and expressed as a percentage.
A rise from 80 to 100 is 25%, while the reverse move is a 20% decline because the base changes.
Percentage point
A percentage point is a unit for the direct difference between two percentages, without dividing by the original rate.
A rate moving from 4% to 5% rises one percentage point, which differs from its 25% relative increase.
Percentile
A percentile is a position-based value marking a chosen percentage of an ordered distribution, with details depending on the method.
A high delivery-time percentile describes a point near the slow end without reporting only the longest delivery.
Pivot table
A pivot table is a spreadsheet summary that groups source records using selected fields and aggregates their values.
Region in Rows and Sum of revenue in Values produce the same regional totals as an SQL grouped sum.
Plausibility check
A plausibility check tests whether a result fits the expected units, scale, boundaries, and meaning of the quantity being measured.
A revenue share above 100% prompts investigation, while a revenue increase above 100% can be valid.
Primary key
A primary key is a field or combination of fields whose nonmissing value uniquely identifies each record in its own table.
Each customer id appears once in the customer reference so an order can identify its customer unambiguously.
Profit margin
Profit margin is profit divided by revenue, expressing the share of revenue remaining after the costs included in the calculation.
Revenue of 120 and profit of 36 give a margin of 30%, using revenue as the comparison base.

Q

Quartile
A quartile is a boundary dividing ordered observations into approximate quarters, with the median as the second quartile.
Using the same quartile method when comparing two groups avoids treating tool interpolation differences as data changes.

R

Rate
A rate is an event count divided by a defined exposure base, often scaled per hundred, per thousand, or per unit of time.
Complaints per 1,000 orders compare stores with different activity levels on the same scale.
Reconciliation
Reconciliation is comparing totals or counts from different parts of an analysis to check that they account for the same records.
Regional revenue totals should add to the direct source total for the identical period and filters.
Reference table
A reference table holds values to retrieve by key, usually with one valid record per key for an unambiguous ordinary lookup.
The product reference maps each product id to its name and price; duplicate ids need investigation.
Refresh
A refresh updates a saved summary from its selected source so that changes within that source are reflected in the result.
After refreshing an Excel pivot, check that newly added orders also fall inside its source range.
Relative reference
A relative reference is a spreadsheet cell reference that changes position when its formula is copied to another cell.
Filling E2 times F2 down one row changes the inputs to E3 and F3 so the next order uses its own data.
Reporting precision
Reporting precision is the number of digits shown in an output, chosen to communicate useful detail without overstating accuracy.
The report shows revenue share as 46.7% and keeps unrounded values for any later calculation.

S

Share
A share is a part divided by its relevant whole, often expressed as a percentage with the denominator clearly named.
If March revenue totals 535, a North share of about 46.7% uses 535 as the total for that period and definition.
Simpson’s paradox
Simpson’s paradox is a reversal between overall and subgroup comparisons that can occur because the groups have different subgroup mixes.
A team with lower rates for both lead types can have a higher overall rate if it receives more warm leads.
Sorting
Sorting is arranging complete records by one or more fields so that their order follows the selected values.
Sort the whole orders table by revenue to keep each amount beside its original order id and date.
Spot-check
A spot-check is a focused recalculation or inspection of selected records to test an operation where errors could occur.
Checking a first row, a final row, and a category boundary tests more than inspecting ordinary middle rows.
Standard deviation
Standard deviation measures the spread of values around their mean using squared deviations and is expressed in the data’s units.
Trip durations with a larger standard deviation are more spread out around their average duration.
SUBTOTAL
SUBTOTAL is a spreadsheet function that performs a chosen summary while excluding records hidden by a filter.
SUBTOTAL with function number 9 adds the visible North revenues while the other regions are filtered out.
SUMIFS
SUMIFS is a spreadsheet function that adds values from a sum range when all supplied criterion-range pairs match the same row.
A region label in I2 supplies the criterion while locked data ranges stay fixed as the formula fills down.

T

Two-step aggregation
Two-step aggregation first summarizes records at an intermediate grain, then applies another summary to those results.
Totaling each customer’s orders before averaging gives revenue per customer instead of per order.

U

Unmatched key
An unmatched key is a value in the main data for which no corresponding reference record is found under the matching rule.
A sales row for absent product P07 gets a Not found label and is counted before reporting classified sales.
Unmatched row
An unmatched row is a retained record without a partner satisfying the join condition, shown with missing fields from the other side.
A customer with NULL in the joined order key has no matching order; a missing phone alone is insufficient.

V

Values area
The Values area of a pivot table identifies the field to aggregate and the summary function used on that field.
Revenue in Values needs Sum for a revenue total; Count would answer a question about filled records.

W

Weighted average
A weighted average gives each value influence according to its weight, such as each group mean weighted by its observation count.
A 200-order group influences the pooled order mean four times as much as a 50-order group.
WHERE
WHERE is a SQL clause that selects individual input records before grouping and aggregation take place in logical query processing.
A Games condition in WHERE removes other categories before the query calculates regional revenue.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started