Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Add value if date is in an interval... tricky?!

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)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Add value if date is in an interval... tricky?!

=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" wrote in
message ...
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
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
Sum.if date is in an interval... Mikael Lindqvist Excel Worksheet Functions 6 November 13th 07 10:06 AM
lookup date in the interval Greg Excel Programming 4 November 20th 06 12:51 PM
Date Interval Predictions [email protected] Excel Discussion (Misc queries) 1 October 31st 06 12:19 PM
Date Interval Predictions [email protected] Excel Worksheet Functions 1 October 31st 06 11:48 AM
Tricky Date calculation: How to calculate a future date [email protected] Excel Discussion (Misc queries) 9 August 11th 06 04:24 AM


All times are GMT +1. The time now is 04:10 PM.

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

About Us

"It's about Microsoft Excel"