#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Sorting dates

I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Sorting dates

Hi

With data in column A, enter in B1
=WEEKDAY(A1)
This will return the weekday number for that date and for 25/07/2007 that
will return 4.
Copy down.
Use Autofilter to select all values of 6 in column B

--
Regards
Roger Govier



"Old Keith" wrote in message
...
I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Sorting dates

"date" is a defined name range of dates

=IF(ISERR(SMALL(IF(WEEKDAY(date)=6,ROW(INDIRECT("1 :"&ROWS(date)))),ROWS($1:1))),"",INDEX(date,SMALL( IF(WEEKDAY(date)=6,ROW(INDIRECT("1:"&ROWS(date)))) ,ROWS($1:1))))

ctrl+shift+enter, not just enter
copy down


"Old Keith" wrote:

I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Sorting dates

Thanks Roger but it doesn't work if the date is prefixed with the day name.At
least I can't make it work on Excel 2003 or 2007.


"Roger Govier" wrote:

Hi

With data in column A, enter in B1
=WEEKDAY(A1)
This will return the weekday number for that date and for 25/07/2007 that
will return 4.
Copy down.
Use Autofilter to select all values of 6 in column B

--
Regards
Roger Govier



"Old Keith" wrote in message
...
I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Sorting dates

Hi Keith

Are you saying that your dates are text values, not true Excel dates?

If you enter 25/07/2007 in a cell and then use
FormatCellsNumberCustom dddd, mmm dd,yyyy
it will display as
Wednesday, Jul 25,2007
but it will still be held as an Excel serial date, upon which the Weekday()
function will work.

If you need to convert text values to true dates, and provided you have a
blank column to the right of your data, then one way would be
In B1 enter =MID(A2,FIND(",",A2)+1,255) and copy down as far as required.
Copy the whole of column BPasteSpecialValues back over the formulae.
Mark column B, DataText to columnsNextNextclick Datechoose from
dropdown M/D/YFinish

Format the resulting data as shown above.
--
Regards
Roger Govier



"Old Keith" wrote in message
...
Thanks Roger but it doesn't work if the date is prefixed with the day
name.At
least I can't make it work on Excel 2003 or 2007.


"Roger Govier" wrote:

Hi

With data in column A, enter in B1
=WEEKDAY(A1)
This will return the weekday number for that date and for 25/07/2007 that
will return 4.
Copy down.
Use Autofilter to select all values of 6 in column B

--
Regards
Roger Govier



"Old Keith" wrote in message
...
I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Sorting dates

Hi Roger
I followed your advise and it worked perfectly! Thanks very much.
The problem was that the data I was dealing with was imported as a CSV file
and would not respond to Excel commands, but when I re-entered the dates as
you suggested, it fixed the problem. And that "weekday and filter" is just
magic !
regards from Old Keith

"Roger Govier" wrote:

Hi Keith

Are you saying that your dates are text values, not true Excel dates?

If you enter 25/07/2007 in a cell and then use
FormatCellsNumberCustom dddd, mmm dd,yyyy
it will display as
Wednesday, Jul 25,2007
but it will still be held as an Excel serial date, upon which the Weekday()
function will work.

If you need to convert text values to true dates, and provided you have a
blank column to the right of your data, then one way would be
In B1 enter =MID(A2,FIND(",",A2)+1,255) and copy down as far as required.
Copy the whole of column BPasteSpecialValues back over the formulae.
Mark column B, DataText to columnsNextNextclick Datechoose from
dropdown M/D/YFinish

Format the resulting data as shown above.
--
Regards
Roger Govier



"Old Keith" wrote in message
...
Thanks Roger but it doesn't work if the date is prefixed with the day
name.At
least I can't make it work on Excel 2003 or 2007.


"Roger Govier" wrote:

Hi

With data in column A, enter in B1
=WEEKDAY(A1)
This will return the weekday number for that date and for 25/07/2007 that
will return 4.
Copy down.
Use Autofilter to select all values of 6 in column B

--
Regards
Roger Govier



"Old Keith" wrote in message
...
I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?







  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Sorting dates

Thanks for your help Mama. I have yet to figure out the formula but intend to
try it.
Regards, Old Keith

"Teethless mama" wrote:

"date" is a defined name range of dates

=IF(ISERR(SMALL(IF(WEEKDAY(date)=6,ROW(INDIRECT("1 :"&ROWS(date)))),ROWS($1:1))),"",INDEX(date,SMALL( IF(WEEKDAY(date)=6,ROW(INDIRECT("1:"&ROWS(date)))) ,ROWS($1:1))))

ctrl+shift+enter, not just enter
copy down


"Old Keith" wrote:

I have a list of dates in the format :
Wednesday,Jul 25,2007
I need to extract from that list all the Fridays.
Is it possible to sort the list into the days of the week ?

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
Sorting Dates Murray Excel Discussion (Misc queries) 3 July 23rd 06 08:59 PM
Sorting Dates [email protected] Excel Worksheet Functions 1 October 6th 05 11:19 PM
Sorting Dates allmad Excel Worksheet Functions 5 August 30th 05 03:38 PM
sorting using dates Tpason Excel Discussion (Misc queries) 1 January 14th 05 09:21 PM
Sorting dates Herb Excel Worksheet Functions 3 October 30th 04 01:22 AM


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