Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default SumIf conditional to date range

I have the following data set:

A B
1 10/7/2008
2
3 10/1/2008 92
4 10/8/2008 59
5 10/17/2008 31
6 10/22/2008 42
7 10/29/2008 28
8
9 Total = 92

Where A1 is the current date, I want to sum the total of column B for all
cells where column B corresponds to a date less than cell A1. This total
will be displayed in cell B9.

I'm aware of the SUMIF function, but haven't been able to figure out how to
sum cells based on date without manually changing the formula. Ideally, for
example, if today's date is October 7th, then the formula in cell A1 is
=Today(), and the formula in cell B9 is =SUMIF(A3:B7,"<A1",B3:B7). However,
SUMIF doesn't work that way. Is there an alternative.
Please help!

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default SumIf conditional to date range

Make it easy:

=SUMPRODUCT(--(A3:A7<A1),(B3:B7))

"IlliniDan" wrote:

I have the following data set:

A B
1 10/7/2008
2
3 10/1/2008 92
4 10/8/2008 59
5 10/17/2008 31
6 10/22/2008 42
7 10/29/2008 28
8
9 Total = 92

Where A1 is the current date, I want to sum the total of column B for all
cells where column B corresponds to a date less than cell A1. This total
will be displayed in cell B9.

I'm aware of the SUMIF function, but haven't been able to figure out how to
sum cells based on date without manually changing the formula. Ideally, for
example, if today's date is October 7th, then the formula in cell A1 is
=Today(), and the formula in cell B9 is =SUMIF(A3:B7,"<A1",B3:B7). However,
SUMIF doesn't work that way. Is there an alternative.
Please help!

Thanks in advance!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default SumIf conditional to date range

=SUMPRODUCT((A3:A7<A1)*(B3:B7))


"IlliniDan" wrote in message
...
I have the following data set:

A B
1 10/7/2008
2
3 10/1/2008 92
4 10/8/2008 59
5 10/17/2008 31
6 10/22/2008 42
7 10/29/2008 28
8
9 Total = 92

Where A1 is the current date, I want to sum the total of column B for all
cells where column B corresponds to a date less than cell A1. This total
will be displayed in cell B9.

I'm aware of the SUMIF function, but haven't been able to figure out how
to
sum cells based on date without manually changing the formula. Ideally,
for
example, if today's date is October 7th, then the formula in cell A1 is
=Today(), and the formula in cell B9 is =SUMIF(A3:B7,"<A1",B3:B7).
However,
SUMIF doesn't work that way. Is there an alternative.
Please help!

Thanks in advance!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default SumIf conditional to date range

=sumif(a3:a7,"<"&a1,b3:b7)
or even
=sumif(a3:a7,"<"&today(),b3:b7)
(to avoid putting the formula in A1)


IlliniDan wrote:

I have the following data set:

A B
1 10/7/2008
2
3 10/1/2008 92
4 10/8/2008 59
5 10/17/2008 31
6 10/22/2008 42
7 10/29/2008 28
8
9 Total = 92

Where A1 is the current date, I want to sum the total of column B for all
cells where column B corresponds to a date less than cell A1. This total
will be displayed in cell B9.

I'm aware of the SUMIF function, but haven't been able to figure out how to
sum cells based on date without manually changing the formula. Ideally, for
example, if today's date is October 7th, then the formula in cell A1 is
=Today(), and the formula in cell B9 is =SUMIF(A3:B7,"<A1",B3:B7). However,
SUMIF doesn't work that way. Is there an alternative.
Please help!

Thanks in advance!


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default SumIf conditional to date range

You don't need the parens around the B3:B7

here is a simplify version:

=SUMPRODUCT(--(A3:A7<A1),B3:B7)


"Sean Timmons" wrote:

Make it easy:

=SUMPRODUCT(--(A3:A7<A1),(B3:B7))

"IlliniDan" wrote:

I have the following data set:

A B
1 10/7/2008
2
3 10/1/2008 92
4 10/8/2008 59
5 10/17/2008 31
6 10/22/2008 42
7 10/29/2008 28
8
9 Total = 92

Where A1 is the current date, I want to sum the total of column B for all
cells where column B corresponds to a date less than cell A1. This total
will be displayed in cell B9.

I'm aware of the SUMIF function, but haven't been able to figure out how to
sum cells based on date without manually changing the formula. Ideally, for
example, if today's date is October 7th, then the formula in cell A1 is
=Today(), and the formula in cell B9 is =SUMIF(A3:B7,"<A1",B3:B7). However,
SUMIF doesn't work that way. Is there an alternative.
Please help!

Thanks in advance!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default SumIf conditional to date range

Thanks to everyone who responded so quickly, much appreciated! Both the
Sumproduct and SumIf solutions worked.

"IlliniDan" wrote:

I have the following data set:

A B
1 10/7/2008
2
3 10/1/2008 92
4 10/8/2008 59
5 10/17/2008 31
6 10/22/2008 42
7 10/29/2008 28
8
9 Total = 92

Where A1 is the current date, I want to sum the total of column B for all
cells where column B corresponds to a date less than cell A1. This total
will be displayed in cell B9.

I'm aware of the SUMIF function, but haven't been able to figure out how to
sum cells based on date without manually changing the formula. Ideally, for
example, if today's date is October 7th, then the formula in cell A1 is
=Today(), and the formula in cell B9 is =SUMIF(A3:B7,"<A1",B3:B7). However,
SUMIF doesn't work that way. Is there an alternative.
Please help!

Thanks in advance!

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
Sumif date range Delsy Excel Worksheet Functions 6 March 22nd 12 06:51 PM
Sumif date range DB74 Excel Discussion (Misc queries) 2 May 9th 08 06:56 PM
SumIf with date range juliejg1 Excel Worksheet Functions 5 December 12th 07 10:23 PM
Sumif for Date Range Raza Excel Discussion (Misc queries) 3 April 11th 07 04:32 PM
SUMIF within date range as a function of today()'s date irvine79 Excel Worksheet Functions 8 August 6th 06 05:55 PM


All times are GMT +1. The time now is 03:29 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"