#42 — Skip Empty Cells To Sort Members
Judith-Excel-Sharing
Posted on August 9, 2024
Problem description & analysis:
In the Excel table below, column A and column B form the content structure. The dates in column A are not arranged in chronological order.
Task: Sort dates in column A in correct chronological order while keeping the empty cells in their original positions. Column B will remain what it is.
Solution:
Use SPL XLL to do this task:
=spl("=d=E@1(?), d(p=d.pselect@a(~))=d(p).sort(),d",A2:A9)
As shown in the picture below:
E@1 converts a data range to a single-layer sequence. pselect@a gets positions of all members meeting the specified condition; ~ is the current member. "sequence 1(a set of positions)= sequence 2" modifies members of sequence 1 at specified positions into sequence 2.
Posted on August 9, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
August 13, 2024