Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 132
Default to sum the quantity of only applicable for last 7 days from today

I have a column with dates and another with quantities. I need a sum of the
quantity of only applicable for last 7 days from today.

Dates Quantities
11/12/2007 3
13/12/2007 4
14/12/2007 1
16/12/2007 5
17/12/2007 3
19/12/2007 2
20/12/2007 2
22/12/2007 1
23/12/2007 2
24/12/2007 3
25/12/2007 1
27/12/2007 3
28/12/2007 2
29/12/2007 5
31/12/2007 5
01/01/2008 3
03/01/2008 2

What would be the formula?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default to sum the quantity of only applicable for last 7 days from today


You could try this:-

=SUMPRODUCT(--(A1:A1000=TODAY()-7),--(A1:A1000<=TODAY()),B1:B1000)

Mike
"Narnimar" wrote:

I have a column with dates and another with quantities. I need a sum of the
quantity of only applicable for last 7 days from today.

Dates Quantities
11/12/2007 3
13/12/2007 4
14/12/2007 1
16/12/2007 5
17/12/2007 3
19/12/2007 2
20/12/2007 2
22/12/2007 1
23/12/2007 2
24/12/2007 3
25/12/2007 1
27/12/2007 3
28/12/2007 2
29/12/2007 5
31/12/2007 5
01/01/2008 3
03/01/2008 2

What would be the formula?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default to sum the quantity of only applicable for last 7 days from today

Perhaps an atypical approach:

This formula returns the sum of items
from today+1 through today+7,(12/22 through 12/28)

=SUMPRODUCT((A2:A100<=TODAY()+{-1,7})*B2:B100*{-1,1})

In your example, the formula returns 12.

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)



"Narnimar" wrote in message
...
I have a column with dates and another with quantities. I need a sum of the
quantity of only applicable for last 7 days from today.

Dates Quantities
11/12/2007 3
13/12/2007 4
14/12/2007 1
16/12/2007 5
17/12/2007 3
19/12/2007 2
20/12/2007 2
22/12/2007 1
23/12/2007 2
24/12/2007 3
25/12/2007 1
27/12/2007 3
28/12/2007 2
29/12/2007 5
31/12/2007 5
01/01/2008 3
03/01/2008 2

What would be the formula?




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
How to calculate # of days to the future from TODAY cardingtr Excel Discussion (Misc queries) 4 May 11th 23 07:44 PM
Days in a month as of today Daniel Q. Excel Worksheet Functions 2 January 25th 07 07:15 PM
Conditional formating using today() +/- 180 days mathew Excel Worksheet Functions 3 January 13th 07 01:49 AM
25 days previous to today? MaQ Excel Discussion (Misc queries) 5 March 14th 06 06:57 PM
how to calculate a date .. say 34 days from today shaunl Excel Discussion (Misc queries) 5 July 13th 05 02:38 PM


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

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"