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.
Inputs
Result
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
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