+ Reply to Thread
Results 1 to 3 of 3

Full months and DATEDIF

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    Western Mass
    MS-Off Ver
    Excel 2003
    Posts
    15

    Full months and DATEDIF

    I generally use DATEDIF to determine number of months between two dates, and it works 99% of the time.

    I have an instance where I want to write a function to count months, but if I were to use 01/01/2018 and 01/31/2018 DATEDIF I need something that would recognize that as a full month. Like start of date 01/01 to end of day 01/31 should be 1 month.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Full months and DATEDIF

    Maybe something like this?

    =DATEDIF(A1,B1+--(B1=EOMONTH(A1,0)),"m")

    Where A1 = start date and B1 = end date.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Full months and DATEDIF

    Any reason you can't just add 1 to the second date?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. [SOLVED] DATEDIF - DATEDIF Calculation returning a negative for days or months
    By DaveBre in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-27-2015, 06:22 PM
  2. Replies: 1
    Last Post: 08-03-2015, 10:46 PM
  3. Replies: 3
    Last Post: 07-16-2014, 01:50 AM
  4. [SOLVED] How i can add a value every 3 months in a full list of 48 months.
    By hbender in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-27-2014, 07:16 AM
  5. [SOLVED] How to count only full months between two dates
    By maytam in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-25-2013, 01:26 AM
  6. Replies: 1
    Last Post: 08-29-2013, 03:17 PM
  7. Computing full Months
    By Mike M. in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-15-2005, 02:06 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