PSD, given use of XL2007 you might find the below is not "too" expensive performance wise
DATES
G4: =IF($A4="","",IFERROR(MIN(IF(Paste!$A$2:$A$10000=$A4,Paste!$D$2:$D$10000)),""))
confirmed with CTRL + SHIFT + ENTER
P4:
=IF(G4=0,0,IFERROR(MIN(IF((Paste!$A$2:$A$10000=$A4)*(Paste!$D$2:$D$10000>G4),Paste!$D$2:$D$10000)),""))
confirmed with CTRL + SHIFT + ENTER
copied to Y4 & AH4
apply Custom Format to G, P4, Y4 & AH4 of: mm/dd/yyyy;;
RESULTS
H4:
=IF(G4=0,"",IFERROR(AVERAGEIFS(Paste!$J$2:$J$10000,Paste!$A$2:$A$10000,$A4,Paste!$D$2:$D$10000,G4,Paste!$G$2:$G$10000,H$1),""))
J4:
=IF(G4=0,"",IFERROR(AVERAGEIFS(Paste!$J$2:$J$10000,Paste!$A$2:$A$10000,$A4,Paste!$D$2:$D$10000,G4,Paste!$G$2:$G$10000,J$1),""))
L4:
=IF(G4=0,"",IFERROR(AVERAGEIFS(Paste!$J$2:$J$10000,Paste!$A$2:$A$10000,$A4,Paste!$D$2:$D$10000,G4,Paste!$G$2:$G$10000,L$1),""))
N4:
=IF(G4=0,"",IFERROR(AVERAGEIFS(Paste!$J$2:$J$10000,Paste!$A$2:$A$10000,$A4,Paste!$D$2:$D$10000,G4,Paste!$G$2:$G$10000,N$1),""))
H4:O4 can be copied to Q4:X4, Z4:AG4, AI4:AP4
If the above proves too slow then you should consider other approaches (specifically based upon sorted source data & "keys" etc...)
Bookmarks