logo
search
Formula Errors

How to Fix the #NAME? Error with IFERROR and QUERY in Excel

Chanuka GeekiyanageChanuka Geekiyanage Sep 28, 2026 869 views

Question details

The user is attempting to filter spreadsheet data using IFERROR and QUERY but receives a #NAME? error instead of the expected output.

How to Fix the #NAME? Error with IFERROR and QUERY
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

Click on the empty cell where you want the extracted data to appear.

2
Enter the FILTER array formula

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"))

3
Wrap the formula in IFERROR

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")

4
Execute the formula

Press the Enter key. The application will pull column A data where column G matches either condition, bypassing the #NAME? error.

Use the FILTER Function in Excel or WPS Office
Formula Compatibility: The FILTER function is fully supported in modern versions of Excel and WPS Spreadsheet and serves as the best direct alternative to QUERY.

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. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your raw data.
  2. 2. Use advanced array formulas: Type =FILTER( in your destination cell to start selecting your conditional data arrays.
  3. 3. Handle empty results gracefully: Combine it seamlessly by wrapping your array in =IFERROR() to ensure clean, presentation-ready spreadsheets.
Fully compatible with Microsoft Office Excel formulas including FILTER, VLOOKUP, and IFERRORFree, lightweight, and fast execution for large spreadsheet datasetsFamiliar tabbed interface requiring zero learning curve for Excel users
microsoft office alternative - wps office

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.