In column A the codes of products are given. B is the number of days by which if the date range is < this number, the quantities should be added. Max quantity is the sum of such quantities, given date A2-A1<B2.
However, this only calculates the max quantity for 2 consecutive dates. I need a formula for a varying date range, within each different code.
The attached file makes it easier to understand.
Please help!!
Bookmarks