+ Reply to Thread
Results 1 to 4 of 4

=DATE(YEAR, MONTH, DAY) stop month increasing.

  1. #1
    Forum Contributor
    Join Date
    03-17-2013
    Location
    London, England
    MS-Off Ver
    Microsoft 365 MSO (Version 2202 Build 16.0.14931.20648) 32-bit
    Posts
    155

    =DATE(YEAR, MONTH, DAY) stop month increasing.

    Hi all,

    I have attached a test sheet in which i am trying to have a formula where in CELL A1 i enter a date and then this date increases to the last day of the month and then repeats 14 times, i used the formula.

    =DATE(YEAR(A1),MONTH(A1),DAY(A1)+1)

    This works for every date apart from the 1st of the months as it jumps a month (see highlighted in yellow on test sheet).

    Any idea how i can stop this, Or maybe there is a better way to do this formula, Has to be simple though and no macro.

    Thanks all.
    Attached Files Attached Files

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: =DATE(YEAR, MONTH, DAY) stop month increasing.

    Try

    A2=IF(DATE(YEAR($B$1), MONTH($B$1), DAY(B1)+1)=EOMONTH(B1,0),$B$1,DATE(YEAR($B$1), MONTH($B$1), DAY(B1)+1)) and drag down
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: =DATE(YEAR, MONTH, DAY) stop month increasing.

    In A2 and copy down

    =IF(A1+1>EOMONTH($A$1,0),$A$1,A1+1)
    Last edited by JohnTopley; 02-01-2016 at 09:12 AM.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =DATE(YEAR, MONTH, DAY) stop month increasing.

    This is over complicated
    =DATE(YEAR(A1),MONTH(A1),DAY(A1)+1)

    It can simply be
    =A1+1


    Try this, without the need for the Analysis Toolpack addin (so it can be backward compatible with XL2003).
    =IF(DAY(A1+1)=1,A$1,A1+1)
    Last edited by Jonmo1; 02-01-2016 at 09:39 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Running Totals from 24 hours to month, month to year without year decreasing
    By Safetyintern in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-20-2015, 01:13 PM
  2. Sort month/date/year data using month and date only
    By SMW820 in forum Excel General
    Replies: 8
    Last Post: 11-18-2014, 08:39 AM
  3. How can i show date in this form (month,last date of that month, Year)?
    By vjharry in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2014, 04:39 AM
  4. Need to convert Month/Date/Year to Year/Month/Date so excel will recognize
    By juliettelam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2014, 04:17 PM
  5. [SOLVED] Display the first date of the month when the month and year are selected
    By john dalton in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2013, 11:59 AM
  6. If Column A Month and Year = ColumnB Todays Month and Year then send email
    By HACCStaff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2013, 12:47 AM
  7. formula for prior month & year of a month end date.
    By mikeburg in forum Excel General
    Replies: 2
    Last Post: 09-25-2007, 04:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1