logo
search
Function Problems

How to Use Excel Formulas to Find All Rows Containing an Exact Value

Muhammad TalhaMuhammad Talha Oct 10, 2026 870 views

Question details

The user needs a spreadsheet formula to find the specific row numbers that contain an exact matching value, either returning just the first instance or extracting a list of all matching rows.

How to Use Excel Formulas to Find All Rows Containing an Exact Value
Product
Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
Searching through a dataset to locate specific data entries by returning their exact row numbers using a dynamic cell reference.
Observed behavior
The user wants to input a target value (such as a cell reference like HV4) and output either the first matching row number or a comprehensive array of all row numbers containing that exact value without manual filtering.
Before you start

Ensure your lookup column does not contain unintended leading or trailing spaces, as these hidden characters can prevent lookup formulas from identifying exact matches.

Solution 1Recommended

Find the First Exact Match Using the MATCH Function

Use the MATCH function when you only need to locate the row number for the very first instance of a specific value in a column.

The MATCH function searches for a specified item in a range of cells and then returns the relative position of that item. By setting the match type to FALSE (or 0), you force the formula to look for an exact match only.

1
Select the destination cell

Click on the empty cell where you want the row number to be displayed.

2
Enter the MATCH formula

Type the formula =MATCH(HV4, B:B, FALSE) into the cell or the formula bar. Replace 'HV4' with the cell containing your search value, and 'B:B' with the column you want to search.

3
Execute the formula

Press the Enter key. The cell will now display the row number of the first exact match. If no match is found, it will return an #N/A error.

Find the First Exact Match Using the MATCH Function
Relative vs Absolute Position: When referencing an entire column like B:B, the MATCH function returns the actual row number of the spreadsheet. If you reference a smaller range like B5:B100, it returns the position relative to that specific range.
Efficient Data Management

Easily Filter and Search Data in WPS Spreadsheet

WPS Spreadsheet fully supports advanced lookup functions like MATCH and dynamic array formulas like FILTER. It allows you to efficiently search large datasets, extract exact row numbers, and analyze your information seamlessly.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing the data you want to search.
  2. 2. Select your output cell: Click on the blank cell where you want the formula results to appear.
  3. 3. Enter the lookup formula: Type your preferred formula, such as =MATCH(HV4, B:B, FALSE) for a single result or =FILTER(ROW(B:B), B:B=HV4) for multiple results.
  4. 4. Press Enter to calculate: Hit Enter on your keyboard. WPS Spreadsheet will immediately process the function and display the matching row numbers.
Fully compatible with Microsoft Excel formulas, functions, and file formats (XLSX).Supports modern dynamic array features for advanced data extraction tasks.Lightweight application with a familiar, easy-to-navigate interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my MATCH formula return #N/A even when the exact value exists?

This error typically occurs due to hidden formatting mismatches, such as trailing spaces, invisible characters, or numbers formatted as text. You can use the TRIM function to remove extra spaces or ensure both the lookup cell and the target range share the same data format.

Can I search for a partial text match instead of an exact value?

Yes. When using the MATCH function, you can incorporate wildcard characters like the asterisk (*). For example, entering =MATCH("*"&HV4&"*", B:B, 0) will search for any row in column B that contains the text located in cell HV4.

Is the FILTER function available in older spreadsheet software?

The FILTER function relies on modern dynamic array architecture. If you are using an older version of Excel or a spreadsheet program that does not support dynamic arrays, this formula will return an error. In such cases, you must use more complex INDEX and AGGREGATE array formulas to list multiple matches.