DEV Community

Cover image for #144 — Insert Row after Specific Row
Judith-Data-Processing-Hacks
Judith-Data-Processing-Hacks

Posted on

2 1 1 1 1

#144 — Insert Row after Specific Row

Problem description & analysis:

Here below is a data table:

source table
Task: Insert one row after the number 100, and fill in a001, a002, … in turn, like this:

expected results

Solution:

Use SPL XLL and enter the following code:

=spl("=E@b(?1).group@i(~[-1].#1==100).(~|new(string(#,""a000""):_1)).conj()",A1:A9)
Enter fullscreen mode Exit fullscreen mode

Code explanation: Group the data. When the value in column A of the previous row is 100, create a new group.
Loop through each group, insert a record at the end of the group, whose value of the first column is the current group number #, formatted with “a000”.


Download esProc Desktop for FREE and simplify your workflow with SPL XLL!!! 🚀✨⬇️

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

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (1)

Collapse
 
judith677 profile image
Judith-Data-Processing-Hacks

Feel free to share your thoughts with us!

🎯Discord
🎯Reddit

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs