Forum Discussion
Get sales data for last year but in the next 12 weeks of todays date
Hi, please see attached workbook with proposed solution:
=SUMIF($A$1:$A$48,"<"&EDATE($E$1,3),$B$1:$B$48)
How would this work for individual products e.g. just for apples or oranges in my example
- Martin_AngostoJun 10, 2024Iron Contributor
- Excelenthusiast223Jun 10, 2024Copper Contributor
Thanks for clarifying that. I still don't think I have it right. Can you look the attached file. It is the full data with 2 sumif attempts. 'Test 2' is your formula. Thanks.
https://1drv.ms/x/s!AuBDc9CKOEvdgmjv4ygQf_al4NTe
- Martin_AngostoJun 10, 2024Iron Contributor
Hi Excelenthusiast223 ,
Edit: You are right. I completely misread your initial description of the problem. Have corrected the formula.
=SUMIFS($G$1:$G$119239,$A$1:$A$119239,">"&EDATE($N$1,-9),$F$1:$F$119239,K5)
Note that -9 comes from -12 months (one year) + 3 months (14 weeks as desired) = -9.
By the way: I have made the formula with the reference to a "Today's date" cell because using the function TODAY() would make the formulation change each day. I thought it is more convenient to use a reference to a manual-entry-cell for better or more convenient analysis purposes.