![]() |
Date function: 1st, 3rd and 5th Mondays of a month
Hello:
I wanted the value of a cell to change (either "yes" or "No") based on the following date conditions: Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of the month (else value = false) Is it possible to do so using a formula? If not what would be the VBA code required for this? Would appreciate help with this TIA Vinay |
Date function: 1st, 3rd and 5th Mondays of a month
|
Date function: 1st, 3rd and 5th Mondays of a month
Look at Chip Pearson's site and you can combine some of the formulas there
to do what you want: http://www.cpearson.com/excel/DateTimeWS.htm#NthDoWYear if you want to use VBA, you can find that as well: http://www.cpearson.com/excel/DateTimeVBA.htm#NDow -- Regards, Tom Ogilvy wrote in message ups.com... Hello: I wanted the value of a cell to change (either "yes" or "No") based on the following date conditions: Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of the month (else value = false) Is it possible to do so using a formula? If not what would be the VBA code required for this? Would appreciate help with this TIA Vinay |
Date function: 1st, 3rd and 5th Mondays of a month
Thanks Mika & Tom
Will give Pearson's site a try Vinay |
Date function: 1st, 3rd and 5th Mondays of a month
Here is a formula in "one shot" that should do it:
=IF(AND(WEEKDAY(TODAY(),2)=1,OR(DAY(TODAY())<8,AND (DAY(TODAY())14,DAY(TODAY())<22),DAY(TODAY())28) ),"YES","NO") -- - K Dales "Tom Ogilvy" wrote: Look at Chip Pearson's site and you can combine some of the formulas there to do what you want: http://www.cpearson.com/excel/DateTimeWS.htm#NthDoWYear if you want to use VBA, you can find that as well: http://www.cpearson.com/excel/DateTimeVBA.htm#NDow -- Regards, Tom Ogilvy wrote in message ups.com... Hello: I wanted the value of a cell to change (either "yes" or "No") based on the following date conditions: Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of the month (else value = false) Is it possible to do so using a formula? If not what would be the VBA code required for this? Would appreciate help with this TIA Vinay |
Date function: 1st, 3rd and 5th Mondays of a month
|
Date function: 1st, 3rd and 5th Mondays of a month
Thanks to K Dales, & Ron.
Both solutions worked Vinay |
All times are GMT +1. The time now is 06:17 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com