logo
search
Formula Errors

How to Use Excel INDEX and MATCH Formula for Repeating Groups

Maira MehtabMaira Mehtab Sep 20, 2026 872 views

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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

Click on the cell where you want the supplier name or corresponding value to appear.

2
Enter the base formula

Type =INDEX($G$1:$V$1,INT((MATCH(X3,G3:V3,0)-1)/4)*4+1) into the formula bar.

3
Adjust the interval multiplier

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.

4
Execute and fill

Press Enter to execute the formula. If needed, drag the fill handle down to apply this formula to multiple rows.

Understanding the formula math: The INT((MATCH-1)/4)*4+1 sequence calculates which group the matched item falls into, and multiplies it back by the group size (4) to return the very first column of that specific group where the supplier name is located.
Advanced Formulas in WPS Spreadsheet

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. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your .xlsx file containing the repeating group data.
  2. 2. Input the lookup formula: Select your result cell and enter the =INDEX(..., INT(...)) formula exactly as you would in standard spreadsheet software.
  3. 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.
Fully compatible with Microsoft Excel formulas and .xlsx file formats.Built-in error checking and formula evaluation tools to quickly spot syntax issues.Free and lightweight, providing a fast and smooth data processing experience.
microsoft office alternative - wps office

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.