Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
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: 84
Default Sum log entries based on date

You could try the built in subtotals feature (Data | Subtotals) or a pivot
table (Data | PivotTable...). If you want to use SumIf:

=SumIf(<range of cells to test, Cell of the given year/month/etc, <range to
sum)

So:
A B C
1 2005 nov 100
2 2005 dec 120
3 2006 jan 250

=SumIf(A1:A3, A1, C1:C3) would give you 220 (total for 2005).

If you insert a column that combines the year and month, then you could
sumif to get just the 2005_Nov values, etc.

" 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

I looked back over my work, and I've got this SUMIF() construct
working already. What I am having trouble with is using the YEAR()
function in the 'cell of the given year/month/etc.' doesn't seem to
work. I have the entire year in a single cell, not split into multiple
cells. I'd also like to keep it that way. If you know how to do so,
I'm game to figure it out.

Cheers,
Martin

On Feb 26, 5:51 pm, BobT wrote:
You could try the built in subtotals feature (Data | Subtotals) or a pivot
table (Data | PivotTable...). If you want to use SumIf:

=SumIf(<range of cells to test, Cell of the given year/month/etc, <range to
sum)

So:
A B C
1 2005 nov 100
2 2005 dec 120
3 2006 jan 250

=SumIf(A1:A3, A1, C1:C3) would give you 220 (total for 2005).

If you insert a column that combines the year and month, then you could
sumif to get just the 2005_Nov values, etc.

" 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



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

Put in a couple cells the following dates (to calc for 2007):

2007/01/01
2007/12/31

Then use the following formula:

=SumIf (<<range, "<=" & <<Dec 31 cell, <<range to sum) -
Sumif(<<range, "<" & <<Jan 1 cell, <<range to sum)

" wrote:

I looked back over my work, and I've got this SUMIF() construct
working already. What I am having trouble with is using the YEAR()
function in the 'cell of the given year/month/etc.' doesn't seem to
work. I have the entire year in a single cell, not split into multiple
cells. I'd also like to keep it that way. If you know how to do so,
I'm game to figure it out.

Cheers,
Martin

On Feb 26, 5:51 pm, BobT wrote:
You could try the built in subtotals feature (Data | Subtotals) or a pivot
table (Data | PivotTable...). If you want to use SumIf:

=SumIf(<range of cells to test, Cell of the given year/month/etc, <range to
sum)

So:
A B C
1 2005 nov 100
2 2005 dec 120
3 2006 jan 250

=SumIf(A1:A3, A1, C1:C3) would give you 220 (total for 2005).

If you insert a column that combines the year and month, then you could
sumif to get just the 2005_Nov values, etc.

" 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
Sum log entries based on date [email protected] Excel Discussion (Misc queries) 2 February 27th 07 03:42 AM
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
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 03:32 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"