+ Reply to Thread
Results 1 to 4 of 4

rounding the DATEDIF function

  1. #1
    Registered User
    Join Date
    07-06-2005
    Posts
    15

    Question rounding the DATEDIF function

    Is there a way I can round the DATEDIF function so that partial months are counted as a whole month.

    For example here is what i want my spreadsheet to say;

    start date end date total months
    6/25/05 7/31/05 2


    right now my function makes total months equal to 1. Thanks for any suggestions.

  2. #2
    tjtjjtjt
    Guest

    RE: rounding the DATEDIF function

    This seems to work for your example, if you format the cell as general.

    =MONTH(B1)-MONTH(A1)+1

    --
    tj


    "speary" wrote:

    >
    > Is there a way I can round the DATEDIF function so that partial months
    > are counted as a whole month.
    >
    > For example here is what i want my spreadsheet to say;
    >
    > start date end date total months
    > 6/25/05 7/31/05 2
    >
    >
    > right now my function makes total months equal to 1. Thanks for any
    > suggestions.
    >
    >
    > --
    > speary
    > ------------------------------------------------------------------------
    > speary's Profile: http://www.excelforum.com/member.php...o&userid=24959
    > View this thread: http://www.excelforum.com/showthread...hreadid=388479
    >
    >


  3. #3
    tjtjjtjt
    Guest

    RE: rounding the DATEDIF function

    forgot to add:
    =ABS(MONTH(B1)-MONTH(A1))+1
    For your example, this will compensate, if the dates are flipped.

    --
    tj


    "speary" wrote:

    >
    > Is there a way I can round the DATEDIF function so that partial months
    > are counted as a whole month.
    >
    > For example here is what i want my spreadsheet to say;
    >
    > start date end date total months
    > 6/25/05 7/31/05 2
    >
    >
    > right now my function makes total months equal to 1. Thanks for any
    > suggestions.
    >
    >
    > --
    > speary
    > ------------------------------------------------------------------------
    > speary's Profile: http://www.excelforum.com/member.php...o&userid=24959
    > View this thread: http://www.excelforum.com/showthread...hreadid=388479
    >
    >


  4. #4
    Jim May
    Guest

    Re: rounding the DATEDIF function

    =datedif(startdate,enddate,"m")+1
    would that work for you?

    "speary" <speary.1sfnih_1121803543.0165@excelforum-nospam.com> wrote in
    message news:speary.1sfnih_1121803543.0165@excelforum-nospam.com...
    >
    > Is there a way I can round the DATEDIF function so that partial months
    > are counted as a whole month.
    >
    > For example here is what i want my spreadsheet to say;
    >
    > start date end date total months
    > 6/25/05 7/31/05 2
    >
    >
    > right now my function makes total months equal to 1. Thanks for any
    > suggestions.
    >
    >
    > --
    > speary
    > ------------------------------------------------------------------------
    > speary's Profile:
    > http://www.excelforum.com/member.php...o&userid=24959
    > View this thread: http://www.excelforum.com/showthread...hreadid=388479
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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