Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula for date selection

To summarise my earlier post: I have a list of dates, each with a
corresponding value, and my aim is to add up the values that correspond to
each month. The dates are not necessarily in order.

I had a very helpful response last time which allowed me to add up all the
January values, all the February values etc, using the formula

=SUMPRODUCT((MONTH($A$1:$A$100)=1)*(B1:B100))

which checks cells A1:A100 and if the month is January (1) adds the values
in column B. Now this is great, but now I have the added problem of needing
to select a month from a particular year i.e. January 2007 and January 2008
need to be totalled seperately. I'm sure there must be a similar way to do
this but if not I'll have to resort to using the Julian date format and use
range tables, which I'd rather not have to do!

Thanks to anyone who is able to help!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Formula for date selection

=SUMPRODUCT((MONTH($A$1:$A$100)=1)*(Year($A$1:$A$1 00)=2007)*(B1:B100))

"glitterjen" wrote:

To summarise my earlier post: I have a list of dates, each with a
corresponding value, and my aim is to add up the values that correspond to
each month. The dates are not necessarily in order.

I had a very helpful response last time which allowed me to add up all the
January values, all the February values etc, using the formula

=SUMPRODUCT((MONTH($A$1:$A$100)=1)*(B1:B100))

which checks cells A1:A100 and if the month is January (1) adds the values
in column B. Now this is great, but now I have the added problem of needing
to select a month from a particular year i.e. January 2007 and January 2008
need to be totalled seperately. I'm sure there must be a similar way to do
this but if not I'll have to resort to using the Julian date format and use
range tables, which I'd rather not have to do!

Thanks to anyone who is able to help!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Formula for date selection

Try this:

=SUMPRODUCT((MONTH($A$1:$A$100)=1)*(YEAR($A$1:$A$1 00)=2007)*(B1:B100))

or, rather than hardcode the search values within the formula, better
to put your month in one cell (X1) and the year in another (X2), like
so:

=SUMPRODUCT((MONTH($A$1:$A$100)=X1)*(YEAR($A$1:$A$ 100)=X2)*(B1:B100))

Hopr this helps.

Pete

On Jul 25, 10:12 am, glitterjen
wrote:
To summarise my earlier post: I have a list of dates, each with a
corresponding value, and my aim is to add up the values that correspond to
each month. The dates are not necessarily in order.

I had a very helpful response last time which allowed me to add up all the
January values, all the February values etc, using the formula

=SUMPRODUCT((MONTH($A$1:$A$100)=1)*(B1:B100))

which checks cells A1:A100 and if the month is January (1) adds the values
in column B. Now this is great, but now I have the added problem of needing
to select a month from a particular year i.e. January 2007 and January 2008
need to be totalled seperately. I'm sure there must be a similar way to do
this but if not I'll have to resort to using the Julian date format and use
range tables, which I'd rather not have to do!

Thanks to anyone who is able to help!



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
Dsum date based on selection of months [email protected] Excel Worksheet Functions 1 October 24th 06 03:49 AM
selection based on a date in a cell mattguerilla Excel Discussion (Misc queries) 2 October 1st 06 03:44 PM
Can I set up a calendar lookup for date selection Tangoxray Excel Discussion (Misc queries) 1 October 27th 05 12:55 PM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
Date Selection for Pivot Table Burak Emer Excel Discussion (Misc queries) 0 December 15th 04 08:19 AM


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