A further refinement is to add a trade code to each row, so you can then calculate P&L per closed trade.
In this way, each row represents a single ticket and groups of rows, not necessarily contiguous ones, represent a whole trade, as inidicated by the trade code.
You then do a =SUMIF...