Excel INDEX MATCH Formula for a Date and Organization Code
Question details
Find a value in a two-dimensional table using an organization code for the row and a date for the column.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A lookup table has organization codes in row labels and dates in column headers, and the source may be on another sheet or in another workbook.
- Observed behavior
- The desired result is the value at the intersection of the matching organization code and date.
Identify the value range, organization-code column, and date-header row in your source table. Check that the lookup date and header dates are actual date values rather than text.
Use INDEX and two MATCH functions to find the intersection
Use this formula when organization codes label rows and dates label columns in a two-dimensional table.
The first MATCH finds the organization-code row, and the second finds the date column. INDEX returns the value at their intersection. The row-label range must align with the value range's rows, and the header range must align with its columns.
Place the organization code in cell A3 and the lookup date in cell B2. In this example, source codes are in A14:A22, dates are in B13:G13, and values are in B14:G22.
Select the result cell and enter =INDEX($B$14:$G$22,MATCH($A3,$A$14:$A$22,0),MATCH(B$2,$B$13:$G$13,0)). Press Enter to return the value where the matching row and column meet.
If the source table is on a sheet named Data, enter =INDEX(Data!$B$14:$G$22,MATCH($A3,Data!$A$14:$A$22,0),MATCH(B$2,Data!$B$13:$G$13,0)). Adjust the sheet name and ranges to match your workbook.
If the source is on the Data sheet in Source.xlsx, open that workbook and enter =INDEX('[Source.xlsx]Data'!$B$14:$G$22,MATCH($A3,'[Source.xlsx]Data'!$A$14:$A$22,0),MATCH(B$2,'[Source.xlsx]Data'!$B$13:$G$13,0)). Excel may add a file path to the references.

Match Dates and Organization Codes in WPS Spreadsheet
Use INDEX and MATCH in WPS Spreadsheet to find the value at the intersection of an organization-code row and a date column.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to choose your Excel workbook.
- 2. Identify the ranges: Locate the organization codes, date headers, and value table. Enter the code to find in A3 and the date to find in B2, or adjust the formula for your cells.
- 3. Enter the lookup formula: Select the result cell and enter =INDEX($B$14:$G$22,MATCH($A3,$A$14:$A$22,0),MATCH(B$2,$B$13:$G$13,0)). Press Enter.
- 4. Check the result: If the cell shows #N/A, compare the lookup code and date with the source labels and check that dates are stored as date values.

Frequently Asked Questions
Why does the formula return #N/A when the date looks correct?
The lookup date or header may be stored as text, or one may include a time component. Check the underlying values and convert text to dates or remove the time component before matching.
How do I use a sheet name that contains spaces?
Enclose the sheet name in single quotes before the exclamation mark, as in 'Source Data'!$B$14:$G$22. Apply the sheet reference to each source range in the formula.
What happens if an organization code or date appears more than once?
MATCH with 0 returns the position of the first exact match. If labels are duplicated, the formula uses the first matching row and the first matching column.
Can I copy the formula across and down?
Yes. With $A3 and B$2, copying down changes the lookup row, while copying across changes the lookup column. The dollar signs keep the source ranges fixed.




