Calculating the First Tuesday

by Allen Wyatt
(last updated June 16, 2018)


Christine needs a way to calculate the first Tuesday of any given month. So, given a month and a year, she needs to get the date of that first Tuesday.

There are quite a few different formulas you can use to achieve the desired result. Most approaches use the WEEKDAY function in some way because it can return a numeric value representing the day of the week for any given date. Assuming that you put a month in cell A1 (1 through 12) and a four-digit year in cell A2, then the following formulas will all return a date for the first Tuesday in the month. (I've arranged the formulas in order of length, from longest to shortest.)


If you find it more convenient to specify a date within the month you want to evaluate, then you can modify the formulas to take that into account. The follow are just a few formulas you could use if you put an actual date into cell A1:


Finally, you may want to consider a macro-based approach. The following is a user-defined function that quickly figures out the first Tuesday:

Function FirstTuesday(M As Integer, Y As Integer) As Date
    Dim dResult As Date

    dResult = DateSerial(Y, M, 1)
    Do While Weekday(dResult) <> vbTuesday
        dResult = DateAdd("d", 1, dResult)
    FirstTuesday = dResult
End Function

All you need to do in your worksheet is to pass the user-defined function the numeric month and year desired:


If you prefer, you can specify that the month and year are in a cell:


ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13540) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Indent and Justify Command

WordPerfect users are familiar with the F4 command, which indents and justifies a paragraph. Word does not have an ...

Discover More

Selecting Combo Boxes in Locked Worksheets

Once you protect a worksheet, you may run into problems with any combo boxes that the worksheet contains. This is a ...

Discover More

Quickly Changing Font Sizes

A quick little shortcut can help you easily step through different font sizes for whatever text you've selected. Word ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Calculating Fractions of Years

When working with dates and the relationship between dates, Excel provides a variety of worksheet functions that may ...

Discover More

Deciphering a Coded Date

It is no secret that Excel allows you to work with dates in your worksheets. Getting your information into a format that ...

Discover More

Unique Military Date Format

Some industries (such as the military) have special formatting that they use to represent dates. Here is one such format ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 4?

2018-06-25 10:15:43

Willy Vanhaelen

I think it's an execellent idea. It makes the formula easier to use. And it appropriate you can still use ± n days.

2018-06-25 09:43:12

Peter Atherton


Thanks for the new function and yes it is easier to understand. I will view Nick Rothstein and your comments after posting this.

I took the liberty of adding another variable to the Firstday function that I think makes it less likely to enter an error. What do you think?

Function FirstDay(Y As Integer, M As Integer, D As Integer, _
Optional wk2Add As Integer = 0) As Date
'Willy Vanhaelen
FirstDay = Application.Floor(DateSerial(Y, M, 7 - D), 7) + D + 7 * wk2Add
End Function

(see Figure 1 below)

Figure 1. 

2018-06-24 12:58:55

Willy Vanhaelen

Thanks for the compliment. While trying to answer your question I did some testing and realised that in this case the Evaluate method is not the best choice.
The result is an even shorter version of the UDF (and easier to understand):

Function FirstDay(Y As Integer, M As Integer, D As Integer) As Date
FirstDay = Application.Floor(DateSerial(Y, M, 7 - D), 7) + D
End Function

The Evaluate method is a good choice though to implement Excel's array formulas in VBA to avoid the use of a Loop resulting in much faster macros. If you are interested you can read the comments of Rick Rothstein and myself in this tip:
It's a fact that that the Evaluate method is the most poorly commented item in Excel's Help. If you want more, simple Google for "vba evaluate".

BTW: there is an error in row 4 of my picture: Third Tuesday of July should be Fourth Tuesday (or +21 in the formula must by +14 to get the third).

2018-06-24 05:14:38

Peter Atherton


Excellent stuff as usual! The UDF is definitely one for the Personal workbook.

Can you point me to to a good write-up on the Evaluate function? Thanks.

2018-06-23 06:41:50

Willy Vanhaelen

Here is a one-liner User Defined Function that does it all:

Function FirstDay(Y As Integer, M As Integer, D As Integer) As Date
FirstDay = Evaluate("FLOOR(DATE(" & Y & "," & M & "," & 7 - D & "),7)+" & D)
End Function

Syntax: =FirstDay(year,month,weekday)
weekday: 1 for Sunday ... 7 for Saturday

If you need to use this often then place the macro in a module of your Personal workbook and it will be available in any workbook you open.
Here are some examples:

(see Figure 1 below)

Figure 1. 

2018-06-20 14:38:58

Willy Vanhaelen

@Peter Atherton
Here is a much shorter formula to do the job:


(see Figure 1 below)

Figure 1. 

2018-06-20 09:19:40

Peter Atherton

Ignore the last post.

The following returns the first date for any workday.


(see Figure 1 below)

Figure 1. 

2018-06-19 06:31:05

Peter Atherton


a variation on your smashing formula

=CEILING(DATE($B$2,$B$1,1+Rwkday),7)-(1+Rwkday) to find th first occurrunce

=(CEILING(DATE($B$2,$B$1,1+Rwkday),7)-(1+Rwkday)+7*(WkNumber-1)) to get the nth occurence

(see Figure 1 below)

Figure 1. 

2018-06-17 08:08:38

Willy Vanhaelen

If you use my formula you get the same result:
but it is half the size :-).

2018-06-16 21:59:51


If you input the month and year of interest in two cells, one short formula will tell you the date of the first Tuesday of that month.
For example:
• input your month (1-12) in cell B1
• input the four-digit year in cell B2
• use this formula: =DATE(B2,B1,1)+7-WEEKDAY(DATE(B2,B1,1),13)
Be sure the formula cell is formatted as a date so the result is legible.

2018-06-16 08:28:37

Willy Vanhaelen

Here is probably the shortest possible formula for the first approuch:


As for the macro, here is a one-liner:

Function FirstTuesday(M As Integer, Y As Integer) As Date
FirstTuesday = Evaluate("CEILING(DATE(" & Y & " ," & M & ",5),7)-4")
End Function

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.