Counting number of occurrences up to x days previous to row date csv data