If i am understanding correctly . I would create a data item like below and count
if ([time] > 2 and [time] < 6 ) then [transaction]
If this does solve the problem . Can you please upload sample workbook with sample data ?
please find below code for conditional transaction count and avg time:
Countd(if [Time(min)] >1 and [Time(min)] < 7 then [Transaction] end)
AVG(if [Time(min)] >1 and [Time(min)] < 7 then [Time(min)] end)
Hope this could help