Ravindra BagaleCourses & study guides मराठी Track your progress

3. Formulas and Functions

Excel

3.16 SUMPRODUCT

Multiply matching rows, then add their results

A quick-commerce team needs the cost of a small batch. There is a quantity and a price on each row. Multiplying the total quantity by the total of the prices pairs the wrong numbers. The correct method multiplies each quantity by its own unit price, then adds the line totals. SUMPRODUCT packages that row-by-row calculation into one expression.

We will use synthetic shop records inspired by Blinkit and Amazon Now. The first lab returns to the four stationery orders from Chapter 1. The second uses the chapter's ten order records to apply business conditions and test a weighted average. All prices, durations and outcomes here are practice data. Every result can be checked by hand on these small tables.

  • Multiply matching values. Pair quantities and unit prices from corresponding rows.
  • Turn comparisons into inclusion flags. Let one or zero determine whether a row's amount contributes to a total.
  • Include an OR match only once. Turn the sum of matching tests into a single per-row decision.
  • Explain a weighted average. Say what the weights mean, then divide the weighted sum by the sum of the same weights.

Match each quantity with its own price

Suppose four shelf items are sold: two planners at ₹120 each, three pens at ₹30, one bottle at ₹250 and four markers at ₹20. The four line totals are ₹240, ₹90, ₹250 and ₹80. Their sum is ₹660. The four prices belong to particular rows, so multiplying their total by the total number of units would combine each price with unrelated items.

Quantity and price for each of four rows give 240, 90, 250 and 80. The products add to 660.
Each product uses values from the same row. The sum comes after those four products.

Read the array positions

An array here is a set of values arranged in a range. If quantities are in C2:C5 and prices in D2:D5, =SUMPRODUCT(C2:C5,D2:D5) uses the first quantity with the first price and the second quantity with the second price, continuing through the four positions. Excel returns one number. You can check it by adding another column of line-total formulas and summing that column.

The two ranges must have the same dimensions for this calculation. C2:C5 has four rows and one column. D2:D6 has five rows and one column, so it does not match. Equal dimensions are necessary and still leave another check. C2:C5 and D3:D6 each have four positions but refer to different records by row. A returned number can therefore look valid while its pairs are wrong.

Preserve pairs when sorting, copying and filtering

Sort whole order records rather than moving one input column on its own. If Qty is sorted by itself, the values might keep their numeric type and count while the amounts change silently. When two files arrive in different row orders, match the IDs or otherwise prepare a reconciled table first. This lesson assumes Qty and price are part of one verified order row before calculating.

Two ranges both have four rows. Is that enough to trust their products?

They also need to refer to the same four records in corresponding order. Inspect a few matching IDs or use a prepared table whose fields stay together when sorted.

Convert a row comparison into a numeric filter

A comparison across a range can produce a TRUE or FALSE for each row. In the course Orders table, C2:C11="Pune" tests ten City cells separately within an array expression. A double minus converts TRUE to 1 and FALSE to 0. With a numeric amount range, each row's result can be multiplied by its flag. Qualifying rows contribute their amounts. Excluded rows contribute zero.

Read the double minus from right to left

The first minus converts TRUE to −1 and FALSE to 0. The second minus changes −1 to 1 and keeps zero. --(C2:C11="Pune") is a common compact notation for this conversion. In an explicit arithmetic expression, multiplication can also coerce Boolean values. Either style needs accurate parentheses around the comparison and inputs that can participate in the intended arithmetic.

To sum all recorded Pune amounts, use =SUMPRODUCT(--(C2:C11="Pune"),G2:G11) with the base dataset's column G. The qualifying amounts are 64, 110, 150 and 220, giving 544. A report of delivered Pune amounts needs a second flag, because 220 is the amount on a Cancelled row.

Multiply flags when both conditions must hold

=SUMPRODUCT(--(C2:C11="Pune"),--(I2:I11="Delivered"),G2:G11) uses the two filters together. When both flags are 1, the amount enters the total. If either flag is 0, that row's product contributes zero. With the ten course rows, the result is 324 from the three delivered Pune amounts 64, 110 and 150.

