In cell D2 type =if(A2="","",if(A2=1,C2,C1))  This will associate main level name with all subgroups.

In cell E2 type =if(A2="","",if(B2="",E1+1,E1))  This will running count blanks in the numeric column for the main level

In cell F2 type =if(A2="","",if(AND(B2&gt;-1,B2&lt;10000),F1+1,F1))  This should running count non-numeric in the numeric column.

In cell G2 type =if(A2="","",if(C2="",G1+1,G1))  This should running count blanks in the description column

I don't have excel on this machine so this is untested.

Update for group sequence:
In cell H2 type =if(A2="",H1+1,H1)  This should generate a higher number sequence when the group changes.

In cell I2 type ="G"&amp;H2  This gets the H columns sequence and prefixes G by concatenation

If you paste all these functions down to the end of your data block, you should then be able to do a pivot table to "compress" everything into what you need as described in your specifications.  You can put the "I" and "D" columns in the row area of the pivot.  Double click each of these and for subtotals, select none.  The "E", "F" and "G" columns in the value area, double click each and pick "max".  Move the values to "columns" if the are vertically arranged.

Count values in multiple columns based on ranges in first column
I need to find a child control in a winforms panel. I was wondering if there is a method similar to Panel.FindControl() of the asp.net webforms panel in the .net winforms version
