How to Sum VLOOKUP Results Across Multiple Sheets Without #N/A Errors
Question details
The user wants to sum lookup values across multiple worksheets but encounters #N/A errors when a value is missing in one or more sheets. They need missing values to be treated as zero to get an accurate total.

- Product
- WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Consolidating matched data across multiple worksheets where some lookup values might not exist on every sheet.
- Observed behavior
- Combining VLOOKUP inside a SUM function returns an #N/A error if the lookup value is missing from any of the referenced sheets, causing the entire total to fail.
Ensure all referenced worksheet names are spelled correctly and that your lookup ranges (columns) are consistent across all worksheets before applying these formulas.
Replace VLOOKUP with SUMIF for Individual Sheets
Since the SUMIF function naturally returns 0 instead of an #N/A error when a value is missing, adding multiple SUMIFs prevents the calculation from breaking.
VLOOKUP is designed to return exactly what it finds, and if it finds nothing, it throws an error. SUMIF, on the other hand, adds up values that meet a condition. If the condition isn't met (the value isn't there), it simply adds zero.
Click on the cell in your main sheet where you want the combined total to appear.
Type =SUMIF('Sheet1'!$A$1:$A$10, A8, 'Sheet1'!$B$1:$B$10) replacing 'Sheet1' with your actual first sheet name, A8 with your lookup value, and the ranges with your actual data ranges.
Type a plus sign (+) at the end of the formula and add the next sheet's SUMIF: +SUMIF('Sheet2'!$A$1:$A$10, A8, 'Sheet2'!$B$1:$B$10).
Press Enter to calculate. You can now drag the fill handle down to copy this formula safely for other lookup values without risking #N/A errors.

Consolidate Dynamic Sheet Names Using SUMPRODUCT and INDIRECT
If you have many sheets, manually adding SUMIFs is tedious. You can list the sheet names in a range and use INDIRECT to sum across all of them at once.
Easily Manage Multi-Sheet Formulas in WPS Spreadsheet
WPS Spreadsheet provides robust formula support, including advanced functions like SUMIF, SUMPRODUCT, and INDIRECT. It allows you to effortlessly consolidate data across multiple worksheets with a highly intuitive interface.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your multiple worksheets.
- 2. Navigate to the summary sheet: Go to the main sheet where you need to combine the lookup totals.
- 3. Apply the SUMIF formula: Type the SUMIF or SUMPRODUCT formula exactly as you would in standard spreadsheet software.
- 4. Drag to fill: Use the fill handle to apply the formula to the rest of your dataset, calculating totals flawlessly.

Frequently Asked Questions
Why does VLOOKUP inside a SUM formula return #N/A?
If VLOOKUP cannot find an exact match in one of the sheets, it inherently returns an #N/A error. When the SUM function attempts to add an #N/A error to standard numbers, it cannot process the math, causing the entire final result to become #N/A.
Can I use IFERROR with VLOOKUP instead of SUMIF?
Yes, you can wrap your VLOOKUPs like this: =IFERROR(VLOOKUP(...), 0) + IFERROR(VLOOKUP(...), 0). This forces the error to become a zero. However, using SUMIF is widely considered more elegant and efficient because it natively returns zero for missing values without requiring an extra nested function.
What does the INDIRECT function do in the SUMPRODUCT formula?
The INDIRECT function takes a text string (like the sheet names you listed in cells K4:K11) and converts it into a valid cell reference that the spreadsheet engine can understand. This allows the SUMIF formula to dynamically look up data across multiple sheets without you needing to manually type out each sheet's name in the formula bar.