Pairwise operations inside SUMPRODUCT give per-row outcomes. If you call a general AND function on entire multi-row comparison arrays without using a row-by-row approach, it can combine all the supplied values into one overall Boolean. That is a different question. For an everyday conditional total with plain comparisons and aligned source fields, you can also use SUMIFS. Check that both versions cover the same records and measure.

Why does a cancelled Pune order with amount 220 contribute zero to the delivered sum?

It has a city flag of 1 and a delivery-status flag of 0. Its product is 1 times 0 times 220, which gives zero. The original order amount remains in its source cell.

Include an OR match once even if it passes both tests

Adding two flags gives 0, 1 or 2. Zero means neither test matched. One means one test matched. Two means both matched. If you use that sum directly as a multiplier, a row meeting both conditions contributes twice. To select a row once, compare the combined sum with zero and convert the new true-or-false result to a single inclusion flag.

A 64 rupee order is from Pune and Delivered. The two flags sum to 2, and comparing 2 with zero creates one inclusion. The amount 64 is added once.
Two matching tests still describe one order. Use a single inclusion flag for a total over the selected rows.

Test the combined result before multiplying the amount

=SUMPRODUCT(--(((C2:C11="Pune")+(I2:I11="Delivered"))>0),G2:G11) includes orders that are from Pune or Delivered or both. The inner additions count true comparisons for each record. The next comparison turns any positive count into one TRUE. The double minus produces a 1 or 0 for each amount.

In the practice table there are seven Delivered orders. BLK-1009 is a cancelled Pune order, so the OR adds that one additional row. The valid union is eight rows. Its total amount is 2,435. Adding the separate Pune total of 544 to the Delivered total of 2,215 gives 2,759. The gap is 324, the amount present in both groups. This independent check shows which rows would be counted twice.

Know when overlap cannot happen

A row with one City value cannot equal Pune and Nashik at the same time in this clean sample. Adding those two city flags cannot reach 2. That is why the simpler city comparison works there. The explicit greater-than-zero condition also handles that case and makes your intention visible if the rule later includes different fields.

How many times should a delivered Pune order contribute to a Pune-or-Delivered amount?

Once. Both tests succeed for that row, but the report asks whether it belongs to the union of the conditions. Convert the positive count to one inclusion before multiplying by the amount.

Trace one order into two different summaries

  1. Read the fields

    BLK-1001 is a Pune order with status Delivered and amount 64. The whole row is matched to the same order ID before we form any flags.

  2. Combine the two requirements

    Pune gives 1 and Delivered gives 1. For a summary requiring both, multiply 1 by 1. The result is 1, so the delivered Pune report receives 64.

  3. Test the alternatives separately

    For Pune or Delivered, the flags add to 2. The sum counts the tests that matched. It does not describe two physical order rows.

  4. Collapse the OR to one decision

    Two is greater than zero, so the order qualifies. Convert the comparison to one inclusion. The OR report also receives 64 for that order, not a repeated contribution.

Use a weight only when it has a clear meaning

A simple average gives every line the same influence. A weighted average gives each line a specified amount of influence. The units in an order line are one possible weight. If a sale of five units uses a lower price than a sale of one unit, the average received per unit should reflect how many units were sold at each price. The total amount divided by the total quantity answers that question directly.

Read numerator and denominator in the same population

In the stationery exercise, the four prices average to ₹105 when each item line receives one vote. The quantities sum to 10 and the line totals sum to ₹660. Dividing 660 by 10 gives ₹66 per sold unit. The results differ because four price levels and ten sold units are different bases for the average. Label the measure before choosing which one to present.

For a filtered weighted average, apply the same filters to both parts. If you sum only delivered amounts in the numerator, count only delivered quantities in the denominator. Otherwise a cancelled line could reduce the reported value per delivered unit even though its amount was excluded. If the weight total is zero, the weighted average is not defined for that population. Display an honest report status for that case.

State whether you are measuring orders or units

