#56 — Get The Same Rows from A Table

Problem description & analysis:

The Excel table below has 4 columns. If we regard columns from the 2nd to the 4th as a whole, there are duplicates, as shown below:

We want to select the same rows to form a new table while retaining the…


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing

Problem description & analysis:

The Excel table below has 4 columns. If we regard columns from the 2nd to the 4th as a whole, there are duplicates, as shown below:

original table
We want to select the same rows to form a new table while retaining the original order.

desired table

Solution:

Enter the following formula in SPL XLL:

=spl("=?.group@u(~.to(2,)).select(~.len()>1).conj()",A2:D15)

As shown in the picture below:

result table with code entered

Explanation:

group()function groups the table rows; @ u option enables keeping the original order; ~ is the current member; and to(2,) gets child members of the current member from the 2nd to the last.

This case was originally on StackOverflow. The conventional solution is quite complicated, while the SPL approach is much simpler and more efficient.

Feel free to download esProc Desktop for FREE and experience the efficiency yourself:

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


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing


Print Share Comment Cite Upload Translate Updates
APA

Judith-Excel-Sharing | Sciencx (2024-09-03T03:33:17+00:00) #56 — Get The Same Rows from A Table. Retrieved from https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/

MLA
" » #56 — Get The Same Rows from A Table." Judith-Excel-Sharing | Sciencx - Tuesday September 3, 2024, https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/
HARVARD
Judith-Excel-Sharing | Sciencx Tuesday September 3, 2024 » #56 — Get The Same Rows from A Table., viewed ,<https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/>
VANCOUVER
Judith-Excel-Sharing | Sciencx - » #56 — Get The Same Rows from A Table. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/
CHICAGO
" » #56 — Get The Same Rows from A Table." Judith-Excel-Sharing | Sciencx - Accessed . https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/
IEEE
" » #56 — Get The Same Rows from A Table." Judith-Excel-Sharing | Sciencx [Online]. Available: https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/. [Accessed: ]
rf:citation
» #56 — Get The Same Rows from A Table | Judith-Excel-Sharing | Sciencx | https://www.scien.cx/2024/09/03/56-get-the-same-rows-from-a-table/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.