#62 - Search for A Specified String across The Whole Table

judith677

Judith-Excel-Sharing

Posted on September 11, 2024

#62 - Search for A Specified String across The Whole Table

Problem description & analysis:

We have two Excel sheets, and there are same-structure tables in the two sheets.
Sheet1

sheet1
Sheet2

sheet2
Task: Search every cell of each table and match their values with a specified string, such as foo. If the matching succeeds, list the whole current row.

desired table

Solution:

Enter the following formula in SPL XLL:
=spl("=(?1|?2).select(~.contain(?3))",Sheet1!A2:C7,Sheet2!A2:C7,"foo")

As shown in the picture below:

result table with code entered

Explanation:

The symbol | is used to concatenate two sequences.


The example was originally on StackOverflow. Feel free to compare the conventional solutions with the SPL approach to grasp the efficiency of esProc SPL. Download esProc Desktop and say hello to a streamlined table! 👋💻✨

SPL download address: esProc Desktop FREE Download

Plugin Installation Method: SPL XLL Installation and Configuration

References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

YouTube FREE courses: SPL Programming

💖 💪 🙅 🚩
judith677
Judith-Excel-Sharing

Posted on September 11, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related