SUMPRODUCT problems with dates

mas_lerdanch

Board Regular
Joined
Jun 25, 2007
Messages
64
=SUMPRODUCT(--(DATE(0,MONTH('Summer Comparison Yearly.xls'!Date2003),DAY('Summer Comparison Yearly.xls'!Date2003))<=DATE(0,MONTH(TODAY()),DAY(TODAY()))),('Summer Comparison Yearly.xls'!Profit))

Hello, I have a small problem. In my Excel document I have data for our turnover including a 'Date' column a Campaign column and a profit column. I have seperate worksheets for each year 2003, 2004, 2005... The last sheet is 2007 and contains data to date all the other worksheets contain data for the whole financial year which runs from September 30.

I want to compare the profit to date for each year so that it automatically updates each day I open the document. So for instance... the result would be equal to the SUM of Profit to Today (eg 8/07) in each respective year or sheet so I can compare the year with the bookings and turnover made on a daily basis without having to manually update each sheet every time.

The problem with the formula above (setup for the 2003 sheet) is that it does exactly that - If i run it now, it returns the correct data, ie the SUM of Profit up to today for the year. However it only returns data from 01/Jan/2003 - 08/Jul/2003 and none of the data prior to the 1st of Jan as the formula thinks the data for October, November & December is after July not before.

The Data for the Date column is formatted thus dd/mm

Please help.

Mas Lerdanch
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi Mas Lerndach:

So, today is 8-Jul-2007. Please clarify ...

1) from what date (dd-mmm-yyyy) to Today's date you want the data?
2) what column is the data in that you want to sum up?
3) what is the name of the worksheet with data?
4) what is the name of the workbook?

so we can understand what you are working with and what you are trying to accomplish.
 
Upvote 0
The Data on each sheet runs from Oct 1st - the sum i want is to equal all profit before todays date for that year so i can compare it with this years current figures - so for instance the result for today would be SUM = Total Profit up to 08/07 for any dates prior toy 08/07 including the dates before 1st Jan. the following formula looks for Profit prior to todays date but only gives a result for the profit between the 1st of january and todays date (day and month - not year) so it cant really be compared year on year - below is an example.

formula
=SUMPRODUCT(--(DATE(0,MONTH(Example.xls!Date2003),DAY(Example.xls!Date2003))<=DATE(0,MONTH(TODAY()),DAY(TODAY()))),(Example.xls!Profit2003))

example.jpg


Date
09/10
04/11
28/11
02/12
03/12
02/01
30/01
28/02
28/02
01/03
31/03
01/04
01/04
01/05
01/05
01/05
30/05
30/05
30/05
02/06
03/06
03/06
03/06
03/06
27/06
27/06
27/06
27/06
27/06
27/06
27/06
30/06
30/06
30/06
01/07
15/07
15/07
30/07
31/07
31/07
04/08
04/08
04/09

Campaign
BMC Summit
Internet
Country Walking
Trail
Other
Other
TGO
Recommendation
Trail
Recommendation
Trail Brochure Panels
Internet
Other
Internet
Recommendation
Recommendation
BMC Summit
Trail
Trail
Country Walking
BMC Summit
BMC Summit
BMC Summit
Internet
Other
Recommendation
Saturday Guardian
Saturday Guardian
TGO
Trail Brochure Panels
Trail Brochure Panels
Recommendation
Recommendation
Trail Brochure Panels
Recommendation
Internet
Internet
Recommendation
Internet
Internet
Internet
Recommendation
Other

Profit
£1,080.00
£1,125.00
£1,091.43
£219.43
£251.43
£274.29
£0.00
£357.28
£1,080.00
£1,414.28
£0.00
£466.40
£220.00
£1,001.00
£106.29
£174.86
£450.00
£199.89
£0.00
£246.86
£117.86
£100.29
£0.00
£384.00
£133.71
£668.57
£1,440.00
£0.00
£280.80
£402.86
£43.14
£478.80
£468.00
£466.29
£684.00
£178.28
£0.00
£0.00
£265.71
£0.00
£536.40
£0.00
£204.00
 
Upvote 0
1) from what date (dd-mmm-yyyy) to Today's date you want the data?

