← All how-to recipes

How to multiply two columns (and total the result)

✓ Verified in LibreOffice 25.8.7.3

Multiply values row by row — like quantity × price — and get the grand total.

The formula

AppFormulaNotes
Excel=SUMPRODUCT(A2:A5,B2:B5)One-cell grand total. For per-row results, =A2*B2 filled down.
Google Sheets=SUMPRODUCT(A2:A5,B2:B5)Identical; ARRAYFORMULA(A2:A5*B2:B5) spills per-row products.
LibreOffice Calc=SUMPRODUCT(A2:A5,B2:B5)Identical.

How it works

For a per-row result, =A2*B2 filled down is all there is to it. But if you only need the total, SUMPRODUCT multiplies each pair and sums in one step: 2×10 + 3×20 + 1×50 + 4×5 = 150 — no helper column. It's the standard pattern for order totals, weighted scores, and hours × rate timesheets.

Verified, not just documented

We ran =SUMPRODUCT(A2:A5,B2:B5) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 150 — exactly the expected result. Every formula here is confirmed by actually executing it.