Function Problems

Look Up Two Values and Return a Match in Excel

Bushra ParveenBushra Parveen Dec 2, 2026 868 views

Question details

Match two values from one worksheet against two columns on another worksheet and return a confirmation or related value.

Look Up Two Values and Return a Matching Result in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to check whether both values occur together in a row on another worksheet.
Observed behavior
The desired result is a confirmation or a value from the matching row.
Before you start

Identify the two input cells and the matching and return columns on the other worksheet. The examples use A2 and B2 as inputs and Sheet2 columns A, B, and C as the lookup and return columns.

Solution 1Recommended

Return a Matching Value with XLOOKUP

Use XLOOKUP in a supported Excel version to return a value when both criteria match the same row.

1
Select the result cell

On the worksheet containing the lookup values, select an empty cell such as C2.

2
Enter the formula

Type =XLOOKUP(1,(Sheet2!A2:A1000=A2)*(Sheet2!B2:B1000=B2),Sheet2!C2:C1000,"Not found") and press Enter.

3
Adjust the ranges

Replace Sheet2 and the cell ranges with your actual sheet name and data ranges. Keep all three lookup and return ranges the same size.

4
Copy the formula

Drag the result cell's fill handle down to apply the lookup to other rows.

Return a Matching Value with XLOOKUP
First match returned: If more than one row matches both criteria, XLOOKUP returns the value from the first matching row. If no row matches, it displays Not found.
WPS Spreadsheet

Confirm Two-Column Matches in WPS Spreadsheet

Use COUNTIFS in WPS Spreadsheet to check whether two values appear together on another worksheet and display a clear confirmation.

  1. 1. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
  2. 2. Select a result cell: On the worksheet with the lookup values, select an empty cell such as C2.
  3. 3. Enter the formula: Type =IF(COUNTIFS(Sheet2!A2:A1000,A2,Sheet2!B2:B1000,B2)>0,"Match","Not found") and press Enter.
  4. 4. Adjust and copy: Change the sheet and range references to fit your data, then drag the cell's fill handle down to check other rows.
Confirm two criteria in the same row with one formulaOpen and save Microsoft Excel XLSX filesWork with familiar spreadsheet formulas and worksheets
microsoft office alternative - wps office

Frequently Asked Questions

How do I return a value only when both criteria match?

Use XLOOKUP with multiplied comparisons, such as =XLOOKUP(1,(Sheet2!A2:A1000=A2)*(Sheet2!B2:B1000=B2),Sheet2!C2:C1000,"Not found"). Both comparisons must be true for the same row.

What happens if several rows match both values?

The XLOOKUP and INDEX/MATCH examples return the value from the first matching row. COUNTIFS can instead tell you how many rows match.

Can I check for a match without returning a value?

Yes. Enter =IF(COUNTIFS(Sheet2!A2:A1000,A2,Sheet2!B2:B1000,B2)>0,"Match","Not found") in an empty cell.

Why does my older Excel version not recognize XLOOKUP?

XLOOKUP is unavailable in some older Excel versions. Use the INDEX and MATCH alternative and press Ctrl+Shift+Enter if your version requires array formula entry.