Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default counting the number of events in a year

I have a list of fire events that I need to sort by year. The date field for
each event is formated as mm-dd-yyyy. I can't figure out how to restrict the
count function to just pick up the year. The data spans 40 years so I don't
want to have to write out 40 different date range functions. Any
suggestions? I thought this would be easier....
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default counting the number of events in a year

Let's say your year data is in column A. Try something like this

=SUMPRODUCT(--(YEAR(Sheet1!$A:$A)=2007))

If you want to count a specific event in the year, do this

=SUMPRODUCT(--(YEAR(Sheet1!$A:$A)=2007),--(Sheet1!$B:$B = "Event"))

--
HTH,
Barb Reinhardt



"Mytmini" wrote:

I have a list of fire events that I need to sort by year. The date field for
each event is formated as mm-dd-yyyy. I can't figure out how to restrict the
count function to just pick up the year. The data spans 40 years so I don't
want to have to write out 40 different date range functions. Any
suggestions? I thought this would be easier....

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default counting the number of events in a year

Perhaps a Pivot Table?

With
Col_A containing dates, with A1: EventDate
Col_B containing events, with B1: Event

From the Excel Main Menu: <Data<Pivot Table
Use: Excel..Click [Next]
Select your data..Click [Next]
Click the [Layout] button

ROW: Drag the EventDate field here
COLUMN: (Leave this field blank)
DATA: Drag the Event field field here
If it doesn't list as Count of Event...dbl-click it and set it to Count
Click [OK]
Select where you want the Pivot Table.Click [Finish].

That will list the Count of Event for each EventDate.

Not quite there yet...
Right-Click on the EventDate heading
Select: Group and Show Detail.......Group
Check: Year......Click [OK]

NOW the Pivot Table will list the Count of Event by Year.

To refresh the Pivot Table, just right click it and select Refresh Data

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"Mytmini" wrote in message
...
I have a list of fire events that I need to sort by year. The date field
for
each event is formated as mm-dd-yyyy. I can't figure out how to restrict
the
count function to just pick up the year. The data spans 40 years so I
don't
want to have to write out 40 different date range functions. Any
suggestions? I thought this would be easier....



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
Counting Weeks in a year Frances C[_2_] Excel Worksheet Functions 3 August 25th 07 12:01 AM
Age calculator and Total number of year counting Arvind Saxena Excel Discussion (Misc queries) 5 August 7th 07 09:24 AM
How do I count the number of events in a 90 day period? ericball Excel Worksheet Functions 2 February 12th 07 02:47 AM
Counting events since last occurences Tony the Bajan Excel Worksheet Functions 0 November 8th 06 05:59 PM
Counting the events osj Excel Worksheet Functions 3 March 11th 05 10:59 PM


All times are GMT +1. The time now is 11:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"