Forum Discussion
BMB199
Apr 04, 2022Copper Contributor
SUM formula referencing dates
I need a SUMIF formula that will draw from the left table and provide a sum of the data between the dates FROM:TO and fill out the fields in bold in the right table. I've been trying to use SUMIF to make it work, but haven't been able to make it function.
How can I do this?
Date | Data1 | Data2 | From | To | Week | SUM Data1 btw FROM:TO | SUM Data2 btw FROM:TO | ||
01-07-19 | 2 | 1 | 01-07-19 | 02-07-19 | 1 | ||||
02-07-19 | 4 | 2 | 08-07-19 | 14-07-19 | 2 | ||||
03-07-19 | 5 | 3 | 15-07-19 | 21-07-19 | 3 | ||||
04-07-19 | 6 | 4 | 22-07-19 | 28-07-19 | 4 | ||||
05-07-19 | 7 | 5 | 29-07-19 | 04-08-19 | 5 | ||||
06-07-19 | 8.4 | 6 | |||||||
07-07-19 | 9.6 | 7 | |||||||
08-07-19 | 10.8 | 8 | |||||||
09-07-19 | 12 | 9 | |||||||
10-07-19 | 13.2 | 10 | |||||||
11-07-19 | 14.4 | 11 | |||||||
12-07-19 | 15.6 | 12 | |||||||
13-07-19 | 16.8 | 13 | |||||||
14-07-19 | 18 | 14 | |||||||
15-07-19 | 19.2 | 15 | |||||||
16-07-19 | 20.4 | 16 | |||||||
17-07-19 | 21.6 | 17 | |||||||
18-07-19 | 22.8 | 18 | |||||||
19-07-19 | 24 | 19 |
BMB199 Based on your example, assuming the top left corner is in A1 and the "Sum Data 1"-formula to be entered in I2, like this:
=SUMIFS(B$2:B$20,$A$2:$A$20,">="&$F2,$A$2:$A$20,"<="&$G2)
Copy down and across.
1 Reply
- Riny_van_EekelenPlatinum Contributor
BMB199 Based on your example, assuming the top left corner is in A1 and the "Sum Data 1"-formula to be entered in I2, like this:
=SUMIFS(B$2:B$20,$A$2:$A$20,">="&$F2,$A$2:$A$20,"<="&$G2)
Copy down and across.