Why not post a sample of your workbook as an attachment? It makes life easier all round.
Try this example workbook.
With your data in Column B as shown.
In A1
Drag/Fill Down as required![]()
=IF(ROW()=1,1,IF(B1="TOT",ROW(),""))
In C2
Drag/Fill Down as required.![]()
=IF(B2="TOT",MIN(INDEX(B:B,MAX($A$1:$A1)):INDEX(B:B,ROW())),"")
The helper, Column A, can be hidden, or use a grouping button as in this example.
Note the conditional formatting in Columns B & C.
Bookmarks