#57 — Concatenate Column Titles Corresponding to Empty Cells

Problem description & analysis:

An Excel table has column titles, and there are certain empty cells.

For each row, concatenate column titles corresponding to the empty cells with slashes (/).

Solution:

Enter the following…


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

Problem description & analysis:

An Excel table has column titles, and there are certain empty cells.

original table
For each row, concatenate column titles corresponding to the empty cells with slashes (/).

desired table

Solution:

Enter the following formula in SPL XLL:
=spl("=?.to(2,).(?(1)(~.pselect@a(!~)).concat($[/]))",A1:F8)

As shown in the picture below:

result table with code entered

Explanation:

pselect()finds positions of members meeting the specified condition; by default, it returns the position of the first eligible member; @a option enables returning positions of all eligible members. to(2,) gets members of a sequence from the 2nd to the last.

The example was originally on StackOverflow. Feel free to check the conventional solutions and compare them with the SPL approach to get the efficiency of it!

For more FREE resources, please refer to the following links ⬇️:

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-04T02:53:48+00:00) #57 — Concatenate Column Titles Corresponding to Empty Cells. Retrieved from https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/

MLA
" » #57 — Concatenate Column Titles Corresponding to Empty Cells." Judith-Excel-Sharing | Sciencx - Wednesday September 4, 2024, https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/
HARVARD
Judith-Excel-Sharing | Sciencx Wednesday September 4, 2024 » #57 — Concatenate Column Titles Corresponding to Empty Cells., viewed ,<https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/>
VANCOUVER
Judith-Excel-Sharing | Sciencx - » #57 — Concatenate Column Titles Corresponding to Empty Cells. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/
CHICAGO
" » #57 — Concatenate Column Titles Corresponding to Empty Cells." Judith-Excel-Sharing | Sciencx - Accessed . https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/
IEEE
" » #57 — Concatenate Column Titles Corresponding to Empty Cells." Judith-Excel-Sharing | Sciencx [Online]. Available: https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/. [Accessed: ]
rf:citation
» #57 — Concatenate Column Titles Corresponding to Empty Cells | Judith-Excel-Sharing | Sciencx | https://www.scien.cx/2024/09/04/57-concatenate-column-titles-corresponding-to-empty-cells/ |

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.