Function Problems

How to Count Matching Text in Specific Columns Across a Horizontal Excel Range

Algirdas JasaitisAlgirdas Jasaitis Nov 10, 2026 869 views

Question details

The user wants to count the occurrences of specific text within individual columns across a broad horizontal data range and transpose the results into a vertical list.

How to Count Matching Text in Specific Columns Across a Horizontal Excel Range
Product
Spreadsheet
Device & OS
not provided
Scenario
Transposing a horizontal dataset into a vertical search list to count partial text matches separately in each source column.
Observed behavior
The user needs an efficient formula to automate column-by-column text counting without relying on complex, nested legacy functions or converting the data into an Excel Table.
Before you start

Ensure your data is organized in a clear horizontal range and identify the target cell containing the specific text you want to search for. Check that your spreadsheet software supports dynamic array functions like LET, BYCOL, and LAMBDA if you plan to use the modern array approach.

Solution 1Recommended

Use Dynamic Array Functions (BYCOL, LAMBDA, and LET)

This modern approach uses dynamic arrays to efficiently process and count text matches column by column, transposing the result automatically into a vertical list.

This method leverages the BYCOL function to iterate through each column, the SEARCH function for partial, case-insensitive matching, and TRANSPOSE to output the results vertically.

1
Define the data range

Identify your horizontal source data range (e.g., F4:AAA100) and the cell containing your search text (e.g., $B$2).

2
Apply the LET and BYCOL formula

In your target cell, enter the following formula: =LET(data,F4:AAA100,TRANSPOSE(BYCOL(data,LAMBDA(c,SUM(--ISNUMBER(SEARCH($B$2,c))))))).

3
Adjust for exact matches

If you need case-sensitive or exact matching, replace the SEARCH function with EXACT in the formula: =LET(data,F4:AAA100,TRANSPOSE(BYCOL(data,LAMBDA(c,SUM(--EXACT($B$2,c)))))).

Use Dynamic Array Functions (BYCOL, LAMBDA, and LET)
Dynamic Arrays Support: This formula requires a modern spreadsheet version that supports dynamic array functions, such as Microsoft 365 or the latest version of WPS Office.
Advanced Data Processing

Count and Analyze Complex Data Easily with WPS Spreadsheet

WPS Spreadsheet fully supports advanced array formulas, enabling you to process large horizontal datasets, transpose data dynamically, and utilize functions like BYCOL and LAMBDA seamlessly without lag.

  1. 1. Open WPS Office: Launch WPS Office and open your workbook in the WPS Spreadsheet application.
  2. 2. Select target cell: Click on the cell where you want your vertical list of counts to begin.
  3. 3. Enter the array formula: Paste the =LET(...) array formula provided in the solution into the formula bar and press Enter.
  4. 4. Verify results: The results will automatically spill vertically downward, accurately counting the matching text for each individual column.
Full compatibility with Microsoft Excel formulas and functionsNative support for modern dynamic array functions like LET, LAMBDA, and BYCOLLightweight application that handles large datasets quickly and efficientlyCompletely free to use for everyday office and data analysis tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does the SEARCH function return a #VALUE! error when the text is not found?

The SEARCH function natively returns a #VALUE! error when it doesn't find the specified text. Wrapping it in ISNUMBER() converts valid findings to TRUE (1) and errors to FALSE (0), allowing the SUM function to aggregate the count properly without failing.

Can I make the text search case-sensitive in the array formula?

Yes. By default, the SEARCH function is case-insensitive. To perform a case-sensitive search, simply replace the SEARCH function with the FIND function in your LAMBDA formula.

What if my version of Excel or WPS Spreadsheet doesn't support the LAMBDA or BYCOL functions?

If dynamic array functions are not available in your current version, you can use traditional functions like COUNTIF combined with INDEX and ROW. For example, using =COUNTIF(INDEX($F$4:$AAA$100, 0, ROW(A1)), "*"&$B$2&"*") and dragging it down vertically will achieve the same column-by-column counting.