First a quick background on dates in Excel.
Excel holds dates as numbers, starting with 1 for 01 January 1900
25 November 2009 is 40142
Excel also holds the time in the same number, but as the decimal part of the number, 12 noon is 0.5, i.e., half way through the day. Noon on 25 November is 40142.5
Excel allows you to format the date so that it shows in recognizable ways. A series of standard formats are available. In a cell with a date, right click and select Format cells, Numbers Tab - Date section.
However, there is also a Custom section in the Numbers Tab and you can create your own custom format, including "yyyy"
This will get the column of dates to show as year only e.g., 1985, but it does not change the underlying value in the cell. Enter 25-Nov-2009 in cell A1, then in Cell A2 enter A1+1 and it will show 26-Nov-2009.
Go to cell A1 and in the Numbers Tab, select Custom and enter yyyy in the Type: box.
The date in cell A2 doesn't change, showing that although cell A1 shows 2009, it still retains its original value of 40142. If it changed to 2009, A2 would be 2010 which in Excel dates was 02-July-1905 !
If you want to select cells that fall within a certain range you can create separate columns for years and months, using the formulas B1=Year(A1) and C1=Month(A1), but this gets complicated.
An easier way to do this is to create the date ranges you want and use formulas that act on the original date values.
Enter these dates in column A starting at Cell A1
In cells E1 to F2 enter these dates:
1 01-Aug-07 01-Aug-08
2 31-Aug-07 31-Aug-08
These make two ranges of dates: August in 2007 and August in 2008
In the cells underneath enter these formulas:
In cell E3
In cell F3
These formulas will give you the number of dates that fall into each range, as follows:
Hope this gives you enough information to get started with your solution.