Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default order of days

Hi everyone,
I have in A1:Ax dates, formatted as "mm.dd.yyy", i need a formula that
will tell me which day is that day, but in the known way like monday,
tuesday,.... i know how to do this, i want to get something like this:
FIRST Monday of December 2008, like getting the date and telling me
which monday of this month is it, or say second saturday, fourth
wednesday, such things i mean.

i know how to get the last part (Monday of December 2008) but i have
no clue on how will i check which one is it? like first second, third?
how can i do this?

Thanks in advance for any help
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 747
Default order of days

try this

=INT(DAY(A1)/7)+1&" "&TEXT(A1,"dddd"&" of "&"mmmm yyyy")



On Nov 15, 5:16*pm, Totti wrote:
Hi everyone,
I have in A1:Ax dates, formatted as "mm.dd.yyy", i need a formula that
will tell me which day is that day, but in the known way like monday,
tuesday,.... i know how to do this, i want to get something like this:
FIRST Monday of December 2008, like getting the date and telling me
which monday of this month is it, or say second saturday, fourth
wednesday, such things i mean.

i know how to get the last part (Monday of December 2008) but i have
no clue on how will i check which one is it? like first second, third?
how can i do this?

Thanks in advance for any help


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,651
Default order of days

On Sat, 15 Nov 2008 04:16:32 -0800 (PST), Totti
wrote:

Hi everyone,
I have in A1:Ax dates, formatted as "mm.dd.yyy", i need a formula that
will tell me which day is that day, but in the known way like monday,
tuesday,.... i know how to do this, i want to get something like this:
FIRST Monday of December 2008, like getting the date and telling me
which monday of this month is it, or say second saturday, fourth
wednesday, such things i mean.

i know how to get the last part (Monday of December 2008) but i have
no clue on how will i check which one is it? like first second, third?
how can i do this?

Thanks in advance for any help


Something like:

=INDEX({"First","Second","Third","Fourth","Fifth"} ,
INT(DAY(A1)/7)+1)&" "&TEXT(A1,"dddd"&" of "&"mmmm yyyy")

--ron
  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default order of days

Thank you very much both,
Ron yours work great.
  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,651
Default order of days

On Sat, 15 Nov 2008 06:18:50 -0800 (PST), Totti
wrote:

Thank you very much both,
Ron yours work great.


You're welcome. I see now that mine is pretty much the same as muddan, except
I added a "translation" from "1" to "First" and so forth.
--ron


  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default order of days

INT(DAY(A1)/7)+1)

Found a bug in that.

8/28/1978 = Mon. The formula returns it as the 5th Mon when it should be the
4th Mon. No 5th Mon in 8/78.

11/21/1951 = Wed. The formula returns it as the 4th Wed when it should be
the 3rd Wed.

2/28/2008 = Thu. The formula returns it as the 5th Thu when it should be the
4th Thu. No 5th Thu in 2/08.

This works but may be overly complicated:

INT((WEEKDAY(A1-DAY(A1)+1-WEEKDAY(A1,2),2)+A1-(A1-DAY(A1)+1))/7)

--
Biff
Microsoft Excel MVP


"Ron Rosenfeld" wrote in message
...
On Sat, 15 Nov 2008 04:16:32 -0800 (PST), Totti
wrote:

Hi everyone,
I have in A1:Ax dates, formatted as "mm.dd.yyy", i need a formula that
will tell me which day is that day, but in the known way like monday,
tuesday,.... i know how to do this, i want to get something like this:
FIRST Monday of December 2008, like getting the date and telling me
which monday of this month is it, or say second saturday, fourth
wednesday, such things i mean.

i know how to get the last part (Monday of December 2008) but i have
no clue on how will i check which one is it? like first second, third?
how can i do this?

Thanks in advance for any help


Something like:

=INDEX({"First","Second","Third","Fourth","Fifth"} ,
INT(DAY(A1)/7)+1)&" "&TEXT(A1,"dddd"&" of "&"mmmm yyyy")

--ron



  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,510
Default order of days

The above formulas are not correct for all occurrences. They do not work
where the particular days are multiples of 7. Examples are Mondays in
January, April and July 2008 where Mondays are 7, 14, 21 and 28.

However, replacing the Int function +1 with Roundup appears to solve the
problem.

