14.7 Insert row after specific row

 

Here below is a data table:

imagepng

The task is to insert one row after the number 100, and fill in a001, a002, … in turn, like this:

imagepng

Script:

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

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”.


esProc Desktop and Excel Processing
14.6 Add several blank rows every N rows
14.8 Insert blank row when meeting with data change