Function Problems

How to Calculate Total Price from Item Quantities in Excel

Khadija KhanKhadija Khan Nov 10, 2026 868 views

Question details

The user needs to calculate the total amount due by multiplying item quantities by their respective unit prices and summing the results in a single formula.

How to Calculate Total Price from Item Quantities in Excel
Product
Excel
Device & OS
not provided
Scenario
Calculating an invoice total, order value, or inventory cost based on separate quantity and unit price data.
Observed behavior
Finding a fast and accurate way to obtain the grand total without manually creating intermediate subtotal columns for every single item.
Before you start

Ensure that your quantities and unit prices are arranged in parallel rows or columns of the exact same size, and verify that there is no text hidden in cells meant for numbers.

Solution 1Recommended

Use the SUMPRODUCT Function

This is the most efficient and recommended method to multiply corresponding items in multiple arrays and sum the results in a single step.

The SUMPRODUCT function is designed specifically for this scenario. It takes two or more arrays, multiplies their matching elements together, and then returns the sum of those products.

1
Select the destination cell

Click on the empty cell where you want the grand total price to appear.

2
Enter the SUMPRODUCT formula

Type =SUMPRODUCT( followed by your price range and quantity range separated by a comma. For example, if unit prices are in B1:F1 and quantities are in B2:F2, type =SUMPRODUCT(B2:F2,B1:F1).

3
Apply the formula

Press Enter to calculate the total. The function will automatically multiply each quantity by its unit price and add them up.

4
Format as Currency

Right-click the result cell, select 'Format Cells', choose 'Currency' or 'Accounting', and click OK to display the result as a monetary value.

Use the SUMPRODUCT Function
Using Structured References for Tables: If your prices and quantities are stored in an official Excel Table, you can use structured references instead of cell ranges, which automatically update when new rows are added. Example: =SUMPRODUCT(Orders[Quantity], Orders[Unit Price]).
Smart Data Calculation

Calculate Complex Formulas Effortlessly in WPS Spreadsheet

WPS Spreadsheet fully supports advanced mathematical functions like SUMPRODUCT, allowing you to calculate inventory totals, handle invoices, and process large datasets seamlessly.

  1. 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the quantities and prices.
  2. 2. Enter the SUMPRODUCT formula: Click the cell for your total, and type =SUMPRODUCT(.
  3. 3. Select your data ranges: Highlight your quantity array, type a comma, highlight your price array, type the closing parenthesis ), and press Enter.
  4. 4. Apply currency formatting: Select the result cell, navigate to the Home tab, and choose the Currency format from the number format dropdown.
Fully compatible with Microsoft Excel formulas and .xlsx filesUser-friendly interface tailored for efficient data managementRich library of built-in templates for invoices and inventoryLightweight software that runs smoothly on any device
microsoft office alternative - wps office

Frequently Asked Questions

Why am I getting a #VALUE! error when using SUMPRODUCT?

A #VALUE! error usually occurs if the ranges you selected are not exactly the same size (e.g., B1:F1 and B2:G2). It can also happen if one or more cells in the selected ranges contain text strings that cannot be multiplied.

Can I calculate the total if prices and quantities are in columns instead of rows?

Yes, the SUMPRODUCT function works exactly the same way for columns. You simply select the column ranges instead, such as =SUMPRODUCT(A2:A10, B2:B10).

Is there a way to only sum the prices of items that have a quantity greater than zero?

SUMPRODUCT inherently handles this because multiplying any unit price by a quantity of zero results in zero, which does not affect your final summed total.