terican

Last verified · v1.0

Calculator · math

Sum Product Calculator

Enter up to five value pairs across two arrays to calculate their SUMPRODUCT — the sum of all element-wise products. Ideal for weighted averages and dot products.

FreeInstantNo signupOpen source

Inputs

Result

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Result

The formula

How the
result is
computed.

What Is the Sum Product Calculator?

The sum product calculator computes the dot product of two numeric arrays by multiplying each pair of corresponding elements and then adding all resulting values together. For arrays A = [a₁, a₂, …, aₙ] and B = [b₁, b₂, …, bₙ] of equal length n, the governing formula is:

SUMPRODUCT(A, B) = Σ aᵢ · bᵢ = a₁b₁ + a₂b₂ + … + aₙbₙ

This operation appears throughout mathematics, statistics, finance, and physics under several names — dot product, inner product, scalar product — but the arithmetic is always identical: element-wise multiplication followed by summation.

Variables Explained

  • Array A (a₁ through a₅): The first operand array containing up to five numeric values. These might represent prices, scores, probabilities, or force components depending on context.
  • Array B (b₁ through b₅): The second operand array where each entry pairs with the corresponding entry in Array A. These might represent quantities, weights, probabilities, or displacement values.
  • n (active pairs): The number of element pairs to include. Set any unused aᵢ or bᵢ slot to 0 to exclude it without affecting active pairs.
  • Calculation Mode: Selects the type of sum-product operation to perform, allowing the calculator to adapt to different analytical contexts.

Step-by-Step Calculation Example

Consider a retailer tracking three products. Array A holds unit prices [12, 25, 8] and Array B holds units sold [50, 30, 120]. Total revenue equals:

SUMPRODUCT = (12 × 50) + (25 × 30) + (8 × 120) = 600 + 750 + 960 = 2,310

This single calculation replaces three separate multiplications and a final addition, illustrating why SUMPRODUCT is a foundational operation in business analysis and spreadsheet modeling.

Weighted Average via SUMPRODUCT

One of the most practical real-world uses of SUMPRODUCT is computing a weighted mean. Let Array A contain values [70, 85, 90] and Array B contain weights [0.20, 0.30, 0.50]. The weighted average is:

Weighted Average = SUMPRODUCT(A, B) ÷ SUM(B) = (70 × 0.20 + 85 × 0.30 + 90 × 0.50) ÷ 1.00 = (14 + 25.5 + 45) ÷ 1.00 = 84.5

The U.S. Department of Labor employs this exact technique when producing nationally representative employment statistics from the National Agricultural Workers Survey, where each observation is multiplied by its sampling weight before summing. The full methodology appears in the DOL NAWS Public Access Data guide.

Expected Value of a Discrete Random Variable

In probability theory, the expected value E(X) of a discrete random variable is defined as:

E(X) = Σ xᵢ · P(xᵢ)

This is precisely the SUMPRODUCT of the outcome array and its corresponding probability array. For a fair six-sided die, outcomes [1, 2, 3, 4, 5, 6] each occur with probability 1/6 ≈ 0.1667, giving E(X) = 21 ÷ 6 = 3.5. Oxford Emory's Math Center demonstrates this approach for computing expectations directly from probability distribution tables in their Tech Tips: Random Variables Described by Tables resource.

Practical Applications

  • Finance: Portfolio return = SUMPRODUCT(asset weight array, individual return array).
  • Physics: Mechanical work = SUMPRODUCT(force vector, displacement vector), measured in joules.
  • Education: GPA = SUMPRODUCT(grade-point values, credit hours) ÷ total credit hours.
  • Machine Learning: Every neuron in a neural network computes a SUMPRODUCT of input values and synaptic weights before applying an activation function.
  • Statistics: Sample covariance, Pearson correlation, and ordinary least-squares regression coefficients all reduce to SUMPRODUCT expressions over deviation arrays.

Key Properties

SUMPRODUCT is commutative: SUMPRODUCT(A, B) = SUMPRODUCT(B, A). It is also distributive over addition, meaning SUMPRODUCT(A+C, B) = SUMPRODUCT(A, B) + SUMPRODUCT(C, B). When every element of B equals 1, SUMPRODUCT reduces to the ordinary sum of A. When any corresponding pair (aᵢ, bᵢ) includes a zero, that pair contributes nothing to the total, allowing selective inclusion or exclusion of terms by zeroing unwanted slots.

Understanding and mastering SUMPRODUCT unlocks powerful analytical capabilities for data analysis, statistical modeling, and mathematical applications across numerous professional domains and industries.

Reference

Frequently asked questions

What is a sum product calculator used for?
A sum product calculator multiplies corresponding elements across two arrays and sums all the results in one step. Common applications include computing weighted averages, total revenue from price and quantity arrays, dot products in physics and machine learning, expected values in probability theory, and GPA calculations where grade points are weighted by credit hours. Any scenario requiring element-wise multiplication followed by summation benefits from this single operation.
How is SUMPRODUCT different from multiplying two sums?
SUMPRODUCT multiplies each pair of corresponding elements first, then sums all products. Multiplying two sums instead distributes every element of one array against every element of the other, producing a different and usually larger result. For arrays [2, 3] and [4, 5]: SUMPRODUCT = (2×4) + (3×5) = 8 + 15 = 23, whereas (2+3) × (4+5) = 5 × 9 = 45. The two operations are mathematically unrelated.
How do you calculate a weighted average using the sum product calculator?
Enter the data values in Array A and their corresponding weights in Array B, then divide the SUMPRODUCT result by the sum of all weights. For exam scores [60, 80, 90] with weights [0.2, 0.3, 0.5], SUMPRODUCT = (60×0.2) + (80×0.3) + (90×0.5) = 12 + 24 + 45 = 81. Dividing by the total weight of 1.0 yields a weighted average of 81. This approach works for any weighting scheme, including non-normalized weights.
How many values can the sum product calculator handle?
The calculator supports up to five value pairs using fields a₁ through a₅ for Array A and b₁ through b₅ for Array B. To use fewer than five pairs, leave unused slots at the default value of 0. Those zero-valued pairs contribute nothing to the final sum and do not distort the result. For datasets with more than five elements, split the calculation into segments of up to five pairs and add the partial SUMPRODUCT results together.
Is SUMPRODUCT the same as a dot product?
Yes. SUMPRODUCT and the mathematical dot product are identical operations: multiply corresponding elements and sum all products. In physics, the dot product of force vector [3, 4] newtons and displacement vector [2, 5] meters equals (3×2) + (4×5) = 26 joules of mechanical work done. In machine learning, every neuron in a neural network layer computes a dot product of its input values and learned weights before passing the scalar result through a nonlinear activation function.
Can SUMPRODUCT compute the expected value of a probability distribution?
Yes. The expected value E(X) of a discrete random variable is defined as the sum of each outcome multiplied by its probability, which equals SUMPRODUCT(outcomes, probabilities). For a variable with outcomes [1, 2, 3, 4] and probabilities [0.1, 0.4, 0.3, 0.2], E(X) = (1×0.1) + (2×0.4) + (3×0.3) + (4×0.2) = 0.1 + 0.8 + 0.9 + 0.8 = 2.6. This represents the long-run average outcome across many repeated trials of the random experiment.