Use Excel INDEX and MATCH to Select Regional Data Dynamically
Question details
Select the appropriate regional data set and return a value for a chosen section and age.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains separate regional data ranges and selection cells for region, section, and age.
- Observed behavior
- The formula should select the region and return the value at the matching section and age.
Arrange each regional data range with sections in the same row order and ages in the same column order. Identify the selection cells and assign a name to each regional data range using Formulas > Define Name.
Use a lookup table to select a named regional range
Use this method when region selections need to map to named ranges and section labels should be matched exactly.
This example uses B4 for the region, B3 for the section, and B5 for the age. Section labels are in A11:A16, age headers are in B10:F10, and every named region covers a data block with the same layout.
Select each regional data block and choose Formulas > Define Name. For example, name B11:F16 Region_1 and I11:M16 Region_2.
In O3:P6, enter the region selections in column O and their corresponding range names as text in column P, such as Region_1.
Select the result cell and enter =INDEX(INDIRECT(VLOOKUP($B$4,$O$3:$P$6,2,FALSE)),MATCH($B$3,$A$11:$A$16,0),MATCH($B$5,$B$10:$F$10,0)). Adjust the references to match your worksheet.
Change the region in B4, section in B3, and age in B5. Check that the result comes from the expected row and column of the selected region.

Use the INDEX reference form to select a numbered region
Use this shorter formula when region and section selections end in single-digit numbers corresponding to their positions.
Look up regional data with WPS Spreadsheets
Use named ranges, a region mapping table, and INDEX with MATCH in WPS Spreadsheets to return the value for a selected region, section, and age.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Name the data blocks: Select each regional data block and use Formulas > Define Name to assign names such as Region_1 and Region_2.
- 3. Map regions to names: Enter region selections in O3:O6 and their corresponding range names as text in P3:P6.
- 4. Enter the lookup formula: In the result cell, enter =INDEX(INDIRECT(VLOOKUP($B$4,$O$3:$P$6,2,FALSE)),MATCH($B$3,$A$11:$A$16,0),MATCH($B$5,$B$10:$F$10,0)). Adjust the cell references for your workbook.
- 5. Test and save: Change the selections in B3, B4, and B5 to test the result, then use File > Save As to save the workbook as XLSX.

Frequently Asked Questions
Why does the lookup formula return #N/A?
Check that B4 matches a region in O3:O6, B3 matches a section in A11:A16, and B5 matches an age in B10:F10. VLOOKUP and MATCH use exact matches in the example.
Why does INDIRECT return a reference error?
Check that the range name returned from column P is spelled correctly and exists under Formulas > Name Manager or Define Name. A misspelled or deleted name cannot be resolved.
Can I use sections with labels instead of numbers?
Yes. Use the lookup-table formula with MATCH($B$3,$A$11:$A$16,0) to find the section by its exact label rather than extracting a number with RIGHT.
What if my region number has more than one digit?
The reference-form example uses RIGHT(B4), which reads only the final character. Use the lookup-table method or revise the formula to extract the complete number.




