How to Calculate Total Price from Item Quantities in Excel
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.

- 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.
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.
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.
Click on the empty cell where you want the grand total price to appear.
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).
Press Enter to calculate the total. The function will automatically multiply each quantity by its unit price and add them up.
Right-click the result cell, select 'Format Cells', choose 'Currency' or 'Accounting', and click OK to display the result as a monetary value.

Use Basic Multiplication and Addition
A straightforward arithmetic approach best suited for small, static datasets with only a few items to calculate.
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. Open your file in WPS Spreadsheet: Launch WPS Office and open your workbook containing the quantities and prices.
- 2. Enter the SUMPRODUCT formula: Click the cell for your total, and type =SUMPRODUCT(.
- 3. Select your data ranges: Highlight your quantity array, type a comma, highlight your price array, type the closing parenthesis ), and press Enter.
- 4. Apply currency formatting: Select the result cell, navigate to the Home tab, and choose the Currency format from the number format dropdown.

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.




