How to Find Specific Text in Groups of Excel Cells
Question details
The user wants to search for a specific text value (like a word) within repeated groupings of cells (e.g., every 6 rows) and return the matched value to another cell, restricting the result to the first row of each group.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Restructuring or analyzing grouped data where specific string values need to be found and extracted from uniform chunks of rows without repeating the result on every single row.
- Observed behavior
- The user aims to output the matched text only at the beginning row of each n-row grouping using logical functions.
Ensure your data is organized in consistent, equally-sized groups (e.g., exactly 6 rows per group) before applying these formulas to prevent misalignment.
Return matched text in a basic cell range
Use a combination of IF and OR functions to check if a specific word exists anywhere in a specified range of cells.
This formula checks a predefined block of cells to see if it contains a specific text string. If the text is found within the range, it outputs the text; otherwise, it leaves the cell blank.
Click on the cell where you want the search result to appear.
Type the formula =IF(OR(A1:A6="Apple"),"Apple","") in the formula bar, modifying A1:A6 and "Apple" to match your actual data range and search term.
Press Enter to evaluate the formula. If the word exists in the range, it will display; otherwise, the cell will remain blank.

Limit the result to the first row of each group
Combine MOD, ROW, IF, and OR functions to ensure the extracted text only appears at the very beginning of your predefined row groups.
Easily Search and Extract Grouped Data in WPS Spreadsheet
WPS Spreadsheet fully supports advanced logical formulas like IF, OR, MOD, and ROW, allowing you to easily locate and extract text from grouped cell ranges with high efficiency.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your grouped data.
- 2. Select the result cell: Click on the cell corresponding to the first row of your data group where you want the result displayed.
- 3. Enter the formula: Input the IF and MOD formula adapted to your group size and search term.
- 4. Apply across all groups: Press Enter and use the drag-fill handle to copy the formula down, automatically evaluating all subsequent data groups.

Frequently Asked Questions
Can I search using a cell reference instead of a hardcoded text string?
Yes. You can replace the text "Apple" in the formula with an absolute cell reference, such as $C$1. For example: =IF(OR(A1:A6=$C$1),$C$1,""). This allows you to quickly change the search term without rewriting the entire formula.
How do I adjust the formula for groups of 10 rows instead of 6?
To adjust the group size, simply change the divisor in the MOD function and expand the search range. For groups of 10, the formula would become: =IF(MOD(ROW(A1)-1,10)=0,IF(OR(A1:A10="Apple"),"Apple",""),"").
Does this formula search for partial text matches?
No, the standard OR(A1:A6="Apple") formula searches for exact matches only. For partial matches, you would need to use a combination of functions like COUNTIF with wildcard characters, such as =IF(COUNTIF(A1:A6,"*Apple*")>0,"Apple","").