In the ten-row example, the simple average of all recorded minutes is 12.8 minutes per order row. A quantity-weighted calculation is 285 divided by 24, or 11.875 minutes, displayed as 11.88. This weights timing by the number of items in each row. It is a teaching calculation for all recorded rows. Cancelled and returned entries do not automatically belong in a measure called “completed delivery minutes.”

If the intended result is quantity-weighted timing among the Delivered rows, keep only those rows in both parts. The weighted numerator is 207 unit-minutes and the denominator is 17 units, so the result is about 12.18 minutes. A simple average of the seven delivered times gives about 13.43 minutes per order. Choose based on the report question, and retain the eligible record and unit counts.

Decide when an empty or zero weight is a valid observation

A zero weight can describe a known record that contributes no units. A missing weight can indicate that the team does not know how many units belong to that record. Although both can make a raw product contribute zero under some formula rules, they imply different actions. Test the underlying quantity type and keep a status for the unresolved row. Confirm the business definition before treating blank quantity as no activity.

If a selection admits no eligible units, both numerator and denominator could be zero. A useful answer is No eligible units, because there is no per-unit result. Put numerator and denominator in separately labelled summary cells. For example, if L2 holds the numerator and L3 holds the validated weight sum, =IF(L3=0,"No eligible units",L2/L3) checks that explicit state. Test it by selecting a known empty category in your scratch workbook.

A return can be represented by a signed quantity in some datasets. Including such values could make a net quantity small or zero even when several rows exist. Decide whether the measure describes purchases, returns, or net outcomes before assigning weights. A per-delivered-unit question may use positive delivered quantities, while a net report could need a separately documented signed calculation. Check reported totals and weight separately before applying a division.

To review the first lab quickly, set every quantity to zero in a scratch copy. The product sum becomes zero. The sum of weights also becomes zero. A plausible 0 from a broad fallback would misstate the result as a measured per-unit price. Restore the four quantities after testing the explicit unavailable state.

Why is the weighted unit price 66 while the simple average is 105?

The simple average gives equal weight to each of four unit prices. The weighted calculation gives each of the ten sold units its actual contribution. A four-unit sale therefore counts four times in the per-unit measure.

Lab 1 · Reconcile the same batch total in two ways

Goal. Compute a sum of products from matching quantities and prices, then compare it with an independently visible line calculation. Create an editable scratch sheet named Pair and Total. Put Order ID, Item, Qty, Unit Price and Line Total in A1:E1. Use the four synthetic stationery orders in the table.

  1. Enter the four rows. Put the IDs, items, quantities and prices in A2:D5. Type prices as numeric amounts and format the result as currency if helpful. Each value must remain on its source row.
  2. Make the products visible first. In E2 enter =C2*D2 and fill down. In E6 enter =SUM(E2:E5). The four products are 240, 90, 250 and 80, and the sum is 660.
  3. Calculate the compact expression. In G2 enter =SUMPRODUCT(C2:C5,D2:D5). Expect 660. Select the two related input ranges and confirm that both start on row 2 and end on row 5.
  4. Check both forms of averaging. In G3 use =SUM(C2:C5), which gives 10. In G4 enter =G2/G3 and expect 66. In G5 enter =AVERAGE(D2:D5) and expect 105. Use clear labels to show one is weighted by quantity and the other gives each listed price one vote.
  5. Test and restore. Change the Planner quantity in C2 from 2 to 3. The two total methods each become 780 and the quantity total becomes 11. Restore 2 and verify both totals return to 660. Save the restored scratch copy or close it after review.
Pair and Total checks
Order IDItemQtyUnit priceLine total
QK-101Planner2120240
QK-102Pen33090
QK-103Bottle1250250
QK-104Marker42080

Expected evidence. A single sum of products and the line-level method yield 660. If the compact result changes but the line totals do not, compare source ranges and make sure the same observed row was modified. If you see #VALUE!, check the dimensions and actual field types before adding a fallback.

Lab 2 · Test AND, OR and weighted timing against order IDs

