Look Up Two Values and Return a Match in Excel
Question details
Match two values from one worksheet against two columns on another worksheet and return a confirmation or related value.

- 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.
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.
Return a Matching Value with XLOOKUP
Use XLOOKUP in a supported Excel version to return a value when both criteria match the same row.
On the worksheet containing the lookup values, select an empty cell such as C2.
Type =XLOOKUP(1,(Sheet2!A2:A1000=A2)*(Sheet2!B2:B1000=B2),Sheet2!C2:C1000,"Not found") and press Enter.
Replace Sheet2 and the cell ranges with your actual sheet name and data ranges. Keep all three lookup and return ranges the same size.
Drag the result cell's fill handle down to apply the lookup to other rows.

Return a Matching Value with INDEX and MATCH
Use this alternative when your Excel version does not include XLOOKUP.
Confirm a Two-Column Match with COUNTIFS
Use COUNTIFS when you only need to confirm whether both values appear together on another worksheet.
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. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
- 2. Select a result cell: On the worksheet with the lookup values, select an empty cell such as C2.
- 3. Enter the formula: Type =IF(COUNTIFS(Sheet2!A2:A1000,A2,Sheet2!B2:B1000,B2)>0,"Match","Not found") and press Enter.
- 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.

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.




