Search for a specified string across the whole table
We have two Excel sheets, and there are same-structure tables in the two sheets.
Sheet1
A |
B |
C |
|
1 |
Col1 |
Col2 |
Col3 |
2 |
foo |
1 |
NA |
3 |
bar |
2 |
y |
4 |
baz |
3 |
bar |
5 |
foo |
4 |
z |
6 |
bar |
5 |
NA |
7 |
baz |
6 |
foo |
Sheet2
A |
B |
C |
|
1 |
Col1 |
Col2 |
Col3 |
2 |
foo |
7 |
bar |
3 |
bar |
8 |
bar |
4 |
baz |
9 |
bar |
5 |
foo |
10 |
z |
6 |
bar |
11 |
y |
7 |
baz |
12 |
NA |
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.
E |
F |
G |
|
1 |
|||
2 |
foo |
1 |
NA |
3 |
foo |
4 |
z |
4 |
baz |
6 |
foo |
5 |
foo |
7 |
bar |
6 |
foo |
10 |
z |
Enter the following formula in SPL XLL:
=spl("=(?1|?2).select(~.contain(?3))",Sheet1!A2:C7,Sheet2!A2:C7,"foo")
The symbol | is used to concatenate two sequences.
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/