How to Validate Product Totals Across Excel Columns Using SUMIFS
Question details
The user wants to verify if the stated total product count for an invoice matches the actual sum of individual product counts listed in the dataset.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Auditing or verifying invoice data where total counts and individual item counts are recorded in different columns.
- Observed behavior
- Needs a formula to automatically compare the aggregated sum of individual items against a provided total, returning a clear TRUE or FALSE status.
Ensure your dataset is organized with clear, separate columns for invoice numbers, stated total counts, and individual product counts without any merged cells.
Use SUMIFS and Logical Comparison to Validate Totals
Apply a SUMIFS formula to aggregate individual counts per invoice and compare it directly to the stated total.
This method uses the SUMIFS function to add up all individual product counts that share the same invoice number, and then uses an equals sign (=) to check if that sum matches the total count provided in another column.
Assume your Invoice Numbers are in column A, the stated Total Counts are in column C, and the Individual Counts are in column D.
Click on cell E2 (or your first blank validation cell) and enter the formula: =SUMIFS($D$2:$D$1000,$A$2:$A$1000,$A2)=$C2. Make sure to adjust the ranges $D$2:$D$1000 and $A$2:$A$1000 to match your actual data rows.
Press Enter, then drag the fill handle (the small square at the bottom-right of cell E2) down to apply this formula to the rest of your rows.
The formula will return TRUE if the calculated sum perfectly matches the stated total, and FALSE if there is any discrepancy.

Easily Validate and Calculate Data with WPS Spreadsheet
WPS Spreadsheet offers powerful functions like SUMIFS, making it incredibly easy to validate data, audit invoices, and ensure your numbers are perfectly accurate.
- 1. Open your data in WPS Spreadsheet: Launch WPS Office and open your invoice or inventory workbook.
- 2. Apply the SUMIFS formula: Select an empty column and input the SUMIFS logical comparison formula to check your totals.
- 3. Highlight errors with Conditional Formatting: Go to the Home tab, select Conditional Formatting, and use the formula rule to highlight mismatched rows instantly.

Frequently Asked Questions
Why does my SUMIFS formula return an error instead of TRUE or FALSE?
This usually happens if the ranges in your formula are not the same size. Ensure that your sum range (e.g., $D$2:$D$1000) and criteria range (e.g., $A$2:$A$1000) have the exact same number of rows.
Can I use SUMIF instead of SUMIFS for this validation?
Yes, if you only have one condition (like matching the invoice number), you can use SUMIF. The syntax would be =SUMIF($A$2:$A$1000, $A2, $D$2:$D$1000)=$C2. However, SUMIFS is often preferred as it easily allows adding more conditions later.
How can I highlight the FALSE results using Conditional Formatting?
Select your data range, go to Home > Conditional Formatting > New Rule. Choose 'Use a formula to determine which cells to format', enter your formula =SUMIFS($D$2:$D$1000,$A$2:$A$1000,$A2)<>$C2 (using <> to specifically find mismatches), and set a noticeable fill color like red.
What if my invoice numbers are stored as text in one column and numbers in another?
SUMIFS requires exact matches. If data types differ, the formula will not recognize them as matches and will calculate the sum as 0, resulting in FALSE. You can use the VALUE function or the Text to Columns tool to ensure all invoice numbers are formatted consistently.




