Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
How can I construct a formula that will relate TODAY to the 1st
Tuesday of each month. For example as today is 01/12/07, my formula should return 04/12/07, but if TODAY was 05/12/07, then it should return 01/01/08 etc Thanks With A1: =TODAY() =IF(A1-DAY(A1)+7-WEEKDAY(A1-DAY(A1)+4)A1, A1-DAY(A1)+7-WEEKDAY(A1-DAY(A1)+4),A1+32- DAY(A1+32)+7-WEEKDAY(A1+32-DAY(A1+32)+4)) You have a minor problem in your formula... it will produce the wrong date whenever the date in A1 is the first of the month on a Wednesday (try August 1, 2007 for example). This stems from your using the +7 and -4 adjusters. Normally, the fix would be to use +8 and -5 (at least that would be the fix in order to find the first such-and-such day in a month); however, I notice that your original formula and your formula modified as I just mentioned, both get December 31, 2008 wrong... they report February 3, 2009 instead of January 5, 2009 as the first Tuesday of the next month (given that December 31st is greater than its own first Tuesday)... I'm not sure off-hand what, if any, "rule" there is governing when this problem will crop up (mainly because I didn't look for one). Rick |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
function to return day in the form "Monday", "Tuesday" etc given . | Excel Worksheet Functions | |||
dates and 1st Tuesday of month | Excel Worksheet Functions | |||
Return mm/dd/yy based on 1st Day of Month | Excel Worksheet Functions | |||
Calculating first/last Monday, Tuesday, etc. in a given month in E | Excel Worksheet Functions | |||
Return 1st of the Month | Excel Worksheet Functions |