It is not uncommon that we want to sum data on the basis of certain criteria – on the basis of weeks, months, every tenth day and so on. When we need to do it for larger data sets, we usually define start and the end points, but when we are not sure about the start and then? points, we have to do it repeatedly. Repeatedly in the sense that we have to describe starting and the ending point for every period – week, month or any other period.
So let’s consider a case where want to find the sum of (or consolidate sales for) every 3rd, 5th and 7th day of a sales at a super store. The data looks like following figure:
We will be using a combination of OFFSET () & SUM