Goal. Use the ten synthetic Orders rows to check a filtered total, an overlapping OR and a quantity-weighted calculation. Enter the sample table in your own scratch workbook as order rows A2:I11, with headers in row 1. City is C, Qty is F, Amount is G, Minutes is H and Status is I. Keep all records, including Cancelled and Returned, until selecting each distinct measure.

If the overview's table is not at hand, use the rows below. Enter Date as a numeric date in your sheet, such as =DATE(2026,11,2) for the first row. Keep the source Amount and Minutes definitions. This is a sample of recorded statuses, so do not interpret every Amount as revenue earned or every duration as a completed delivery.

Order columns A through I, data rows 2 through 11
Order IDDateCityPlatformCategoryQtyAmountMinutesStatus
BLK-100102 Nov 2026PuneBlinkitDairy2649Delivered
BLK-100202 Nov 2026NashikBlinkitFruits327012Delivered
AMN-100303 Nov 2026PuneAmazon NowSnacks111014Delivered
BLK-100403 Nov 2026NagpurBlinkitFruits224011Cancelled
AMN-100504 Nov 2026KolhapurAmazon NowDairy423216Delivered
BLK-100604 Nov 2026PuneBlinkitBakery51508Delivered
BLK-100705 Nov 2026SolapurBlinkitHome1129918Delivered
AMN-100806 Nov 2026Sambhaji NagarAmazon NowStaples319510Returned
BLK-100907 Nov 2026PuneBlinkitSnacks222013Cancelled
BLK-101008 Nov 2026NashikBlinkitFruits19017Delivered
  1. Find the delivered Pune amounts manually. Identify BLK-1001, AMN-1003 and BLK-1006. Their amounts are 64, 110 and 150. Use the first formula below to total the same cases and expect 324. Check the rows by ID before relying on the total.
  2. Use the OR mask. Find all Delivered records and the cancelled Pune row BLK-1009. Use the second formula and expect 2,435. Compare with 2,759 from adding the two overlapping totals directly. Explain the gap rather than filtering the input to force agreement.
  3. Use a weighted numerator. For the Delivered rows, multiply each numeric duration by its quantity. Use the third formula for a total of 207 unit-minutes. Check the fourth formula gives 17 units using the same Delivered condition.
  4. Check the denominator. Divide 207 by 17 and display the result to two decimals as 12.18. Compare with the all-row weighted time of 11.88 to see why the report population matters. If a future selection yields no eligible units, report the missing denominator explicitly.
  5. Check the overlap with one edit. Temporarily change BLK-1009's status from Cancelled to Delivered in the scratch file. The AND sum rises to 544. The OR sum stays 2,435 because that row already qualified as Pune. Restore the source status after verifying.
=SUMPRODUCT(--(C2:C11="Pune"),--(I2:I11="Delivered"),G2:G11)
=SUMPRODUCT(--(((C2:C11="Pune")+(I2:I11="Delivered"))>0),G2:G11)
=SUMPRODUCT(--(I2:I11="Delivered"),H2:H11,F2:F11)
=SUMPRODUCT(--(I2:I11="Delivered"),F2:F11)

Expected evidence. Filters give different but reproducible counts and amounts. If you see 544 for delivered Pune before the status edit, the formula may ignore the delivery condition. If Pune-or-Delivered gives 2,759, check whether you normalised the inclusion sum to a single per-row flag. Compare one row meeting both tests before checking the whole worksheet again.

Check types and range boundaries before relying on the total

SUMPRODUCT requires corresponding array arguments to have the same dimensions. In a clean numeric calculation, supplying separate numeric array arguments is straightforward. The function can treat nonnumeric array entries as zeros under its argument rules. A multiplication written explicitly inside an argument can evaluate differently and can produce an error when arithmetic receives unsuitable text. Check the raw column and avoid treating hidden text as a confirmed numeric zero.

Check whether a missing pair was treated as zero

Suppose someone pastes Pending into a price field while Qty remains valid. A report designed around complete numeric prices should record that missing price in a separate review status. Converting it to zero without evidence can understate revenue. Formula choices have different error behaviour, so inspect the raw fields and verify the number of usable pairs. If an input contains a real calculation error, investigate its cause rather than expecting a zero-valued filter to repair it.

