Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
=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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel option to store trendline's coefficients in cells for use | Charts and Charting in Excel | |||
Date & Time | New Users to Excel | |||
Automatically up date time in a cell | Excel Discussion (Misc queries) | |||
clock | Excel Worksheet Functions | |||
Why do I get a #Name error when I use the DateDif function? | Excel Worksheet Functions |