Skip to content
Math

Sum of Products Calculator

Enter two comma-separated lists of numbers and this calculator multiplies each pair of corresponding values, sums those products, and shows every step of the working. You also get the weighted average (when Series A holds values and Series B holds weights), the number of pairs, and an instant check on whether the datasets are the same length.

Your details

The first list of numbers. Separate values with commas. Decimals and negatives are supported.
The second list of numbers, same length as Series A. Each value is multiplied with the corresponding value in Series A.
Choose how to interpret the two series. The main SOP result is the same for all modes; the extra output changes.
Sum of Products
100

The total of all a_i x b_i products

Number of Pairs4
Weighted Average / Cov. Component-
Sum of Series A20
Sum of Series B16
Mean of Series A5
Mean of Series B4
Length checkBoth series have 4 elements
Sum A20
Sum B16
Sum of Products100
050100134
Pair index
  • Product at each step
  • Cumulative SOP

Sum of products: 100

  • The sum of products of the two series is 100, calculated from 4 pairs.
  • The mean of Series A is 5 and the mean of Series B is 4.
  • A positive sum of products indicates the values in the two series tend to move in the same direction.

Next stepTry switching to "Weighted average" mode if Series B holds weights, or "Covariance component" to explore how the series co-vary.

Product-by-product breakdown

Paira_ib_ia_i x b_iRunning SOP
12122
2431214
3653044
48756100

Running SOP shows the cumulative sum after adding each product.

Formula

SOP=i=1naibi=a1b1+a2b2++anbn\text{SOP} = \sum_{i=1}^{n} a_i \cdot b_i = a_1 b_1 + a_2 b_2 + \cdots + a_n b_n

Worked example

With Series A = [2, 4, 6, 8] and Series B = [1, 3, 5, 7]: products are 2x1=2, 4x3=12, 6x5=30, 8x7=56. SOP = 2+12+30+56 = 100.

What is the sum of products?

The sum of products (SOP) multiplies each pair of corresponding values from two series and adds the results together. If Series A = [a1, a2, ..., an] and Series B = [b1, b2, ..., bn], then SOP = a1xb1 + a2xb2 + ... + anxbn. It is sometimes called a dot product or inner product in linear algebra, and it appears in statistics (as the numerator of covariance and Pearson's correlation), finance (as a weighted portfolio return), signal processing (as a convolution step), and machine learning (as the core of every neuron in a neural network). The key requirement is that both series must have the same length: each element in Series A is paired with exactly one element in Series B.

How to calculate the sum of products step by step

Step 1: write both series side by side and confirm they are the same length. Step 2: for each position i, multiply a_i by b_i to get the product. Step 3: add all the products together. For example, with A = [3, 5, 2] and B = [4, 1, 6]: the products are 3x4=12, 5x1=5, 2x6=12, and the SOP is 12+5+12 = 29. The calculator shows every one of these multiplication steps in the "Show your work" panel so you can verify each pair.

Weighted average using sum of products

A weighted average is a special use of the SOP formula. When Series A holds the values and Series B holds their weights, the weighted average is SOP / sum(B). For instance, if a student scores 80, 90, and 70 on tests worth 3, 4, and 3 credits respectively, the SOP is 80x3+90x4+70x3 = 240+360+210 = 810, and the weighted average is 810 / (3+4+3) = 81. This correctly gives more influence to the 4-credit test than to the 3-credit ones. The "Weighted average" mode in this calculator performs that division for you automatically.

Covariance and the mean-centred SOP

Covariance measures how two variables move together. The sample covariance formula is: cov(A, B) = sum((a_i - mean_A)(b_i - mean_B)) / (n - 1). The numerator of that expression, sum((a_i - mean_A)(b_i - mean_B)), is the mean-centred sum of products. Selecting "Covariance component" mode returns that numerator. A positive value means the two series tend to rise and fall together; a negative value means they tend to move in opposite directions; zero means no linear relationship. To obtain the full sample covariance, divide the result by (n - 1).

Sum of products in common formulas

FormulaHow SOP appearsDivide by
Dot product (linear algebra)SOP = sum(a_i x b_i)Nothing (SOP is the result)
Weighted averageSOP = sum(value_i x weight_i)sum(weights)
Sample covarianceSOP of mean-centred valuesn - 1
Pearson correlationSOP of z-scored valuesn - 1
Portfolio return (WACC)SOP = sum(return_i x weight_i)sum(weights) = 1
Least-squares regression slopeSOP of (x - x-bar)(y - y-bar)SOP of (x - x-bar)^2

Many standard statistical and financial formulas rely on the SOP as a building block.

Frequently asked questions

What happens if the two series are different lengths?

Only the overlapping pairs (up to the length of the shorter series) are used. The calculator displays a warning in the "Length check" output so you can spot the mismatch and fix it. If you intended to include all elements, pad the shorter series with zeros.

Can I use negative numbers or decimals?

Yes. Any finite number is accepted, including negatives, decimals, and fractions entered as decimals (e.g. 0.5). If any product is negative, it reduces the running total; if positive, it increases it. The final SOP can therefore be negative, zero, or positive depending on the mix of signs.

What does a sum of products of zero mean?

A SOP of zero can arise in two ways: either at least one series consists entirely of zeros, or the positive and negative products cancel each other exactly. In a statistical context, a mean-centred SOP of zero signals no linear relationship (zero covariance) between the two variables.

How does this relate to the dot product in linear algebra?

They are the same operation. In linear algebra the dot product of two vectors a and b is defined as the sum of the element-wise products, which is exactly what this calculator computes. The dot product is positive when the angle between the vectors is less than 90 degrees, zero when they are perpendicular (orthogonal), and negative when the angle exceeds 90 degrees.

Can I extend the sum of products to three or more series?

The classic two-series formula does not generalise directly to three series in a single scalar result (a triple product would require a different definition). The most common approach is to compute the SOP of two series, then use that result as one series in a further computation. For example, to weight values by two criteria, compute the combined weight first.

What is the difference between weighted average mode and standard SOP?

Standard SOP mode returns the raw total, sum(a_i x b_i). Weighted average mode divides that total by the sum of the weights (Series B), giving the mean value with Series A values weighted by Series B. Use weighted average when the weights represent proportions or importance scores and you want a single representative value rather than a raw total.

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…