#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Sum by date

In column B, I am trying to add up the values in columns E, H, K, etc (every
third column), but ONLY if the corresponding date in columns C (for E), F
(for H), I (for K), etc (every third column) is within 6 months from TODAY.
I can move the data around if the values need to be next to the corresponding
dates, but that will move around some list validations I already have set up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Sum by date

I found this one in an old post and it is almost what I need:

=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY())-1,MONTH(TODAY()),1),B1:B100)

However, I need to use a rolling 6 months and this formula is using an
entire year. How would I change it? Thanks!

"hmsawyer" wrote:

In column B, I am trying to add up the values in columns E, H, K, etc (every
third column), but ONLY if the corresponding date in columns C (for E), F
(for H), I (for K), etc (every third column) is within 6 months from TODAY.
I can move the data around if the values need to be next to the corresponding
dates, but that will move around some list validations I already have set up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Sum by date

Have you tried
=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY()),MONTH(TODAY())-6,1),B1:B100) ?
--
David Biddulph

"hmsawyer" wrote in message
...
I found this one in an old post and it is almost what I need:

=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY())-1,MONTH(TODAY()),1),B1:B100)

However, I need to use a rolling 6 months and this formula is using an
entire year. How would I change it? Thanks!

"hmsawyer" wrote:

In column B, I am trying to add up the values in columns E, H, K, etc
(every
third column), but ONLY if the corresponding date in columns C (for E), F
(for H), I (for K), etc (every third column) is within 6 months from
TODAY.
I can move the data around if the values need to be next to the
corresponding
dates, but that will move around some list validations I already have set
up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Sum by date

I notice, however, that the formula you quoted wasn't "using an entire
year", but was going back to the first of the month, so from 17 March 2008
would go to 1 March 2007.
My formula does the same for 6 months so would go to 1 September 2007.
If you actually want to go back 6 months from today (to 17 September 2007),
then change the formula to
=SUMIF(A1:A100,"=" &
DATE(YEAR(TODAY()),MONTH(TODAY())-6,DAY(TODAY())),B1:B100)
--
David Biddulph

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
Have you tried
=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY()),MONTH(TODAY())-6,1),B1:B100) ?
--
David Biddulph

"hmsawyer" wrote in message
...
I found this one in an old post and it is almost what I need:

=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY())-1,MONTH(TODAY()),1),B1:B100)

However, I need to use a rolling 6 months and this formula is using an
entire year. How would I change it? Thanks!

"hmsawyer" wrote:

In column B, I am trying to add up the values in columns E, H, K, etc
(every
third column), but ONLY if the corresponding date in columns C (for E),
F
(for H), I (for K), etc (every third column) is within 6 months from
TODAY.
I can move the data around if the values need to be next to the
corresponding
dates, but that will move around some list validations I already have
set up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default Sum by date

I'm not sure if you only want to check for dates up to 6 months in the
future, or in the past also. Either way, to calculate the date 6 months from
now, paste this into an out-of-the-way cell:

=DATE(IF(MONTH(NOW())6,YEAR(NOW())+1,YEAR(NOW())) ,IF(MONTH(NOW())6,MONTH(NOW())-6,MONTH(NOW())+6),DAY(NOW()))

If you only want to check for future dates, start with a formula like this
in column B:

=SUMPRODUCT(--(C5:C1000<=$A$1),E5:E1000)

In this example, the date 6 months from today is found in cell AA1. Add as
many copies of the SUMPRODUCT formula as necessary to itself, editing the
column references each time. For example:

=SUMPRODUCT(--(C5:C1000<=$A$1),E5:E1000)+SUMPRODUCT(--(F5:F1000<=$A$1),H5:H1000)

Empty cells in the date columns won't cause problems, but text that Excel
can't interpret as a date will. Therefore, the format of your dates might
mean we need to adjust the formula.

If you want to look for past dates within 6 months as well as future dates,
then you can use something like this:

=SUMPRODUCT(--(ABS(C5:C1000-NOW())<=ABS($A$1-NOW())),E5:E1000)

Hope this helps,

Hutch

"hmsawyer" wrote:

In column B, I am trying to add up the values in columns E, H, K, etc (every
third column), but ONLY if the corresponding date in columns C (for E), F
(for H), I (for K), etc (every third column) is within 6 months from TODAY.
I can move the data around if the values need to be next to the corresponding
dates, but that will move around some list validations I already have set up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Sum by date

That is almost it, but it is calcuating by the month and not the day. For
instance, 8/31/07 is not returning a value (as it shouldn't--it's over 6
months from today), but 9/1/07 is---the oldest date that should return a
value today would be 9/19/07--exactly 6 months ago.

Thanks for the help!

"David Biddulph" wrote:

Have you tried
=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY()),MONTH(TODAY())-6,1),B1:B100) ?
--
David Biddulph

"hmsawyer" wrote in message
...
I found this one in an old post and it is almost what I need:

=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY())-1,MONTH(TODAY()),1),B1:B100)

However, I need to use a rolling 6 months and this formula is using an
entire year. How would I change it? Thanks!

"hmsawyer" wrote:

In column B, I am trying to add up the values in columns E, H, K, etc
(every
third column), but ONLY if the corresponding date in columns C (for E), F
(for H), I (for K), etc (every third column) is within 6 months from
TODAY.
I can move the data around if the values need to be next to the
corresponding
dates, but that will move around some list validations I already have set
up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Sum by date

I guess we were typing at the same time.

That worked! Thanks so much for the help!

"David Biddulph" wrote:

I notice, however, that the formula you quoted wasn't "using an entire
year", but was going back to the first of the month, so from 17 March 2008
would go to 1 March 2007.
My formula does the same for 6 months so would go to 1 September 2007.
If you actually want to go back 6 months from today (to 17 September 2007),
then change the formula to
=SUMIF(A1:A100,"=" &
DATE(YEAR(TODAY()),MONTH(TODAY())-6,DAY(TODAY())),B1:B100)
--
David Biddulph

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
Have you tried
=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY()),MONTH(TODAY())-6,1),B1:B100) ?
--
David Biddulph

"hmsawyer" wrote in message
...
I found this one in an old post and it is almost what I need:

=SUMIF(A1:A100,"=" & DATE(YEAR(TODAY())-1,MONTH(TODAY()),1),B1:B100)

However, I need to use a rolling 6 months and this formula is using an
entire year. How would I change it? Thanks!

"hmsawyer" wrote:

In column B, I am trying to add up the values in columns E, H, K, etc
(every
third column), but ONLY if the corresponding date in columns C (for E),
F
(for H), I (for K), etc (every third column) is within 6 months from
TODAY.
I can move the data around if the values need to be next to the
corresponding
dates, but that will move around some list validations I already have
set up,
so I'm trying to avoid it if possible.

I think it is a sum if, but I can't get it to work. Any help is
appreciated. Thank you so much!






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 get the random date between the start date and the end date? Sebation Excel Worksheet Functions 3 October 13th 07 12:20 PM
Report Date - Date Recv = Days Late, but how to rid completed date MS Questionnairess Excel Worksheet Functions 1 January 24th 07 11:05 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Make date change in excel to current date when opening daily? jamie Excel Discussion (Misc queries) 3 March 1st 06 03:37 PM
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM


All times are GMT +1. The time now is 07:55 AM.

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"