Home > Uncategorized > Last Day of Month in Excel

Last Day of Month in Excel

December 15th, 2004

My next Excel Top Tip is how to calculate the last day of a month. I thought there was a function to do this as part of a whole suite of date manipulation functions, but I seem to have imagined that, as I couldn’t find. I was dreading having to do lots of nasty date arithmetic, but then I discovered that the zeroth day of a month is treated as the last day of the previous month! So the last day of the month for the date that’s in cell B3 is simply:

=DATE(YEAR(B3), MONTH(B3)+1, 0)

It even works across year boundaries, so DATE(2004, 13, 0) really does give December 31st 2004!

Tony ,

  1. Louis Lodder
    May 3rd, 2006 at 11:20 | #1

    Well done old chap.

    Just love the web. You done this in 2004 and I needed it now.

    Thanks again.

  2. kika
    January 22nd, 2007 at 16:28 | #2

    Great help!! Thank you.

  3. Frederick Alfredo
    April 25th, 2007 at 14:14 | #3

    Thanks!!!

  4. May 9th, 2007 at 22:54 | #4

    Actually, Excel DOES offer the EOMONTH function to do get the last day of the month, but it’s not part of the main set of functions. You have to activate the Analysis Toolpack (under Tools->Add-ins) to get it.

    Of course, if you’re sharing your spreadsheet with other users, THEY have to make sure they have it enabled, too. Otherwise, all those nice dates you see on your screen turn into #NAME? errors on theirs. I’ve been having to deal with this at my office recently (today, in fact). I think I might just switch to your solution instead.

  5. Valdemar Barbosa
    September 20th, 2007 at 19:56 | #5

    much useful.

    Thanks so much.

    Valdemar

  6. Pankaj G
    July 8th, 2008 at 05:41 | #6

    That helped me impress my peers – three cheers for you !! :)
    PaNK CoOL

  7. Ric Manuel
    July 30th, 2008 at 10:37 | #7

    Plus one to thank you.

  8. Elangesh
    November 21st, 2008 at 10:36 | #8

    excellent information. Many more thanks for this.

  9. Christian
    December 15th, 2008 at 20:55 | #9

    Freaking brilliant.
    I used this for a sales calculation to mark revenue as ‘in month’ if the projected close was less than the last day of the month.

  10. B
    January 14th, 2009 at 21:32 | #10

    How do you calculate the last business day of the month????

  11. E.G.
    January 20th, 2009 at 03:46 | #11

    I think you just saved me an entire weekend!

  12. coolio
    April 23rd, 2009 at 11:54 | #12

    thanks a lot :-)

  13. Jim
    June 11th, 2009 at 23:02 | #13

    You are a rockstar! Thanks!

  14. Jbra
    December 18th, 2009 at 00:12 | #14

    @Louis Lodder
    HERE HERE. I us3ed it again in 2009!

  1. No trackbacks yet.