PC Review


Reply
Thread Tools Rate Thread

Add value if date is in an interval... tricky?!

 
 
=?Utf-8?B?TWlrYWVsIExpbmRxdmlzdA==?=
Guest
Posts: n/a
 
      11th Nov 2007
This may sound easy, and I thought it would be easy, but after som thought I
realize that what I'm trying to do probably requires a bit of hard-thinking.

I have got a table that I exported from my database (Access) and it has 3
columns (call this list1)

1. Date1
2. Date2
3. A value

Now, I have created another column with dates (in chronological order),
ranging from 2005-01-01 to 2007-10-31 (call this list2) and I want - for each
of this dates - to have a SUM of all values THAT have the date in their
interval (interval between Date1 and Date2).

So, for my first date in list2: "2005-01-01" I want to have a total sum of
all values in list1 where "2005-01-01" is between Date1 and Date2.

And so on for rest of the dates in list2 (2005-01-02 -- 2007-10-31).

(I really need this for a much promised and anticipated report analyzing our
sales, so all help is MUCH appreciated)

Cheers,
Mikael

(This is cross-posted in Excel functions)


 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      11th Nov 2007
=SUMPRODUCT(--(list2date>=list1date1),--(list2date<=list1date2),list1value)

where list1date1 is the range of date1's etc.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Mikael Lindqvist" <(E-Mail Removed)> wrote in
message news:737F3F48-88D5-49AA-AD87-(E-Mail Removed)...
> This may sound easy, and I thought it would be easy, but after som thought
> I
> realize that what I'm trying to do probably requires a bit of
> hard-thinking.
>
> I have got a table that I exported from my database (Access) and it has 3
> columns (call this list1)
>
> 1. Date1
> 2. Date2
> 3. A value
>
> Now, I have created another column with dates (in chronological order),
> ranging from 2005-01-01 to 2007-10-31 (call this list2) and I want - for
> each
> of this dates - to have a SUM of all values THAT have the date in their
> interval (interval between Date1 and Date2).
>
> So, for my first date in list2: "2005-01-01" I want to have a total sum of
> all values in list1 where "2005-01-01" is between Date1 and Date2.
>
> And so on for rest of the dates in list2 (2005-01-02 -- 2007-10-31).
>
> (I really need this for a much promised and anticipated report analyzing
> our
> sales, so all help is MUCH appreciated)
>
> Cheers,
> Mikael
>
> (This is cross-posted in Excel functions)
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum.if date is in an interval... =?Utf-8?B?TWlrYWVsIExpbmRxdmlzdA==?= Microsoft Excel Worksheet Functions 6 13th Nov 2007 10:06 AM
Date Interval Predictions michaeloj.simpkins@gm.com Microsoft Excel Misc 1 31st Oct 2006 12:19 PM
Date Interval Predictions michaeloj.simpkins@gm.com Microsoft Excel Worksheet Functions 1 31st Oct 2006 11:48 AM
Tricky Date calculation: How to calculate a future date chriswessels@xtra.co.nz Microsoft Excel Misc 9 11th Aug 2006 04:24 AM
date interval help Access Microsoft Access Reports 1 6th Oct 2003 09:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:42 AM.