Each sheet is a different year 2003, 2004, 2005, 2006, 2007
29/09 would be the start date up to todays date (08/07) in 2003, 2004 etc

2) what column is the data in that you want to sum up?

4

3) what is the name of the worksheet with data?

Sheet1

4) what is the name of the workbook?

Example

Regards, Mas
 
Upvote 0
Hi Mas:

Thanks for posting the requested information. Following is a solution from a fresh look at what you are trying to accomplish ...

<html><head><title>Excel Jeanie HTML</title></head><body>
Excel Workbook
ABCDE
1Example
2
3DateCampaignProfitSumToDate
409-Oct-06BMC Summit1080.004725.58
504-Nov-06Internet1125.00
628-Nov-06Country Walking1091.43
702-Dec-06Trail219.43
803-Dec-06Other251.43
902-Jan-07274.29
10---------------------
11---------------------
12---------------------
13---------------------
1401-Apr-07
1530-May-07
1601-Jul-07Recommendation684.00
1715-Jul-07Internet178.28
Sheet3


</body></html>
I am proposing using the Month and Year in the Date comparison leading to a much more straight forward solution.

If you have a problem with this approach, please post back and let us see what else we can do.
 
Upvote 0
What I am after is a Sum of everything in the profit colum for all the dates before the same day as today in 2003 if I apply that formula it sums the total what i wasa trying to achieve was a comparison for 2003 for the profit taken before the same date as today but in 2003.

http://www.colletts.co.uk/Example.htm
 
Upvote 0
What I am after is a Sum of everything in the profit colum for all the dates before the same day as today in 2003 if I apply that formula it sums the total what i wasa trying to achieve was a comparison for 2003 for the profit taken before the same date as today but in 2003.

http://www.colletts.co.uk/Example.htm

Hi Mas:

Here we go ...

<html><head><title>Excel Jeanie HTML</title></head><body>
Excel Workbook
ABCDEF
1Example2002 - 2003TODAY()7/8/2007
2
3DateCampaignProfit
409-Oct-02BMC Summit1,080.00Formula to Date11659.47
504-Nov-02Internet1,125.00(in 2003)
628-Nov-02Country Walking1,091.43
702-Dec-02Trail219.43
803-Dec-02Other251.43
902-Jan-03Other274.29
1030-Jan-03TGO0.00
1128-Feb-03Recommendation357.28
1228-Feb-03Trail1,080.00
1301-Mar-03Recommendation1,414.28
1431-Mar-03Trail Brochure Panels0.00
1501-Apr-03Internet466.40
1601-Apr-03Other220.00
1701-May-03Internet1,001.00
1801-May-03Recommendation106.29
1901-May-03Recommendation174.86
2030-May-03BMC Summit450.00
2130-May-03Trail199.89
2230-May-03Trail0.00
2302-Jun-03Country Walking246.86
2403-Jun-03BMC Summit117.86
2503-Jun-03BMC Summit100.29
2603-Jun-03BMC Summit0.00
2703-Jun-03Internet384.00
2827-Jun-03Other133.71
2927-Jun-03Recommendation668.57
3027-Jun-03Saturday Guardian1,440.00
3127-Jun-03Saturday Guardian0.00
3227-Jun-03TGO280.80
3327-Jun-03Trail Brochure Panels402.86
3427-Jun-03Trail Brochure Panels43.14
3530-Jun-03Recommendation478.80
3630-Jun-03Recommendation468.00
3730-Jun-03Trail Brochure Panels466.29
3801-Jul-03Recommendation684.00
3909-Jul-03Internet178.28
4015-Jul-03Internet0.00
4130-Jul-03Recommendation0.00
4231-Jul-03Internet265.71
4331-Jul-03Internet0.00
4404-Aug-03Internet536.40
4504-Aug-03Recommendation0.00
4604-Sep-03Other204.00
Sheet4


</body></html>
Boy ... It took us so many iterations to finally get to the bottom of your requirement in specific unambiguous terms.
 
Upvote 0
Dear Yogi,

Thanks a million - I couldn't see the wood for the trees! should be a dynamic workbook when I have finished messing around with it.

All the best,

Mas :biggrin:
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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