Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Sum log entries based on date

I (often) make lists that function as a log book (kilometers for car
travel, sales book, etc.), that I then need to summarise by date (year
or month, etc.). I have been trying to figure out SUMIF(), and
attempted the conditional sum wizard and playing around with YEAR()
and MONTH(), but haven't had any luck.

An example: Column A is the date, Column B is a dollar value. Below
the list, I have 2 summary lines, one for 2005 (A10) and one for 2006
(A11).

The formula should accomplish the following:
If the date in Column A is in 2005 (hopefully using something like
YEAR(A1:A5)=A10), then add, else ignore.

I can get it working on a single entry, but can't seem to get a range
to work. Here's what I have:
=IF(YEAR(A1)=$A$10,SUM(B1),0)
The problem is that it's line by line, and doesn't use a range. Not
much of a summary!

Cheers,
Martin

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Sum log entries based on date

Try this:

=SUMPRODUCT(--(YEAR(A1:A9)=2005),(B1:B9))

HTH,
Elkar


" wrote:

I (often) make lists that function as a log book (kilometers for car
travel, sales book, etc.), that I then need to summarise by date (year
or month, etc.). I have been trying to figure out SUMIF(), and
attempted the conditional sum wizard and playing around with YEAR()
and MONTH(), but haven't had any luck.

An example: Column A is the date, Column B is a dollar value. Below
the list, I have 2 summary lines, one for 2005 (A10) and one for 2006
(A11).

The formula should accomplish the following:
If the date in Column A is in 2005 (hopefully using something like
YEAR(A1:A5)=A10), then add, else ignore.

I can get it working on a single entry, but can't seem to get a range
to work. Here's what I have:
=IF(YEAR(A1)=$A$10,SUM(B1),0)
The problem is that it's line by line, and doesn't use a range. Not
much of a summary!

Cheers,
Martin


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Sum log entries based on date

Works like a charm. Thanks!

But, I'm not sure I understand the two minus signs, or what they do.
They do seem necessary, but not self explanatory.

Cheers,
Martin

On Feb 26, 3:24 pm, Elkar wrote:
Try this:

=SUMPRODUCT(--(YEAR(A1:A9)=2005),(B1:B9))

HTH,
Elkar

" wrote:
I (often) make lists that function as a log book (kilometers for car
travel, sales book, etc.), that I then need to summarise by date (year
or month, etc.). I have been trying to figure out SUMIF(), and
attempted the conditional sum wizard and playing around with YEAR()
and MONTH(), but haven't had any luck.


An example: Column A is the date, Column B is a dollar value. Below
the list, I have 2 summary lines, one for 2005 (A10) and one for 2006
(A11).


The formula should accomplish the following:
If the date in Column A is in 2005 (hopefully using something like
YEAR(A1:A5)=A10), then add, else ignore.


I can get it working on a single entry, but can't seem to get a range
to work. Here's what I have:
=IF(YEAR(A1)=$A$10,SUM(B1),0)
The problem is that it's line by line, and doesn't use a range. Not
much of a summary!


Cheers,
Martin



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
advanced filtering based on entries ABOVE those I wish to keep Cale Excel Discussion (Misc queries) 0 August 1st 06 09:11 PM
Calculate a 30-day moving average based on the last x number of entries and date gimiv Excel Worksheet Functions 14 July 7th 06 12:49 PM
Counting unique entries based on given condition Hari Excel Discussion (Misc queries) 9 June 6th 06 08:37 PM
Selecting rows based on cell entries m.cain Excel Discussion (Misc queries) 2 March 24th 06 10:46 AM
I Need to Count Number of Entries Based on Two Criteria Jones Excel Worksheet Functions 3 July 14th 05 10:34 PM


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