Formula Errors

Fix Excel SEARCH Formula References and Range Errors

Camila MilosovichCamila Milosovich Dec 2, 2026 868 views

Question details

The user needs to correct a SEARCH formula that gives unexpected results when copied down a table.

Fix Excel SEARCH Formula References and Range Errors
Product
Microsoft Excel
Device & OS
not provided
Scenario
Search each row for a term and assign a number to matching rows.
Observed behavior
The search-term reference changes when the formula is filled down, and SEARCH is applied to an entire range instead of the current row's cell.
Before you start

Identify the cell containing the search term, the column to search, and the output column. In the example below, the term is in B2, the target cells start at J2, and results start in L2.

Solution 1Recommended

Lock the search term and search one cell per row

Use this formula when every row should be checked against the same search term in B2.

The absolute reference $B$2 stays fixed when the formula is copied down, while J2 changes to J3, J4, and so on. The expanding MAX range numbers matching rows based on earlier results.

1
Check the search term

Enter the term to find in cell B2. Avoid leaving B2 empty, because SEARCH treats an empty string as a match.

2
Enter the formula

Select L2 and enter =IF(ISNUMBER(SEARCH($B$2,J2)),MAX($L$1:L1)+1,0).

3
Fill down

Drag the fill handle from L2 down the output column. Each row searches its own cell in column J and returns 0 when there is no match.

4
Check the numbering range

Review the references in MAX($L$1:L1) if your output starts in another row or column. Keep the range limited to cells above the formula to avoid a circular reference.

Lock the search term and search one cell per row
Use a term from each row: If each row has its own search term in column B, replace $B$2 with B2 before filling the formula down.
Fix formulas in WPS Spreadsheets

Correct SEARCH references in WPS Spreadsheets

Use WPS Spreadsheets to lock a search-term reference, search each row's target cell, and fill the corrected formula down.

  1. 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
  2. 2. Enter the search term: Enter the term to find in B2 and confirm that the cells to search begin in J2.
  3. 3. Add the formula: Select L2 and enter =IF(ISNUMBER(SEARCH($B$2,J2)),MAX($L$1:L1)+1,0).
  4. 4. Fill and check: Drag the fill handle down column L, then check that matches are numbered and nonmatches return 0.
Use SEARCH and absolute references to check each rowOpen and edit Microsoft Excel XLSX and XLS filesFill formulas down with a familiar spreadsheet interfaceUse WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Why does B2 change to B3 when I copy the formula?

B2 is a relative reference. Use $B$2 in the formula to keep the search term fixed as you fill down.

What if each row has a different search term?

Use B2 instead of $B$2. When you fill the formula down, the reference changes to B3, B4, and so on.

Why should I use J2 instead of J2:J33 in SEARCH?

For a row-by-row result, J2 checks the target cell on the current row. A range can produce multiple results or spill behavior depending on the Excel version and formula context.

Is SEARCH case-sensitive?

No. SEARCH ignores letter case. Use FIND instead of SEARCH if the match must be case-sensitive.

Why does the formula return 0?

The formula returns 0 when ISNUMBER does not find a numeric SEARCH result, usually because the term is not present in the target cell. Check B2 and the corresponding cell in column J.