DEV Community

Cover image for #62 - Search for A Specified String across The Whole Table
Judith-Excel-Sharing
Judith-Excel-Sharing

Posted on

#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

Top comments (1)

Collapse
 
judith677 profile image
Judith-Excel-Sharing

Ask away if you have any Excel-related problems, and we'll be more than happy to help:

🙌🏻Discord
🙌🏻Reddit