Index/Match Formula - Sum if falls between a date range

Squiget

New Member
Joined
Dec 2, 2019
Messages
2
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

Please can someone help? :-)

I am trying to find a tidier version of the below formula - what I am trying to do is basically add up the values in row 2 for the week before. The displayed dates are Mon-Fri (not inc Sat-Sun).

Note, the below formula would be in cell F3, so on the 2nd Dec, I am looking up the values for 25th Nov-29th Nov, and adding these up.
=SUM(INDEX(2:2,MATCH(F1-7,1:1,0)),INDEX(2:2,MATCH(F1-6,1:1,0)),INDEX(2:2,MATCH(F1-5,1:1,0)),INDEX(2:2,MATCH(F1-4,1:1,0)),INDEX(2:2,MATCH(F1-3,1:1,0)))

ABCDEFGHIJ
1​
25-Nov​
26-Nov​
27-Nov​
28-Nov​
29-Nov​
02-Dec​
03-Dec​
04-Dec​
05-Dec​
06-Dec​
2​
100​
200​
300​
400​
500​
600​
700​
800​
900​
1000​

Thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Why not just:

=SUM(A2:E2)

or if you want to only show the total on Mondays:

=IF(WEEKDAY(F1)=2,SUM(A2:E2),"")
 
Upvote 0
How about in B3 copied right
=SUM($A2:A2)
 
Upvote 0
Hi guys,

Thanks for your responses. I think I over-simplified what I was trying to do.
I said that I wanted to sum up for the previous week, but really I need my formula to look up the 27 weeks previous - I was hoping to get a simple formula which I could then just adjust for the number of days/weeks.

I am trying to look up what was drawn down on a loan 189 days ago, to predict what I will need to pay back in the set week (27 weeks from drawn down date).

I have been having a play and I think the sumifs function will serve my purpose
Cell F3 = SUMIFS(2:2,1:1,">="&(F1-7),1:1,"<"&(F1-2))
(But in reality I will use SUMIFS(2:2,1:1,">="&(F1-189),1:1,"<"&(F1-184))

Thanks for your help :)
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top