=ROUNDUP(DAY(A1)/7,0)&" "&TEXT(A1,"dddd"&" of "&"mmmm yyyy")



=INDEX({"First","Second","Third","Fourth","Fifth"} ,ROUNDUP(DAY(A1)/7,0))&"
"&TEXT(A1,"dddd"&" of "&"mmmm yyyy")

--
Regards,

OssieMac


"Ron Rosenfeld" wrote:

On Sat, 15 Nov 2008 06:18:50 -0800 (PST), Totti
wrote:

Thank you very much both,
Ron yours work great.


You're welcome. I see now that mine is pretty much the same as muddan, except
I added a "translation" from "1" to "First" and so forth.
--ron

  #8   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default order of days

This works but may be overly complicated:
INT((WEEKDAY(A1-DAY(A1)+1-WEEKDAY(A1,2),2)+A1-(A1-DAY(A1)+1))/7)


Found a bug in that one as well. Doesn't work if the dates are in the month
of January in the year 1900.

Looks like OssieMac has a nice compact solution.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
INT(DAY(A1)/7)+1)


Found a bug in that.

8/28/1978 = Mon. The formula returns it as the 5th Mon when it should be
the 4th Mon. No 5th Mon in 8/78.

11/21/1951 = Wed. The formula returns it as the 4th Wed when it should be
the 3rd Wed.

2/28/2008 = Thu. The formula returns it as the 5th Thu when it should be
the 4th Thu. No 5th Thu in 2/08.

This works but may be overly complicated:

INT((WEEKDAY(A1-DAY(A1)+1-WEEKDAY(A1,2),2)+A1-(A1-DAY(A1)+1))/7)

--
Biff
Microsoft Excel MVP


"Ron Rosenfeld" wrote in message
...
On Sat, 15 Nov 2008 04:16:32 -0800 (PST), Totti
wrote:

Hi everyone,
I have in A1:Ax dates, formatted as "mm.dd.yyy", i need a formula that
will tell me which day is that day, but in the known way like monday,
tuesday,.... i know how to do this, i want to get something like this:
FIRST Monday of December 2008, like getting the date and telling me
which monday of this month is it, or say second saturday, fourth
wednesday, such things i mean.

i know how to get the last part (Monday of December 2008) but i have
no clue on how will i check which one is it? like first second, third?
how can i do this?

Thanks in advance for any help


Something like:

=INDEX({"First","Second","Third","Fourth","Fifth"} ,
INT(DAY(A1)/7)+1)&" "&TEXT(A1,"dddd"&" of "&"mmmm yyyy")

--ron





  #9   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,651
Default order of days

On Sat, 15 Nov 2008 15:58:01 -0800, OssieMac
wrote:

The above formulas are not correct for all occurrences. They do not work
where the particular days are multiples of 7. Examples are Mondays in
January, April and July 2008 where Mondays are 7, 14, 21 and 28.

However, replacing the Int function +1 with Roundup appears to solve the
problem.

=ROUNDUP(DAY(A1)/7,0)&" "&TEXT(A1,"dddd"&" of "&"mmmm yyyy")



=INDEX({"First","Second","Third","Fourth","Fifth" },ROUNDUP(DAY(A1)/7,0))&"
"&TEXT(A1,"dddd"&" of "&"mmmm yyyy")


Good pickup.
--ron
  #10   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 51
Default order of days

Indeed you ve been all helpful, Thank you all
But it really "Looks like OssieMac has a nice compact solution" and it
is actually the one that got them all correct. cheers Ossie
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
Calc days between two dates and exclude leap year days scoz Excel Worksheet Functions 5 November 23rd 07 03:58 PM
How stop Excel file UK date order changing to US order in m.merge Roger Aldridge Excel Discussion (Misc queries) 1 October 9th 07 11:52 PM
COUNT how many ROWS ago out of 10 days that the highest high in 10 days was made rhhince Excel Worksheet Functions 1 January 14th 07 09:56 PM
I want a purchase order that includes page number (if to be order. Angela New Users to Excel 1 December 3rd 04 04:39 PM
Daily Macro to Download Data, Order and paste in order Iarla Excel Worksheet Functions 1 November 17th 04 01:59 PM


All times are GMT +1. The time now is 02:25 AM.

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"