Formula Errors

Match a Name and Date in Excel with IF, AND, and VLOOKUP

Ayan MasoodAyan Masood Dec 2, 2026 868 views

Question details

The user needs to match a name and date on Sheet2 and return the corresponding value from the sixth column.

Match a Name and Date in Excel with IF, AND, and VLOOKUP
Product
Microsoft Excel
Device & OS
not provided
Scenario
A formula uses the name in B2 and date in AK2 to look up a value in Sheet2 columns A through F.
Observed behavior
The original formula has misplaced parentheses and separates the AND conditions incorrectly.
Before you start

Check that Sheet2 column A contains names, column B contains dates, and column F contains the values to return. Make sure AK2 and the dates on Sheet2 are stored as dates with matching time values.

Solution 1Recommended

Use INDEX and MATCH to check both criteria on the same row

Use this method when a name can appear more than once with different dates.

1
Enter the lookup formula

Select the result cell and enter =IFERROR(INDEX(Sheet2!F2:F1000,MATCH(1,(Sheet2!A2:A1000=B2)*(Sheet2!B2:B1000=AK2),0)),"").

2
Confirm the formula

Press Enter in a current version of Excel. In older Excel versions, press Ctrl+Shift+Enter to confirm it as an array formula.

3
Check the result

Compare the returned value with column F on Sheet2. Adjust all three ranges to cover your data while keeping their start and end rows aligned.

Use INDEX and MATCH to check both criteria on the same row
First matching row: If several rows have the same name and date, the formula returns the value from the first matching row. IFERROR displays a blank for any formula error, not just a missing match.
Match two criteria in WPS Spreadsheets

Look up a Name and Date in WPS Spreadsheets

Use INDEX and MATCH in WPS Spreadsheets to find a row matching both criteria and return its value from column F.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Check the source columns: Select Sheet2 and confirm that names are in column A, dates are in column B, and return values are in column F.
  3. 3. Enter the formula: On the sheet containing B2 and AK2, select a result cell and enter =IFERROR(INDEX(Sheet2!F2:F1000,MATCH(1,(Sheet2!A2:A1000=B2)*(Sheet2!B2:B1000=AK2),0)),"").
  4. 4. Confirm and review: Press Enter and check the result against Sheet2. If your WPS version requires array-formula entry, use Ctrl+Shift+Enter instead.
Match a name and date on the same rowWork with Microsoft Excel XLSX and XLS filesEdit and review formulas in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return a blank when the name and date exist?

VLOOKUP checks the first row with the name in Sheet2 column A. If its date does not match AK2, the formula returns a blank even when a later row matches. Use the INDEX and MATCH formula to check both criteria on each row.

How do I return a different column from Sheet2?

In the INDEX and MATCH formula, replace Sheet2!F2:F1000 with the desired return-column range, keeping the same starting and ending rows as the criteria ranges.

Why do matching-looking dates fail the lookup?

A date may be stored as text or include a time value. Check AK2 and Sheet2 column B, and make sure the underlying date and time values match, not just their displayed formatting.

What happens if more than one row matches both criteria?

The INDEX and MATCH formula returns the column F value from the first matching row in the specified range.