How to Fix Excel AVERAGEIF VALUE Errors with Named Ranges
Question details
The user encounters a #VALUE! error when using the AVERAGEIF or AVERAGEIFS functions with named ranges.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating averages based on specific criteria using named ranges for criteria arrays and average arrays.
- Observed behavior
- The formula returns a #VALUE! error because the defined average range and criteria range are dimensionally misaligned or contain noncontiguous cells.
Open the Name Manager in your spreadsheet to review existing named range definitions and ensure no external links or broken #REF! errors are present inside your defined names.
Align the Named Ranges for Criteria and Average Data
Ensure that the size and dimensions of your criteria range perfectly match the average range to prevent #VALUE! errors.
AVERAGEIF and AVERAGEIFS functions require the criteria range and the corresponding average range to have the exact same dimensions. If one range is larger or shifted compared to the other, the function cannot map the cells correctly and returns a #VALUE! error.
Go to the Formulas tab on the ribbon and click on 'Name Manager' to view all defined names in the current workbook.
Select the named range used for your criteria (e.g., 'Headers') and check the 'Refers to' box to ensure it covers a specific dimension, such as B3:S3.
Select the named range for the values to average (e.g., '_SodiumT') and verify its dimension matches exactly, such as B15:S15. If it does not match, edit the range to equalize the column spans.
Re-enter your formula using the perfectly aligned ranges. For example: =AVERAGEIFS(_SodiumT, Headers, "Sodium")

Remove Noncontiguous Cells from Named Ranges
AVERAGEIF and AVERAGEIFS do not successfully process named ranges that reference multiple, separate cell blocks.
Handle Complex Formulas Effortlessly with WPS Spreadsheet
Use WPS Spreadsheet to define, manage, and troubleshoot named ranges and advanced formulas like AVERAGEIF and AVERAGEIFS seamlessly. It offers full compatibility with standard spreadsheet functions while delivering a fast, user-friendly experience.
- 1. Download and Install: Get WPS Office for free from the official website and open your spreadsheet file in WPS Spreadsheet.
- 2. Access Name Manager: Navigate to the 'Formulas' tab and click 'Name Manager' to review your range dimensions.
- 3. Edit and Correct Ranges: Ensure your average ranges and criteria ranges have identical row and column structures, then click 'OK'.
- 4. Output the Result: Type your =AVERAGEIFS() formula into the target cell and press Enter to get the accurate average without errors.

Frequently Asked Questions
Can I use entire columns like A:A for AVERAGEIFS named ranges?
Yes, you can use entire column references. However, both the criteria range and the average range must reference the exact same number of full columns (e.g., A:A and B:B) to avoid alignment-based #VALUE! errors.
Why does AVERAGEIF work but AVERAGEIFS returns #VALUE!?
AVERAGEIFS strictly requires all criteria ranges to be perfectly aligned with the average range in shape and size. AVERAGEIF is occasionally more forgiving and automatically resizes its internal arrays, but AVERAGEIFS enforces strict dimension matching across all arguments.
Does a blank cell in my named range cause a #VALUE! error?
No, blank cells or text values located within the average range are simply ignored by the AVERAGEIF and AVERAGEIFS functions. A #VALUE! error usually points to a structural issue, such as mismatched array sizes or noncontiguous cell references.




