I don't think this can be done without using a helper column. If you can
sort your data by column B and then by column A so that all the same codes
are grouped together then you could use just a single helper column.
Otherwise, you'd need a helper column for each different code which may not
be practical.
For example, sort the data by column B (ascending order) then by column A
(ascending order) so that the data ends up like this:
01-Apr...ABC
01-Apr...ABC
08-Apr...ABC
11-Apr...ABC
01-Apr...DBA
03-Apr...GRT
08-Apr...GRT
05-Apr...HTA
08-Apr...HTA
05-Apr...JYU
10-Apr...JYU
Then, in column C starting in cell C3 you can enter this formula:
=IF(B3=B2,A3-A2,"")
This will return the differences between dates:
01-Apr...ABC....
01-Apr...ABC...0
08-Apr...ABC...7
11-Apr...ABC...3
01-Apr...DBA....
03-Apr...GRT....
08-Apr...GRT...5
05-Apr...HTA....
08-Apr...HTA...3
05-Apr...JYU....
10-Apr...JYU...5
If you have a list of the unique codes in column E:
E2 = ABC
E3 = DBA
E4 = GRT
E5 = HTA
E6 = JYU
To get the averages enter this formula in F2 and copy down to F6:
=IF(SUMIF(B$2:B$12,E2,C$2:C$12),SUMIF(B$2:B$12,E2,C$2:C$12)/SUMPRODUCT(--(B$2:B$12=E2),--(C$2:C$12<>"")),"")