Try this in E2 Drag/Fill down
Formula:
=IF(AND(C2="x",D2="x"),IF(COUNTIF(A$2:A2,A2)=1,B2+90,IF(B2>INDEX(E$2:E2,MATCH(A2,A$2:A2,0)),"past expiry date",IF(INDEX(E$2:E2,MATCH(A2,A$2:A2,0))="",B2+90,INDEX(E$2:E2,MATCH(A2,A$2:A2,0))))),"")
Note that your request is for the first date + 90 days, but your sample sheet indicates 92 days.
Change the 90 in the formula as required.
[EDIT]
I hope the "Someone" wasn't on a different forum, cross posting without warning isn't nice.
For the record I missed a condition and it is now corrected.
Bookmarks