try this all yellow cells have formulas and i changed h13:h20 to a simple countif
edit added second version with extra helper columns on data sheet instead ,wasn't sure which column you were getting date from so each version references a different column for date
Bookmarks