Sum a certain range based off date

greatcookies

Board Regular
Joined
Sep 25, 2005
Messages
187
I have a spreadsheet that contains dally sales in column K with the dates in column F. What I need is to get a MTD sum of sales and a YTD sum of sales based off the date, which will be in a separate sheet, cell C3. What I am thinking is a VLookup formula using the date in cell C3 as a reference. Once it finds this it will sum all sales above for that month. I am not sure, but you may have to have a formula for each month and use the 1st of that given month as a reference.

So, for example, let's say I want to get sales MTD for February, using 02/12/18 in cell C3 as my beginning point. February 1st sales are in K1129, so would I use a Vlookup and then sum sales from that point to K1129?

Any help in getting me started is much appreciated.

Thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Change cell references to match your ranges


Excel 2010
BCDEFGHIJK
1datesales
212/30/201799
31/2/20181
42/20/20181/3/20182
51/4/20183
6mtd8101/5/20184
7ytd12751/6/20185
81/7/20186
91/8/20187
101/9/20188
111/10/20189
121/11/201810
131/12/201811
141/13/201812
151/14/201813
161/15/201814
171/16/201815
181/17/201816
191/18/201817
201/19/201818
211/20/201819
221/21/201820
231/22/201821
241/23/201822
251/24/201823
261/25/201824
271/26/201825
281/27/201826
291/28/201827
301/29/201828
311/30/201829
321/31/201830
332/1/201831
342/2/201832
352/3/201833
362/4/201834
372/5/201835
382/6/201836
392/7/201837
402/8/201838
412/9/201839
422/10/201840
432/11/201841
442/12/201842
452/13/201843
462/14/201844
472/15/201845
482/16/201846
492/17/201847
502/18/201848
512/19/201849
522/20/201850
Sheet1
Cell Formulas
RangeFormula
C6=SUMPRODUCT(--(F2:F61<=C4),--(F2:F61>=DATE(YEAR(C4),MONTH(C4),1)),K2:K61)
C7=SUMPRODUCT(--(F2:F61<=C4),--(F2:F61>=DATE(YEAR(C4),1,1)),K2:K61)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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