Function Problems

How to Match Two Criteria and Return an Invoice Number in Excel

Nimra MalikNimra Malik Nov 2, 2026 869 views

Question details

The user needs a formula to look up and return an invoice number based on matching two specific conditions simultaneously, such as a customer name and a completion status.

How to Match Two Criteria and Return an Invoice Number in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Looking up and retrieving specific invoice numbers from a dataset when two distinct corresponding criteria are met.
Observed behavior
The goal state is to extract matching invoice numbers using an efficient formula, overcoming 'invalid function' errors in older Excel versions.
Before you start

Ensure your dataset is organized with clear column headers and no merged cells. Identify the exact columns containing your criteria and the column containing the invoice numbers before writing the formula.

Solution 1Recommended

Use the FILTER Function in Microsoft 365

The FILTER function is the most efficient dynamic array method to handle multiple criteria and return matching values.

The FILTER function allows you to extract data based on criteria you define. By multiplying two conditions together using an asterisk, you can create a logical 'AND' statement, ensuring both criteria are met before returning the invoice number.

1
Select the Destination Cell

Click on the empty cell where you want the matching invoice number to appear on your worksheet.

2
Start the FILTER Formula

Type =FILTER( to begin the formula, then highlight the range containing your invoice numbers (e.g., A2:A10).

3
Define the First Criterion

Type a comma to proceed to the 'include' argument. Open a parenthesis, highlight your first criteria range (e.g., B2:B10), type an equals sign, and select your criteria target cell (e.g., F2). Close the parenthesis.

4
Define the Second Criterion

Type an asterisk to represent 'AND'. Open another parenthesis, highlight your second criteria range (e.g., C2:C10), type an equals sign, and select your second target cell (e.g., G2). Close the parenthesis.

5
Execute the Formula

Close the final parenthesis so your formula looks like =FILTER(A2:A10,(B2:B10=F2)*(C2:C10=G2)) and press Enter. The matching invoice numbers will populate instantly.

Use the FILTER Function in Microsoft 365
Version Compatibility Check: The FILTER function is only available in Microsoft 365 and Excel 2021 or later. If you see a 'That function isn't valid' message, proceed to the INDEX and MATCH solution.
Efficient Data Processing

Easily Match Multiple Criteria in WPS Spreadsheet

WPS Office provides a highly compatible spreadsheet application where you can easily use advanced lookup formulas, including FILTER and INDEX/MATCH, to quickly retrieve data based on multiple conditions.

  1. 1. Open Your Workbook: Launch WPS Office and open your dataset containing the invoice numbers in WPS Spreadsheet.
  2. 2. Select the Result Cell: Click on the specific cell where you want the matched invoice number to be returned.
  3. 3. Input the Lookup Formula: Type your preferred multiple-criteria formula, such as =FILTER(A2:A10,(B2:B10=F2)*(C2:C10=G2)).
  4. 4. Press Enter to Retrieve Data: Press Enter on your keyboard to instantly calculate and view the matched results.
Free to use with a clean, user-friendly interface.Fully compatible with Microsoft Excel formulas and .xlsx file formats.Supports advanced dynamic arrays and the latest lookup functions to quickly match multiple criteria.
microsoft office alternative - wps office

Frequently Asked Questions

Why am I getting a 'That function isn't valid' error when using FILTER?

This error typically occurs because the FILTER function is only supported in Microsoft 365, Excel 2021, and newer versions. For older versions of Excel, you must use an alternative method like the INDEX and MATCH array formula.

How do I return multiple invoice numbers that match the same criteria?

The FILTER function is designed as a dynamic array. If multiple rows in your dataset match both of your criteria, the function will automatically 'spill' the results into the adjacent cells downwards, returning all matching invoice numbers at once.

Can I use 'OR' logic instead of 'AND' logic in the FILTER function?

Yes. To use 'OR' logic (where either the first OR the second condition is met), replace the asterisk (*) with a plus sign (+) between the criteria arrays in your formula.