Use ranges that cover the data you intend to report

A whole-column reference can force the workbook to evaluate a very large number of rows even when the dataset is small. Use bounded ranges or the appropriate columns of an Excel Table. Bounded ranges are easy to verify in a teaching example. A maintained table can help include appended rows, but still confirm the headers, row count and reference syntax after changing the workbook.

When sharing a formula, name the source and range. Distinguish hidden or filtered rows from the formula's own criteria. A SUMPRODUCT expression evaluates the specified arrays. An interactive filter on the sheet does not automatically turn it into a total of visible rows. Choose a different documented reporting technique if only visible rows should contribute, and test one hidden row.

Keep a missing cost from becoming unreported zero

The four-row stationery file was complete when you checked ₹660. Imagine a new version arrives with the Marker price shown as the text Pending while the quantity is still four. A sum of products over separate arrays may treat that nonnumeric entry as zero. The raw result can then look like a verified batch total of ₹580. It really describes the priced lines available in the file. A good report makes the fourth row's unresolved price visible.

Check each input and its associated row together

In a scratch version of Pair and Total add a check column beside the existing line total. On a clean numeric row, Qty and Unit Price can each pass an ISNUMBER check. Add the allowed quantity and price rules for this business. You could use =IF(AND(ISNUMBER(C2),ISNUMBER(D2)),"Numeric pair","Review values") as a first type check. This checks types only. It gives Review values on the Marker row when D5 contains Pending.

Use a separate report formula that includes only reviewed valid values and a count that shows how many cases failed. In a simple helper column you could return =IF(F2="Numeric pair",C2*D2,"") once F2 contains the check. The helper column should show 240, 90, 250 and an empty display. The displayed total of 580 covers three lines, and one line needs review. The actual order price remains unknown.

Inspect what changed when a report turns from a number into an error

With the original numeric inputs, =SUMPRODUCT(C2:C5,D2:D5) and =SUMPRODUCT(C2:C5*D2:D5) produce the same result. When a column contains unsuitable text, the second formula explicitly attempts multiplication before SUMPRODUCT can add the results. That operation can fail. Review the data rather than assuming two expressions that agree for clean rows will always handle unusual inputs in the same way.

When a quantity or price field comes from a formula returning a real Excel error such as #N/A, isolate that cause too. A filter flag of zero does not itself repair an invalid result that took part in arithmetic. Keep corrections or exclusions visible. After confirming the original Marker price of 20 in this exercise, restore it and verify the usable-pair count becomes four while the total returns to 660.

A total falls to 580 and a price cell says Pending. Can you conclude the store sold fewer items?

No. The count of units can remain unchanged. One line's monetary value is unavailable. Report the validated amount and the unresolved price separately, then update both checks after the source is confirmed.

Count only the dates that belong to a reporting window

The existing ten Orders records all use November 2026 dates. A comparison of MONTH with 11 works for those rows because every record already belongs to the same year. The same expression would also include November 2027 in a multi-year workbook. Use an actual start date and exclusive next-month boundary to keep the intended period visible.

Combine two comparisons on one date field

On an Orders copy use =SUMPRODUCT(--(B2:B11>=DATE(2026,11,1)),--(B2:B11<DATE(2026,12,1)),G2:G11). Each row needs a valid numeric date or timestamp. The first flag includes the first instant of November. The second flag excludes any timestamp starting on 1 December. The original ten rows total 2,870 and all qualify. The measure is total recorded amount for those dates. Add a separate status flag if another report needs only completed transactions.

Test a different five-row dataset before trusting a multi-year report
Recorded timestampAmountInside November 2026?
31 Oct 2026, 23:5920FALSE
01 Nov 2026, 00:0060TRUE
30 Nov 2026, 23:59100TRUE
01 Dec 2026, 00:00200FALSE
05 Nov 2027, 12:0090FALSE

