Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
speary
 
Posts: n/a
Default 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.


--
speary
------------------------------------------------------------------------
speary's Profile: http://www.excelforum.com/member.php...o&userid=24959
View this thread: http://www.excelforum.com/showthread...hreadid=388479

  #2   Report Post  
tjtjjtjt
 
Posts: n/a
Default

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   Report Post  
tjtjjtjt
 
Posts: n/a
Default

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   Report Post  
Jim May
 
Posts: n/a
Default

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

"speary" wrote in
message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Why do I get a #Name error when I use the DateDif function? PhilS Excel Worksheet Functions 9 April 5th 05 04:51 PM


All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"