#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cal Cal is offline
external usenet poster
 
Posts: 7
Default Sort Date Column

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Sort Date Column

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

If this post helps click Yes
---------------
Jacob Skaria


"CAL" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 95
Default Sort Date Column

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


CAL wrote:
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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Sort Date Column

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

"CAL" wrote in message
...
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


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
Auto-sort worksheet by date in column A avshook Excel Discussion (Misc queries) 4 August 29th 18 12:40 PM
Sort imported date column Michael Excel Discussion (Misc queries) 7 September 17th 08 07:00 PM
After I sort a column can I add the date to separate worksheets? Jeffrey Excel Discussion (Misc queries) 1 August 1st 08 01:24 AM
how to sort a column containing date of birth? ian borg Excel Discussion (Misc queries) 1 April 17th 07 12:52 AM
sort column in date order dd/mm/yy K Excel Discussion (Misc queries) 3 April 13th 05 09:00 PM


All times are GMT +1. The time now is 07:21 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"