Try the control table in a blank area, adjusting the ranges to cover its five rows. Generate the timestamps with DATE plus TIME in a common timezone. The correct November 2026 total is 160. Filtering only MONTH equal to 11 adds the 2027 row and gives 250. A purely inclusive upper date at the start of 30 November would omit the late 30 November transaction. The control cases test both kinds of mistake.

Compare a simpler formula where it fits

If all you need is to sum amounts with standard date conditions, SUMIFS can state the same rule with one amount range and two criteria on the date range. Use the same boundaries in both versions before comparing. SUMPRODUCT is useful when the selected rows must additionally multiply fields, such as quantity times rate. A readable, independently checked single-purpose formula is better than adding complexity that serves no reporting requirement.

Reconcile a two-column cost calculation and the margin percentage

Imagine a small business needs to work out the margin on its four synthetic stationery lines. The 660 recorded amount is calculated from quantity times selling price. The business separately stores an assumed unit cost for each product. Do the multiplication separately for both amounts. The result tells you the contribution under this simple practice model, before any other costs or adjustments.

Keep selling prices and unit costs in different columns

On an unmodified scratch copy of Pair and Total type 80, 12, 175 and 15 in H2:H5 for the four unit costs. Use =SUMPRODUCT(C2:C5,H2:H5) to calculate total cost. The paired costs are 160, 36, 175 and 60, giving 431. The total amount is 660, so the difference is 229. A brief line-by-line check can show why the costs are multiplied by Qty while the precomputed line amounts can be summed directly.

The overall margin on the recorded amount in this exercise is 229 divided by 660, about 34.70%. A common mistake is to calculate each line's margin percentage and then average the four values equally. Each line's amount is different. The equal average calculates the average of four line percentages. It does not use any amount weight. The overall margin percentage uses total difference and total amount from the same lines.

Verify one line and its effect on the summary

The Bottle line uses a quantity of one, selling price of 250 and unit cost of 175. Its difference is 75. If the unit cost rises to 180 in a scratch scenario, total cost becomes 436, the total amount stays 660, and the difference falls to 224. Confirm that the 5 change appears only in the expected cost and margin calculations. Restore the original cost after the exercise.

If you filter the data to one product category, make sure both the revenue-like amount and its paired cost use the same inclusion rule. If a line is excluded from amount and still included in cost, the computed difference changes for an unintended reason. Report counts and check one row outside the selected category to ensure the filter affects both parts.

Make a complex total easier for someone else to check

A single formula can contain many masks. When its result changes, a reviewer needs to know which fields changed and how they affected the included rows. Add a brief test sheet or named set of control cases. Include a row that matches all conditions, one that fails each condition independently, and an OR row that matches both alternatives. Compare the resulting IDs and their contributions before reviewing the final sum.

Keep enough boundary evidence as the data grows

Starting with the ten-row exercise, add one known row below row 11 in a scratch copy. The fixed ranges ending at 11 still describe the original baseline unless you alter how the ranges are defined. Update the amount and criteria ranges together if you intend to include the new row. Using a correct count and an independent total will expose a source row that was pasted but never made it into the report.

Try one deliberate malformed expression on a spare cell, such as adjusting a price range to start one row lower while its last row also moves one down. The arrays then remain equal in size and the result can calculate without an error. Compare one paired order against its actual unit price. This confirms why an aligned data table and one known result are both important controls.

For an output that someone will email or present, include the record window, included statuses, weight convention and number of rows. A short report can state “Delivered orders only, quantity-weighted average 12.18 minutes, seven orders and seventeen measured units.” That evidence tells the reader exactly how to compare a later result.

Practise choosing the right calculation

  1. Check a disjoint OR. Select Pune or Nashik in the ten-row table using one OR flag. Check. The amounts are 544 and 360, for a combined 904. A single City field cannot match both values in this example.
  2. Check an amount already extended by quantity. Column G in the chapter Orders table already stores line amounts. Check. To total all amounts, add G2:G11 and expect 2,870. Multiplying this amount by Qty again would give a differently weighted number.
  3. Test an impossible alignment. In a spare cell use a four-row and five-row quantity/price range. Check. The mismatched dimensions can cause #VALUE!. Restore matching ranges and inspect their row IDs.

