Output Nth occurrence of day i.e. "First Monday of the month" from a Date

mikechamberlain

New Member
Joined
May 30, 2013
Messages
3
Hi guys, this is my first post. I am in desperate need of an experts help please:

I have a list of dates in excel (i.e. 12/05/2012) and I want to populate a corresponding column with the Nth occurrence of whatever day it happens to be in that particular month (i.e. 12/05/2012 would output "2nd Saturday in month")

Alternatively I would be happy with 2 columns being populated, one with the occurrence (i.e. 2) and the other with the day (i.e. Saturday).


Thanks in advance!!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
=TEXT(A1,"dddd")
will give the day

=INT(DAY(A1)/7)+1
will give the ordinal number
 
Upvote 0
@Special-K99

If the month doesn't begin on a Monday your formula falls over, see below :-
Ordinals[TABLE="class: html-maker-worksheet"]
<TBODY>[TR]
[TH][/TH]
[TH]A
[/TH]
[TH]B
[/TH]
[TH]C
[/TH]
[/TR]
[TR]
[TH]1
[/TH]
[TD="align: right"]12/05/2012
[/TD]
[TD]2nd Saturday
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TH]2
[/TH]
[TD="align: right"]13/05/2012
[/TD]
[TD]2nd Sunday
[/TD]
[TD="align: right"]2
[/TD]
[/TR]
[TR]
[TH]3
[/TH]
[TD="align: right"]14/05/2012
[/TD]
[TD]2nd Monday
[/TD]
[TD="align: right"]3
[/TD]
[/TR]
[TR]
[TH]4
[/TH]
[TD="align: right"]15/05/2012
[/TD]
[TD]3rd Tuesday
[/TD]
[TD="align: right"]3
[/TD]
[/TR]
</TBODY>[/TABLE]
Excel 2007

Cell
Formula
B1
=INT((DAY(A1)-DAY(EOMONTH(A1,-1)+1))/7)+1&CHOOSE(INT((DAY(A1)-DAY(EOMONTH(A1,-1)+1))/7)+1,"st ","nd ","rd ","th ","th ")& TEXT(A1,"dddd")
C1
=INT(DAY(A1)/7)+1
B2
=INT((DAY(A2)-DAY(EOMONTH(A2,-1)+1))/7)+1&CHOOSE(INT((DAY(A2)-DAY(EOMONTH(A2,-1)+1))/7)+1,"st ","nd ","rd ","th ","th ")& TEXT(A2,"dddd")
C2
=INT(DAY(A2)/7)+1
B3
=INT((DAY(A3)-DAY(EOMONTH(A3,-1)+1))/7)+1&CHOOSE(INT((DAY(A3)-DAY(EOMONTH(A3,-1)+1))/7)+1,"st ","nd ","rd ","th ","th ")& TEXT(A3,"dddd")
C3
=INT(DAY(A3)/7)+1
B4
=INT((DAY(A4)-DAY(EOMONTH(A4,-1)+1))/7)+1&CHOOSE(INT((DAY(A4)-DAY(EOMONTH(A4,-1)+1))/7)+1,"st ","nd ","rd ","th ","th ")& TEXT(A4,"dddd")
C4
=INT(DAY(A4)/7)+1

<TBODY>
[TD="bgcolor: #ffffff"] Worksheet Formulas [TABLE="class: html-maker-worksheet"]
<TBODY>[TR]

</TBODY>

[/TD]
[/TR]
</TBODY>[/TABLE]

hth
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top