How to Fix the #NAME? Error with IFERROR and QUERY in Excel
Question details
The user is attempting to filter spreadsheet data using IFERROR and QUERY but receives a #NAME? error instead of the expected output.

- Product
- Spreadsheets (Excel / Google Sheets)
- Device & OS
- not provided
- Scenario
- Trying to query and extract data from a specific sheet based on multiple text conditions using an SQL-like query string.
- Observed behavior
- The spreadsheet application fails to recognize the formula and returns a #NAME? error, often because a Google Sheets-exclusive function is being used in Microsoft Excel.
Verify which spreadsheet software you are using. The QUERY function is exclusive to Google Sheets; using it in Microsoft Excel or WPS Office will natively trigger a #NAME? error.
Use the FILTER Function in Excel or WPS Office
Since the QUERY function is not supported outside of Google Sheets, replace it with the FILTER function to achieve the same data extraction without encountering the #NAME? error.
Microsoft Excel and WPS Spreadsheet do not recognize the 'QUERY' syntax. Instead, they use the 'FILTER' function to conditionally extract data from a range.
Click on the empty cell where you want the extracted data to appear.
Type the equivalent FILTER function to replicate the 'OR' logic of your query. For example: =FILTER(Issues!A:A, (Issues!G:G="New Issue") + (Issues!G:G="Fix in Progress"))
To prevent error messages when no data matches, wrap the entire formula by typing: =IFERROR(FILTER(Issues!A:A, (Issues!G:G="New Issue") + (Issues!G:G="Fix in Progress")), "No issues found")
Press the Enter key. The application will pull column A data where column G matches either condition, bypassing the #NAME? error.

Correct the Syntax in Google Sheets
If you are actively using Google Sheets and still see the #NAME? error, it indicates a typo in the function name or sheet reference.
Filter and Analyze Data Seamlessly with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas, allowing you to easily extract, filter, and handle data without worrying about #NAME? errors. It serves as a highly compatible alternative to Microsoft Excel.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your raw data.
- 2. Use advanced array formulas: Type =FILTER( in your destination cell to start selecting your conditional data arrays.
- 3. Handle empty results gracefully: Combine it seamlessly by wrapping your array in =IFERROR() to ensure clean, presentation-ready spreadsheets.

Frequently Asked Questions
Why does the QUERY function return a #NAME? error in Microsoft Excel?
The QUERY function is a proprietary feature built specifically for Google Sheets. Because Microsoft Excel and WPS Spreadsheet do not have a built-in function named 'QUERY', the software flags it as an unrecognized name, resulting in a #NAME? error.
What is the best alternative to the QUERY function in Excel or WPS?
The FILTER function is the best lightweight alternative for extracting and filtering data dynamically based on criteria. For more complex, SQL-like data manipulation across large datasets, you can use Power Query or Pivot Tables.
How does the IFERROR function work alongside array formulas?
IFERROR evaluates your main formula first. If the formula returns an error (such as #N/A when a FILTER or QUERY finds no matching records), IFERROR steps in to display an alternative value you specify, like 'Not Found', or simply leaves the cell blank instead of showing an ugly error code.