Check your understanding

1. Which operation does SUMPRODUCT perform with matched quantities and unit prices?
  • A. Multiply each quantity by its corresponding price, then sum
  • B. Add all quantities and all prices first
  • C. Return only the largest price

Answer A. The four stationery pairs give 240, 90, 250 and 80, which add to 660. Combining totals first would form the wrong pairings.

2. Why does adding two comparison masks sometimes double a row's contribution?
  • A. One match always produces two units
  • B. An order meeting both comparisons gets a multiplier of 2
  • C. Excel automatically duplicates every matching row

Answer B. Each true comparison contributes one. Convert their combined positive count to a single inclusion before multiplying by the amount.

3. Which is the correct unit-weighted price in the stationery example?
  • A. 105, because there are four price cells
  • B. 660, because that is the total amount
  • C. 66, because 660 divided by ten units is 66

Answer C. A per-unit price uses all sold units as its weight. An unweighted mean would instead give each listed price the same influence.

4. What should you check when C2:C5 is multiplied by D3:D6?
  • A. The ranges have equal lengths but their source rows are shifted
  • B. They must be correct because no error appears
  • C. Excel will match the Order IDs automatically

Answer A. Equal size is required for the computation. Correct record alignment is a separate condition the workbook owner must verify.

5. Which denominator belongs in a weighted average of Delivered orders?
  • A. The count of all records
  • B. The sum of weights for the same Delivered records
  • C. The sum of weights in the whole dataset regardless of status

Answer B. Both parts measure the same selected population. Adding excluded quantities to the denominator would change the meaning of the average.

6. Which sample order adds new value to the Pune-or-Delivered set beyond the Delivered rows?
  • A. BLK-1001
  • B. AMN-1003
  • C. BLK-1009

Answer C. BLK-1009 is the cancelled Pune order. The first two orders are already Delivered and therefore already qualify. They should still be counted once.

Interview questions with worked answers

How do you explain SUMPRODUCT to a beginner?

I show a table with quantity beside unit price. Each row's product has business meaning, and their sum is the total receipt amount. SUMPRODUCT performs that paired computation across aligned ranges. I check it against a helper column for one small sample.

Why can an expression with two equal-length ranges still be wrong?

The records might be offset or ordered differently. SUMPRODUCT uses corresponding positions rather than looking up order keys. I confirm each source row and keep fields together when sorting. If separate files arrive, I reconcile keys before treating their fields as pairs.

How do you prevent double-counting when either of two conditions qualifies?

I add per-row Boolean results, test whether the sum is greater than zero and use that result as a single mask. I include one order that passes both tests in my controls. Its amount should appear once, regardless of how many conditions it meets.

How would you check a weighted average of a subset?

I identify what is being measured and what acts as a weight. I multiply each eligible value by its weight, sum those contributions, then divide by the sum of the same eligible weights. I report the eligible count and test the empty selection separately.

When might SUMIFS be easier to maintain than SUMPRODUCT?

For a straightforward amount total with a few explicit criteria, SUMIFS often exposes the target and criteria directly. When I need to multiply several row fields, compute a weighted numerator or combine custom masks, SUMPRODUCT is useful. I choose the version a reviewer can verify from the intended rows.

Quick recall cards

  • Pair by row

    Multiply values from matching positions. Verify that positions represent the same records.

  • Equal dimensions

    Supply arrays with compatible matching dimensions for the paired calculation. Check both endpoints.

  • Boolean mask

    Convert TRUE to 1 and FALSE to 0 to include or exclude matching amounts.

  • AND

    Multiply inclusion flags. Both must be one for their row to contribute.

  • OR

    Test whether the sum of flags is positive before turning it into one inclusion.

  • Weighted average

    Divide the weighted sum by the sum of the same eligible weights. Report the population.

Next you will learn how to diagnose formula errors and valid-looking wrong answers. Keep the masked total and the helper-column reconciliation as examples. A correct-looking number still needs evidence that it evaluates the intended data.

Official Microsoft references

Continue practising: explore the existing Excel Task Hub for additional exercises.