Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Sumproduct - Date Range

I am using dates as a parameter in a Sumproduct, they are formatted as
mmmm-yy but I am only using the last day of the month.

I want to add up everything within a 12 month period. How can I do this
using 'GREATER THAN' and 'LESS THEN OR EQUAL TO'.

So if the date is 31/03/2009, how can I add up everything within the date
range 30/04/2008 - 31/03/2009?

Currently I am doing it by identifying the row ranges for each period but
want the formula to be more dynamic in case things get added.

Thanks
Rick

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Sumproduct - Date Range

greater than 1 date and equal to or less than another.

Why don't you use the logic of =start date, <=end date.

Use cells to hold your date boundaries.

A1 = start date
B1 = end date

C1:C100 = dates
D1:D100 = values to sum

=SUMPRODUCT(--(C1:C100=A1),--(C1:C100<=B1),D1:D100)

Or:

=SUMIF(C1:C100,"="&A1,D1:D100)-SUMIF(C1:C100,""&B1,D1:D100)

--
Biff
Microsoft Excel MVP


"Jackrabbit181" wrote in message
...
I am using dates as a parameter in a Sumproduct, they are formatted as
mmmm-yy but I am only using the last day of the month.

I want to add up everything within a 12 month period. How can I do this
using 'GREATER THAN' and 'LESS THEN OR EQUAL TO'.

So if the date is 31/03/2009, how can I add up everything within the date
range 30/04/2008 - 31/03/2009?

Currently I am doing it by identifying the row ranges for each period but
want the formula to be more dynamic in case things get added.

Thanks
Rick



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Sumproduct - Date Range

I want to add up everything within a 12 month period. How can I do this
using 'GREATER THAN' and 'LESS THEN OR EQUAL TO'.

So if the date is 31/03/2009, how can I add up everything within the date
range 30/04/2008 - 31/03/2009?


First off, the date range you show April 30, 2008 to March 31, 2009 is not a
12-month period; rather, it is only 11 months. Did you perhaps mean
01/04/2008 as the start date?

Anyway, assuming your dates are in Column A and the values you want to add
up are in Column B and the date we are using as the key date to calculate
from is in C1...

For the 11-month period your post asked for
----------------------------------------------------------------
=SUMPRODUCT((A1:A1000DATE(YEAR(C1)-1,MONTH(C1)+2,0))*(A1:A1000<=C1)*B1:B1000)

For a full 12-month period
----------------------------------------------------------------
=SUMPRODUCT((A1:A1000DATE(YEAR(C1)-1,MONTH(C1)+1,0))*(A1:A1000<=C1)*B1:B1000)

--
Rick (MVP - Excel)


"Jackrabbit181" wrote in message
...
I am using dates as a parameter in a Sumproduct, they are formatted as
mmmm-yy but I am only using the last day of the month.

I want to add up everything within a 12 month period. How can I do this
using 'GREATER THAN' and 'LESS THEN OR EQUAL TO'.

So if the date is 31/03/2009, how can I add up everything within the date
range 30/04/2008 - 31/03/2009?

Currently I am doing it by identifying the row ranges for each period but
want the formula to be more dynamic in case things get added.

Thanks
Rick


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct on date range Southpaw Excel Discussion (Misc queries) 3 June 12th 08 11:05 PM
sumproduct between date range Looping through Excel Worksheet Functions 14 December 20th 07 11:38 PM
Can a date range be used in SUMPRODUCT bruce Excel Worksheet Functions 2 December 17th 07 12:56 PM
SUMPRODUCT between date range Celia New Users to Excel 1 November 9th 06 06:39 PM
Sumproduct with date range ermeko Excel Worksheet Functions 6 August 16th 06 05:17 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"