Sort Date Column


C

CAL

I have a date column in the yyyy-mm-dd format. I want the user to be able to
sort the worksheet by month. Is there a way I can pull only the month from
the date field and allow the user to sort on that and have the worksheet
display all rows that fall within that month.
Example May - all columns with a date of 2009-05-01 through 2009-05-31 would
display.

PS - I am running Excel 2002
 
Ad

Advertisements

J

Jacob Skaria

With data as wuch; if you do the normal sort what happens?

If this post helps click Yes
 
M

Michael.Tarnowski

Hi Cal,
use a helper column and fill it with values extracted either by MONTH
() - if your date column values are in date format, or by FIND(), MID
() - if values are in text/string format. You can hide the helper
column and use a suitable control element for switching between
ascending/descending sorting.

HTH, have a nice day
Michael
 
Ad

Advertisements

A

Ashish Mathur

Hi,

Try this

1. Select the date column and go to Format cells (Ctrl+1). In Number >
Category > Custom > Type enter mmmm. Instead of dates, all months will
appear.
2. Now select the range once again (including the header row) and go to Sort
Options. In the drop down select January, February, March
3. Select ascending order
4. All the dates will now be sorted by month
5. Select the date column and go to Format cells (Ctrl+1). In Number >
Category > Custom > Type enter dd-mm-yyyy. Instead of months, all dates
will appear sorted by month

Hope this helps.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top