How to Use Excel INDEX and MATCH Formula for Repeating Groups
Question details
The user needs an INDEX and MATCH formula to return a correct supplier or value when data is arranged in horizontally repeating groups, and wants to know how to adjust the formula when adding new fields to the groups.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Extracting specific supplier data from a spreadsheet where records are organized in consistent, repeating sets of columns.
- Observed behavior
- The user needs a working formula to calculate the correct column offset and needs help fixing syntax errors, such as unmatched parentheses and unintended cell references, that cause the formula to fail.
Ensure your data is organized in a perfectly consistent pattern (e.g., every group has exactly 4 columns) and verify that the lookup value actually exists in the specified search range.
Apply the Specialized INDEX and MATCH Formula
Use a combination of INDEX, MATCH, and the INT function to calculate the correct column offset for repeating data groups.
When data is organized in repeating groups, a standard MATCH function only finds the exact position of the lookup value. By integrating the INT function, you can mathematically calculate the starting column of the group that contains your matching value.
Click on the cell where you want the supplier name or corresponding value to appear.
Type =INDEX($G$1:$V$1,INT((MATCH(X3,G3:V3,0)-1)/4)*4+1) into the formula bar.
If your data group has a different number of columns (for example, adding a 'DDD' field makes it 5 columns per group), change both the /4 and *4 in the formula to /5 and *5.
Press Enter to execute the formula. If needed, drag the fill handle down to apply this formula to multiple rows.
Troubleshoot Common Formula Errors
Fix typical syntax and reference issues that cause the formula to return an error, such as typos or mismatched brackets.
Use WPS Spreadsheet for Complex Data Lookups
WPS Spreadsheet fully supports advanced array formulas, including complex INDEX and MATCH combinations. You can seamlessly handle repeating data groups, analyze large datasets, and effortlessly troubleshoot formula syntax errors.
- 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your .xlsx file containing the repeating group data.
- 2. Input the lookup formula: Select your result cell and enter the =INDEX(..., INT(...)) formula exactly as you would in standard spreadsheet software.
- 3. Use Error Checking if needed: If the formula returns an error, click the warning icon next to the cell or navigate to the Formulas tab to evaluate the calculation step-by-step.

Frequently Asked Questions
Why does my INDEX and MATCH formula return a #N/A error?
A #N/A error usually means the MATCH function cannot find the lookup value in your specified range. Ensure there are no typos, extra trailing spaces, or data type mismatches between the lookup value and the cells in the search array.
How do I adjust this formula if I add another column to each repeating group?
In the formula =INDEX(...,INT((MATCH(...)-1)/4)*4+1), the number 4 represents the number of columns in each group. If you add one column, making it 5 columns per group, you must change both instances of 4 to 5.
Can I use absolute references to drag the formula down to other rows?
Yes. Make sure your header range in the INDEX function is absolute (e.g., $G$1:$V$1) so it doesn't shift when you drag the formula down. Leave the row references relative (like G3:V3) if you want them to automatically adjust for each subsequent row.




