I have a list of dates and I need to pick up the largest date for every month. You can do it by sorting but I was wondering if there is another way for unsorted data.
If you have several years and you need the months for each year:
1) Add a column for each (entitled Month and Year, using the respective functions to calculate the value). I will assume these are in columns A to C
2) Add a criteria table of years and month (both ascending) in columns E & F entitled Year and Month (as per the main table), i.e.
Year Month
2006 11
2006 12
2007 1
etc
3) Next to the criteria table (say) enter the functions to G1 and below:
=DMAX($A$1:$C$n,1,$E$1:$F2)
where n is the last row in your source table.
If you simply select your list of dates, throw a pivot table at it, drag Date into ROW fields and group on 'Months and year' and then also drag Date into the DATA field.
Right click on any of the values you see and then choose field settings, and then where it says summarise by, choose max.
Finally, right click on any of the values you see, choose field settings, choose number and then pick a date format.
Done.
Took me a lot longer to write that than to do it.
Regards
Ken............
---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission
----------------------------------------------------------------------------
right click on the date field and choose "Group by"
If you have valid dates, excel will recognise this and give you month / year etc options
Rgds, Geoff
We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.